OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
VcstMapDataSet.h
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * NAME: VcstMapDataSet
4  *
5  **************************************************************************/
6 
7 #ifndef _VcstMapDataSet_H_
8 #define _VcstMapDataSet_H_
9 
10 #include <algorithm>
11 #include <VcstCmnConsts.h>
12 #include <mds.h>
13 #include <novas.h>
14 
15 //------------------------------------------------------------------------------
16 // Constants for instantiating N. & S. Mds. The values for the lat and lon are
17 // just in the opposite hemisphere that is being used, so that the MDS
18 // encapsulates the entire hemisphere.
19 //------------------------------------------------------------------------------
20 const double NORTH_UPPER_LEFT_LAT = (DEG2RAD * -20.747206768662e0);
21 const double NORTH_UPPER_LEFT_LON = (DEG2RAD * 145.0e0);
25 const double SOUTH_UPPER_LEFT_LON = (DEG2RAD * (-125.0e0));
26 //const double SOUTH_LOWER_RIGHT_LAT = SOUTH_UPPER_LEFT_LAT;
28 
29 //------------------------------------------------------------------------------
30 // Constant used to allow for small float-to-double conversion errors
31 // when checking values against PI.
32 //------------------------------------------------------------------------------
33 const double PI_EPSILON = 1.0e-7;
34 
38 enum Hemisphere {
40 };
41 
45 enum GridType {
57 };
58 
68 public:
69 
75  VcstMapDataSet(Hemisphere theHemisphere);
76 
80  virtual ~VcstMapDataSet();
81 
91  void fillMds(mds_type * const anMds) const;
92 
96  /* inline */
97  double getUpperLeftLatitude() const;
98 
102  /* inline */
103  double getUpperLeftLongitude() const;
104 
108  /* inline */
109  double getLowerRightLatitude() const;
110 
114  /* inline */
115  double getLowerRightLongitude() const;
116 
120  /* inline */
121  double getBiggestLatitude() const;
122 
126  /* inline */
127  double getBiggestLongitude() const;
128 
132  /* inline */
133  double getSmallestLatitude() const;
134 
138  /* inline */
139  double getSmallestLongitude() const;
140 
144  /* inline */
145  Hemisphere getHemisphere() const;
146 
150  /* inline */
151  int getGridType() const;
152 
162  virtual int latLonToGrid(
163  double rlat,
164  double rlon,
165  double* row,
166  double* column) = 0;
167 
177  virtual int gridToLatLon(
178  double row,
179  double column,
180  double* rlat,
181  double* rlon) = 0;
182 
183 
184 protected:
185 
190 
195 
200 
204  int mdsNum_;
205 
209  double stanLat1_;
210 
214  double stanLat2_;
215 
220 
225 
229  double maxRow_;
230 
234  double maxCol_;
235 
240 
245 
250 
255 
259  double upperLeftX_;
260 
264  double upperLeftY_;
265 
269  double lowerRightX_;
270 
274  double lowerRightY_;
275 
280 
285 
290 
294  double biggestLongitude_[2];
295 
300 
312  int checkLat(double &rlat);
313 
325  int checkLon(double &rlon);
326 
327 private:
328 
329 };
330 
331 //-----------------------------------------------------------------------------
332 
333 inline double
335  return upperLeftLatitude_;
336 }
337 
338 //-----------------------------------------------------------------------------
339 
340 inline double
342  return upperLeftLongitude_;
343 }
344 
345 //-----------------------------------------------------------------------------
346 
347 inline double
349  return lowerRightLatitude_;
350 }
351 
352 //-----------------------------------------------------------------------------
353 
354 inline double
356  return lowerRightLongitude_;
357 }
358 
359 //-----------------------------------------------------------------------------
360 
361 inline double
363  return biggestLatitude_;
364 }
365 
366 //-----------------------------------------------------------------------------
367 
368 inline double
370  return smallestLatitude_;
371 }
372 
373 //-----------------------------------------------------------------------------
374 
375 inline double
377  if (numberOfRanges_ == 1) {
378  return biggestLongitude_[0];
379  } else {
381  }
382 }
383 
384 //-----------------------------------------------------------------------------
385 
386 inline double
388  if (numberOfRanges_ == 1) {
389  return smallestLongitude_[0];
390  } else {
392  }
393 }
394 
395 //-----------------------------------------------------------------------------
396 
397 inline Hemisphere
399  return hemisphere_;
400 }
401 
402 //-----------------------------------------------------------------------------
403 
404 inline int
406  return gridType_;
407 }
408 
409 
410 #endif
411 
412 
413 
@ NORTHERN
double gridIncConstant_
Definition: mds.h:95
double smallestLatitude_
double getUpperLeftLatitude() const
double upperLeftLatitude_
double getLowerRightLongitude() const
These are used to scale the SD before writing it to the HDF4 file The default is and which means the product is not scaled at all Since the product is usually stored as a float inside of this is a way to write the float out as a integer l2prod min
const double SOUTH_UPPER_LEFT_LON
@ POLAR_AZMUTHAL_SOUTH
double getSmallestLongitude() const
@ SOUTHERN
virtual ~VcstMapDataSet()
const double SOUTH_UPPER_LEFT_LAT
@ LAMBERT_SECANT_NORTH
@ LAMBERT_TANGENT_NORTH
@ GRIDTYPE_NONE
const double SOUTH_LOWER_RIGHT_LON
double getBiggestLongitude() const
@ CYLINDRICAL_EQUIDISTANT
const double NORTH_UPPER_LEFT_LON
double smallestLongitude_[2]
GridType gridType_
#define PI
Definition: l3_get_org.c:6
VcstMapDataSet(Hemisphere theHemisphere)
void fillMds(mds_type *const anMds) const
double getSmallestLatitude() const
double upperLeftLongitude_
double getUpperLeftLongitude() const
int checkLat(double &rlat)
Hemisphere hemisphere_
double lowerRightLatitude_
@ POLAR_AZMUTHAL_NORTH
@ POLAR_STEREO_SOUTH
const double PI_EPSILON
Hemisphere
Hemisphere getHemisphere() const
const double NORTH_LOWER_RIGHT_LON
@ POLAR_STEREO_NORTH
@ EQUATOR
@ MERCATOR_COAX
double getBiggestLatitude() const
double biggestLongitude_[2]
virtual int latLonToGrid(double rlat, double rlon, double *row, double *column)=0
int checkLon(double &rlon)
const double NORTH_UPPER_LEFT_LAT
double lowerRightLongitude_
double biggestLatitude_
GridType
virtual int gridToLatLon(double row, double column, double *rlat, double *rlon)=0
@ LAMBERT_TANGENT_SOUTH
#define DEG2RAD
Definition: GEO_geo.h:174
int getGridType() const
@ LAMBERT_SECANT_SOUTH
const double NORTH_LOWER_RIGHT_LAT
l2prod max
double getLowerRightLatitude() const