OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
L3Shape.h
Go to the documentation of this file.
1 /*
2  * File: L3BinShape.h
3  * Author: dshea
4  *
5  * Created on July 21, 2015, 8:45 AM
6  */
7 
8 #ifndef L3SHAPE_H
9 #define L3SHAPE_H
10 
11 #include <stdint.h>
12 
13 namespace l3 {
14 
15 double constrainLat(double lat);
16 double constrainLon(double lon);
17 
18 class L3Shape {
19 protected:
20  int64_t totalBins; // total number of bins in the L3 bin shape
21  int32_t totalRows; // total number of rows in the L3 bin shape
22  double seamLon; // longitude of the start of the shape
23 
24 public:
25  L3Shape(int32_t numRows);
26  virtual ~L3Shape();
27 
28  virtual int32_t getNumRows() const;
29  virtual int64_t getNumBins() const;
30  virtual void constrainRow(int32_t &row) const;
31  virtual void constrainRowCol(int32_t &row, int32_t &col) const = 0;
32  virtual int64_t getBaseBin(int32_t row) const = 0;
33  virtual int32_t getNumCols(int32_t row) const = 0;
34 
35  virtual int32_t bin2row(int64_t bin) = 0;
36  virtual void bin2rowcol(int64_t bin, int32_t &row, int32_t &col) = 0;
37  virtual int64_t rowcol2bin(int32_t row, int32_t col) const = 0;
38  virtual void rowcol2latlon(int32_t row, int32_t col,
39  double &lat, double &lon) const = 0;
40  virtual void rowcol2latlon(int32_t row, int32_t col,
41  float &lat, float &lon) const;
42  virtual void bin2latlon(int64_t bin, double &lat, double &lon);
43  virtual void bin2latlon(int64_t bin, float &lat, float &lon);
44  virtual int32_t lat2row(double lat) const = 0;
45  virtual double row2lat(int32_t row) const = 0;
46  virtual void latlon2rowcol(double lat, double lon,
47  int32_t &row, int32_t &col) const = 0;
48  virtual int64_t latlon2bin(double lat, double lon) const = 0;
49  virtual void rowcol2bounds(int32_t row, int32_t col,
50  double &north, double &south,
51  double &east, double &west) const = 0;
52  virtual void rowcol2bounds(int32_t row, int32_t col,
53  float &north, float &south,
54  float &east, float &west) const;
55  virtual void bin2bounds(int64_t bin,
56  double &north, double &south,
57  double &east, double &west);
58  virtual void bin2bounds(int64_t bin,
59  float &north, float &south,
60  float &east, float &west);
61 };
62 
63 
64 }
65 
66 #endif /* L3SHAPE_H */
virtual int64_t getNumBins() const
Definition: L3Shape.cpp:63
double constrainLat(double lat)
Definition: L3Shape.cpp:13
virtual void constrainRowCol(int32_t &row, int32_t &col) const =0
virtual int64_t latlon2bin(double lat, double lon) const =0
virtual int32_t getNumCols(int32_t row) const =0
virtual void bin2rowcol(int64_t bin, int32_t &row, int32_t &col)=0
float * lat
virtual int32_t lat2row(double lat) const =0
virtual void rowcol2bounds(int32_t row, int32_t col, double &north, double &south, double &east, double &west) const =0
double constrainLon(double lon)
Definition: L3Shape.cpp:26
virtual void constrainRow(int32_t &row) const
Definition: L3Shape.cpp:71
virtual void latlon2rowcol(double lat, double lon, int32_t &row, int32_t &col) const =0
double seamLon
Definition: L3Shape.h:22
virtual void rowcol2latlon(int32_t row, int32_t col, double &lat, double &lon) const =0
virtual int64_t getBaseBin(int32_t row) const =0
virtual void bin2latlon(int64_t bin, double &lat, double &lon)
Definition: L3Shape.cpp:99
virtual int32_t bin2row(int64_t bin)=0
virtual int64_t rowcol2bin(int32_t row, int32_t col) const =0
L3Shape(int32_t numRows)
Definition: L3Shape.cpp:39
virtual int32_t getNumRows() const
Definition: L3Shape.cpp:55
virtual double row2lat(int32_t row) const =0
virtual void bin2bounds(int64_t bin, double &north, double &south, double &east, double &west)
Definition: L3Shape.cpp:148
float * lon
Definition: L3File.cpp:10
int64_t totalBins
Definition: L3Shape.h:20
virtual ~L3Shape()
Definition: L3Shape.cpp:48
int32_t totalRows
Definition: L3Shape.h:21