OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
VcstViirsGeo.h
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * NAME: VcstViirsGeo.h
4  *
5  * DESCRIPTION: VcstViirsGeo encapsulates the geolocation algorithm. It
6  * contains function declarations for functions used in the geolocation
7  * routines.
8  *
9  *
10  **************************************************************************/
11 
12 #ifndef VcstViirsGeo_h
13 #define VcstViirsGeo_h
14 
15 #include <string>
16 #include <VcstGeoDataStructs.h>
17 #include <VcstGeoParameters.h>
18 #include <VcstCmnGeo.h>
19 #include <VcstParamsReader.h>
20 
21 #include <VcstGeoRctnglStruct.h>
22 
23 const unsigned char GEO_SCAN_QUALITY_HAMIMP_GOODDATA = 0x00; //00000000
24 const unsigned char GEO_SCAN_QUALITY_HAMIMP_BADDATA = 0x04; //00000x00
25 const unsigned char GEO_SCAN_QUALITY_HAMIMP_DEGRADDATA = 0x08; //0000x000
26 const unsigned char GEO_SCAN_QUALITY_HAMIMP_MISSINGDATA = 0x0c; //0000xx00
27 const unsigned char GEO_SCAN_QUALITY_NOT_ABOVE_SAA = 0x00; //00000000
28 const unsigned char GEO_SCAN_QUALITY_ABOVE_SAA = 0x10; //000x0000
29 const unsigned char GEO_SCAN_QUALITY_NO_SOLAR_ECLIPSE = 0x00; //00000000
30 const unsigned char GEO_SCAN_QUALITY_SOLAR_ECLIPSE = 0x20; //00x00000
31 //for DNB only
32 const unsigned char GEO_SCAN_QUALITY_NO_LUNAR_ECLIPSE = 0x00; //00000000
33 const unsigned char GEO_SCAN_QUALITY_LUNAR_ECLIPSE = 0x40; //0x000000
34 const unsigned char GEO_SCAN_QUALITY_HA_MIRROR_SIDE_SHIFT = 7; //x0000000
35 const unsigned char GEO_SCAN_QUALITY_HA_MIRROR_SIDE_MASK = 0x80; //x0000000
36 
37 //DR4767, DR4759 new flags for SCE side, non nominal ham start
38 const unsigned char GEO_SCAN_QUALITY_SCESIDE_A_ON = 0x00; //0000000x
39 const unsigned char GEO_SCAN_QUALITY_SCESIDE_B_ON = 0x01; //000000x0
40 const unsigned char GEO_SCAN_QUALITY_SCESIDE_INVALID = 0x02; //000000xx
41 const unsigned char GEO_SCAN_QUALITY_HAM_START_IS_NOMINAL = 0x00; //00000000
42 const unsigned char GEO_SCAN_QUALITY_HAM_START_NOT_NOMINAL = 0x04; //00000x00
43 
44 const unsigned char GEO_PIXEL_QUALITY_INPUT_VALID = 0x00; //00000000
45 const unsigned char GEO_PIXEL_QUALITY_INPUT_INVALID = 0x01; //0000000x
46 const unsigned char GEO_PIXEL_QUALITY_POINTING_GOOD = 0x00; //00000000
47 const unsigned char GEO_PIXEL_QUALITY_POINTING_BAD = 0x02; //000000x0
48 const unsigned char GEO_PIXEL_QUALITY_TERRAIN_GOOD = 0x00; //00000000
49 const unsigned char GEO_PIXEL_QUALITY_TERRAIN_BAD = 0x04; //00000x00
50 const unsigned char GEO_PIXEL_QUALITY_SOLARANGLE_VALID = 0x00; //00000000
51 const unsigned char GEO_PIXEL_QUALITY_SOLARANGLE_INVALID = 0x08; //0000x000
52 
53 typedef enum {
55 } switch_t;
56 
57 // macros needed to pass heap arrays to functions requiring double pointers
58 // TBD: combine into one overloaded function
59 #define ptrCastFloat(array,ny,ptrarr) { \
60  ptrarr = new float *[ny]; \
61  for (size_t y = 0; y < ny; y++) \
62  ptrarr[y] = array[y]; \
63  }
64 #define ptrCastUchar(array,ny,ptrarr) { \
65  ptrarr = new unsigned char *[ny]; \
66  for (size_t y = 0; y < ny; y++) \
67  ptrarr[y] = array[y]; \
68  }
69 
70 /***************************************************************************
71 NOTE: geolocation data for every pixel.
72 
73 NOTE: Moon phase is in degrees and done according to standard Astronomy
74 usage. That is, Moon Phase ranges from 0 to +180. Phase=0.0 means that the
75 center of the Sun, the center of the Earth, and the center of the Moon
76 are all in a perfect straight line, with the Moon and the Sun on
77 opposite sides of the Earth (a lunar eclipse). A "Full Moon" is the
78 point in each Moon cycle where the phase reaches minimum. Phase=+180
79 would mean that the center of the Moon and the center of the Sun are in
80 the same apparent place as viewed from the center of the Earth (a Solar
81 eclipse on the Earth's Equator). A "New Moon" is the point in each
82 Moon cycle where the phase reaches a maximum. We also record the
83 fraction of the Moon illuminated (mifrac). mifrac=0.0 is a dark Moon.
84 mifrac=1.00 means that all of the visible Moon disk is illuminated.
85 Since phase and mifrac have very small variation during a granule, we
86 provide only one value of phase and mifrac for the granule.
87 
88 These structures are the baseline for input to EDRs and data delivery.
89 These will change as RDR to SDR algorithms are delivered from the
90 sensor vendors.
91  **********************/
92 
93 /* Quality Flags */
94 const unsigned char VIIRS_GEO_INVALID_SCAN_START_TIME = 0x01; /* 00000001 < lsb */
95 const unsigned char VIIRS_GEO_CMN_GEO_FAIL = 0x02; /* 00000010 < lsb */
96 const unsigned char VIIRS_GEO_INVALID_MIRROR_SIDE = 0x04; /* 00000100 < lsb */
97 const unsigned char VIIRS_GEO_TERRAIN_CORR_FAIL = 0x08; /* 00001000 < lsb */
98 const unsigned char VIIRS_GEO_INVALID_TEL_HAM_ENC_DATA = 0x10; /* 00010000 < lsb */
99 
100 typedef enum {
102 } GeoQual;
103 
104 #define WriteNavData -1
105 #define WriteGeoAttributes -2
106 
107 typedef enum {
119 } GeoOutputs;
120 
121 typedef struct {
122  float imgLat[4];
123  float imgLon[4];
124  float imgLonRanges[4]; // minNeg, maxNeg, minPos, maxPos
125  float imgNSEW[4];
126  float modLat[4];
127  float modLon[4];
128  float modLonRanges[4];
129  float modNSEW[4];
130  float dnbLat[4];
131  float dnbLon[4];
132  float dnbLonRanges[4];
133  float dnbNSEW[4];
134 } gRingArrays;
135 
136 // Structure of pointers used by geolocation
137 
138 typedef struct {
139  // Pointer to VCST Navigation data
141 
142  // moonArray is generated for the calibration routine, and is local
143  // to SDR processing
145 
147 
148  // global data used in processing of geolocation
150 
152  // ViirsGeoOutputType* sdrDGeo; // Radian form products pointer(s).
153 
154  //Array will keep track of the quality metadata values needed for
155  //Geolocation products
156  int geoMetadataInfo[MAX_NUM_GEO_OUTPUTS][MAX_NUM_GEO_QUAL];
157 
158  int autoQual;
159 
160  // QA LUT contains the SAA threshold
162 
163  // Servo Control Checks
164  set<string> geoChecks;
165 
167 
168 
169 class VcstCmnGeo;
170 
172 public:
173  // Granule data
174  string platform_;
182  string versionid_;
183  string history_;
192 
193  // scan line attributes:
197 
198  static string DISABLE_SERVO_CONTROL;
199 
200 public:
204  VcstViirsGeo();
205 
209  virtual ~VcstViirsGeo();
210 
214  void cleanupDataItems();
215 
220  int initialize();
221 
222 
226  // void setHistory(int argc, char* argv[]);
227 
232  int geolocate();
233 
237  int findNSEW(float** lat, float** lon,
238  size_t ny, size_t x0, size_t nx, float NSEW[4], float lonRanges[4]);
239 
243  int findGring(float** lat, float** lon,
244  size_t ny, size_t x0, size_t nx,
245  float gringLat[4], float gringLon[4]);
246 
250  int updateBbox(GeoOutputs geotype, size_t x0, size_t nx);
251 
256  int write_img(int iscan, viirsSdrGeoPtrs* geoPtrs_);
257 
262  int write_mod(int iscan, viirsSdrGeoPtrs* geoPtrs_, bool modFromImg);
263 
268  int write_dnb(int iscan, viirsSdrGeoPtrs* geoPtrs_);
269 
270  void setHistory(string history) {
271  history_ = history;
272  }
273 
274  string getHistory() {
275  return history_;
276  }
277 
278  void setSource(string source) {
279  source_files_ = source;
280  }
281 
282  string getSource() {
283  return source_files_;
284  }
285 
286 protected:
287 
292  int doProcessing();
293 
294 
299  int initialize_L1A_data();
300 
301 
306  int initialize_L1B_data();
307 
312  int getLandWaterMask(GeoOutputs geotype, size_t x0, size_t nx);
313 
318  int write_global_attributes(NcFile* nc_output, string type);
319 
320 
325  int write_scan_data(NcFile* nc_output);
326 
327 
332  int write_nav_data(NcFile* nc_output);
333 
334 
335 private:
336 
340  void cleanup();
341 
350  int geolocateGranule(int iscan,
351  viirsSdrGeoPtrs* ptrs,
352  VcstCmnGeo* geoPtr,
353  ViirsGeoRctnglType* geoInterpRctngl,
354  ViirsGeoDecimType* vInt,
355  bool modFromImg);
356 
360  int storeGranule(int scan,
361  const ViirsGeoFullType& inFull,
362  const ViirsGeoRctnglType& inRect,
363  viirsSdrGeoPtrs* ptrs);
364 
372  void calcModFromImg(int scan,
373  viirsSdrGeoPtrs* ptrs,
374  VcstCmnGeo *geoPtr,
375  int extractPixelLimits[2]);
376 
380  int convertToDegrees(int iscan, char type);
381 
385  viirsSdrGeoPtrs* geoPtrs_;
386 
387  gRingArrays* gring;
388 };
389 
390 
404  const int inScan,
405  const int inDet,
406  const int inCol,
407  VcstCmnGeo *geoPtr,
408  ViirsGeoPixelType& outPix);
409 
420  const int inRow,
421  const int inCol,
422  const unsigned char pixeQuality);
423 
432 
442 int storeGranule(const ViirsGeoFullType& inFull,
443  const ViirsGeoRctnglType& inRect,
444  viirsSdrGeoPtrs* ptrs);
445 
456 void geolocateAllRecPix(int scan,
457  viirsSdrGeoPtrs* ptrs,
458  ViirsGeoRctnglType* inRec,
459  VcstCmnGeo* geoPtr,
460  ViirsGeoFullType* ioFull,
461  int extractPixelLimits[2]);
462 
470 void correctFromPassThroughPI(float* ioValue);
471 
472 void correctFromPassThroughPI(double* ioValue);
473 
483 void adjustForPassThroughPI(float* io0,
484  float* io1,
485  float* io2);
486 
487 void adjustForPassThroughPI(double* io0,
488  double* io1,
489  double* io2);
490 
491 
502 int calculateNadirData(const int inScan,
503  viirsSdrGeoPtrs* ptrs,
504  VcstCmnGeo* geoPtr,
505  ViirsGeoFullType* outFull);
506 
507 
517 
526  ViirsGeoProcType* procStruct);
527 
528 
539 int GEO_absolute_limit_check(double data_samples[],
540  int const number_of_samples,
541  double data_limits[2],
542  int sample_flags[]);
543 
554 int GEO_relative_limit_check(double data_samples[],
555  int const number_of_samples,
556  double const delta_limit,
557  int sample_flags[]);
558 
568 int GEO_find_next_flag(int sample_flags[],
569  int const number_of_samples,
570  int const start_sample);
571 
580  const focal_plane_geometry_struct& geometry_params,
581  const int actScans,
582  const double t_sync[MAX_SCAN_NUMBER],
584 
596  const focal_plane_geometry_struct& geometry_params,
597  double sample_time[MAX_SCAN_SAMPLE]);
598 
599 /******************************************************************
600  * GEO_Upg_determine_sample_time_offsets
601  *
602  * @param *ptrs Structure of pointers to VIIRS SDR geolocation structs
603  *
604  * @return void
605  * *****************************************************************/
607  const focal_plane_geometry_struct& geometry_params,
608  const int actScans,
609  const double t_sync[MAX_SCAN_NUMBER],
611 
620 
621 
633 int GEO_determine_view_vectors(const int scan_number,
634  const int sample_number,
635  const int det,
636  viirsSdrGeoPtrs* ptrs,
637  unsigned char* flag,
638  double u_inst[VEC_SIZE]);
639 
650 int GEO_interpolate_telescope_encoder(int const scan_number,
651  int const sample_number,
652  double* const sample_enc,
653  viirsSdrGeoPtrs* ptrs);
654 
665 int GEO_interpolate_mirror_encoder(int const scan_number,
666  int const sample_number,
667  double* const sample_enc,
668  viirsSdrGeoPtrs* ptrs);
669 
680 int GEO_evaluate_polynomial(double coef[MAX_POLY_DEGREE + 1],
681  double const in_x,
682  int const degree,
683  double* const out_fit);
684 
685 
695 
696 
697 //-----------------------------------------------------------------------
698 
699 inline void correctFromPassThroughPI(float* ioValue) {
700  if (*ioValue > FLOAT32_FILL_TEST) {
701  if (*ioValue > TWOPI) {
702  *ioValue -= TWOPI;
703  }
704 
705  if (*ioValue > PI) {
706  *ioValue -= TWOPI;
707  } else if (*ioValue < -PI) {
708  *ioValue += TWOPI;
709  }
710  }
711 }
712 
713 inline void correctFromPassThroughPI(double* ioValue) {
714  if (*ioValue > FLOAT64_FILL_TEST) {
715  if (*ioValue > TWOPI) {
716  *ioValue -= TWOPI;
717  }
718 
719  if (*ioValue > PI) {
720  *ioValue -= TWOPI;
721  } else if (*ioValue < -PI) {
722  *ioValue += TWOPI;
723  }
724  }
725 }
726 
727 //-----------------------------------------------------------------------
728 
729 inline void adjustForPassThroughPI(float* io0,
730  float* io1,
731  float* io2) {
732  float diff;
733 
734  if ((*io0 > FLOAT32_FILL_TEST) && (*io1 > FLOAT32_FILL_TEST) &&
735  (*io2 > FLOAT32_FILL_TEST)) {
736  diff = fabs(*io2 - *io0);
737  if (diff > PI) {
738  if (*io0 < 0.0) {
739  *io0 += TWOPI;
740  }
741 
742  if (*io1 < 0.0) {
743  *io1 += TWOPI;
744  }
745 
746  if (*io2 < 0.0) {
747  *io2 += TWOPI;
748  }
749  }
750  }
751 }
752 
753 inline void adjustForPassThroughPI(double* io0,
754  double* io1,
755  double* io2) {
756  double diff;
757 
758  if ((*io0 > FLOAT64_FILL_TEST) && (*io1 > FLOAT64_FILL_TEST) &&
759  (*io2 > FLOAT64_FILL_TEST)) {
760  diff = fabs(*io2 - *io0);
761  if (diff > PI) {
762  if (*io0 < 0.0) {
763  *io0 += TWOPI;
764  }
765 
766  if (*io1 < 0.0) {
767  *io1 += TWOPI;
768  }
769 
770  if (*io2 < 0.0) {
771  *io2 += TWOPI;
772  }
773  }
774  }
775 }
776 
786  VcstCmnGeo *cmnGeoPtr);
787 
799 int getSaa(viirsSdrGeoPtrs* geoPtrs,
800  float dLat,
801  float dLon,
802  VcstCmnGeo *cmnGeoPtr,
803  unsigned char &inSAA);
804 
819 template <int T_NUM_ROWS, int T_NUM_COLS>
820 int getSolarEclipse(float lat[T_NUM_ROWS][T_NUM_COLS],
821  float lon[T_NUM_ROWS][T_NUM_COLS],
822  long long startTime,
823  long long endTime,
824  int startRow,
825  int endRow,
826  VcstCmnGeo *cmnGeoPtr,
827  unsigned char &solEclipse);
828 
829 
844  double startTime,
845  double endTime,
846  int endRow,
847  int startRow,
848  VcstCmnGeo *cmnGeoPtr,
849  unsigned char &lunEclipse);
850 
859 
860 
869 
878 
887 
888 
896 int appendQualityFlag2(viirsSdrGeoPtrs* ptrs, int scan, unsigned char flag);
897 
902 int VcstCreateInterpRectangles(const int bandType,
903  int numZones, //# of agg zones
904  int *numPixPerZone, //# of pixels in each agg zone
905  ViirsGeoRctnglType* outRec);
906 
907 
908 #endif
909 
string getHistory()
Definition: VcstViirsGeo.h:274
string platform_
Definition: VcstViirsGeo.h:174
int write_dnb(int iscan, viirsSdrGeoPtrs *geoPtrs_)
const unsigned char GEO_PIXEL_QUALITY_SOLARANGLE_VALID
Definition: VcstViirsGeo.h:50
int initialize_L1B_data()
void GEO_Upg_determine_sample_time_offsets(const focal_plane_geometry_struct &geometry_params, const int actScans, const double t_sync[MAX_SCAN_NUMBER], double sample_time[MAX_SCAN_NUMBER][MAX_SCAN_SAMPLE])
int Check_Scan_Sync_Failure(viirsSdrGeoPtrs *ptrs)
set< string > geoChecks
Definition: VcstViirsGeo.h:164
@ IMG_GEO_TC
Definition: VcstViirsGeo.h:116
@ MOD_GEO
Definition: VcstViirsGeo.h:114
const unsigned char GEO_PIXEL_QUALITY_INPUT_INVALID
Definition: VcstViirsGeo.h:45
int instrument_number_
Definition: VcstViirsGeo.h:188
int GEO_evaluate_polynomial(double coef[MAX_POLY_DEGREE+1], double const in_x, int const degree, double *const out_fit)
const unsigned char GEO_PIXEL_QUALITY_POINTING_GOOD
Definition: VcstViirsGeo.h:46
const unsigned char GEO_SCAN_QUALITY_HAMIMP_DEGRADDATA
Definition: VcstViirsGeo.h:25
void adjustForPassThroughPI(float *io0, float *io1, float *io2)
Definition: VcstViirsGeo.h:729
string time_coverage_start_
Definition: VcstViirsGeo.h:178
int geolocatePixel(viirsSdrGeoPtrs *ptrs, const int inScan, const int inDet, const int inCol, VcstCmnGeo *geoPtr, ViirsGeoPixelType &outPix)
@ OUTOFBND
Definition: VcstViirsGeo.h:101
int write_mod(int iscan, viirsSdrGeoPtrs *geoPtrs_, bool modFromImg)
int findNSEW(float **lat, float **lon, size_t ny, size_t x0, size_t nx, float NSEW[4], float lonRanges[4])
int getSolarEclipse(float lat[T_NUM_ROWS][T_NUM_COLS], float lon[T_NUM_ROWS][T_NUM_COLS], long long startTime, long long endTime, int startRow, int endRow, VcstCmnGeo *cmnGeoPtr, unsigned char &solEclipse)
MOD_PR01 Production producing one five minute granule of output data in each run It can be configured to produce as many as three five minute granules per run Each execution with one construction record and one date file for each dataset In normal these are created by which splits them out of the hour datasets For LANCE they are created by which merges all session MODIS L0 datasets overlapping the requested time and extracts from the merged data those packets which fall within that time period Each scan of data is stored in the L1A granule that covers the start time of that scan
Definition: MOD_PR01_pr.txt:19
int findGring(float **lat, float **lon, size_t ny, size_t x0, size_t nx, float gringLat[4], float gringLon[4])
int write_global_attributes(NcFile *nc_output, string type)
const unsigned char VIIRS_GEO_INVALID_TEL_HAM_ENC_DATA
Definition: VcstViirsGeo.h:98
@ AUTO
Definition: VcstViirsGeo.h:101
@ MOD_RGEO
Definition: VcstViirsGeo.h:109
int initGeoDataStructs(int iscan, viirsSdrGeoPtrs *ptrs)
@ DNB_GEO
Definition: VcstViirsGeo.h:112
@ MOD_GEO_TC
Definition: VcstViirsGeo.h:117
const unsigned char GEO_PIXEL_QUALITY_POINTING_BAD
Definition: VcstViirsGeo.h:47
@ MOD_UNAGG_GEO
Definition: VcstViirsGeo.h:115
float * lat
GeoQual
Definition: VcstViirsGeo.h:100
const unsigned char GEO_PIXEL_QUALITY_TERRAIN_GOOD
Definition: VcstViirsGeo.h:48
const int MAX_SCAN_SAMPLE
const int MAX_POLY_DEGREE
double scan_time_fill_
Definition: VcstViirsGeo.h:194
int GEO_interp_mod_unagg(viirsSdrGeoPtrs *ptrs)
@ IMG_RGEO_TC
Definition: VcstViirsGeo.h:110
const double TWOPI
Definition: AfrtConstants.h:85
int GEO_determine_thermal_corrections(viirsSdrGeoPtrs *ptrs)
const unsigned char GEO_PIXEL_QUALITY_INPUT_VALID
Definition: VcstViirsGeo.h:44
string startDirection_
Definition: VcstViirsGeo.h:175
void correctFromPassThroughPI(float *ioValue)
Definition: VcstViirsGeo.h:699
int eclipseAndSaaFlags(viirsSdrGeoPtrs *geoPtrs, VcstCmnGeo *cmnGeoPtr)
int extract_pixel_start_
Definition: VcstViirsGeo.h:189
const unsigned char VIIRS_GEO_INVALID_MIRROR_SIDE
Definition: VcstViirsGeo.h:96
const unsigned char VIIRS_GEO_INVALID_SCAN_START_TIME
Definition: VcstViirsGeo.h:94
string getSource()
Definition: VcstViirsGeo.h:282
const float FLOAT32_FILL_TEST
string pge_start_time_
Definition: VcstViirsGeo.h:180
int GEO_interpolate_mirror_encoder(int const scan_number, int const sample_number, double *const sample_enc, viirsSdrGeoPtrs *ptrs)
switch_t
Definition: VcstViirsGeo.h:53
#define PI
Definition: l3_get_org.c:6
string pge_end_time_
Definition: VcstViirsGeo.h:181
int GEO_relative_limit_check(double data_samples[], int const number_of_samples, double const delta_limit, int sample_flags[])
const double FLOAT64_FILL_TEST
Definition: VcstCmnConsts.h:99
int initialize_L1A_data()
const unsigned char GEO_SCAN_QUALITY_NOT_ABOVE_SAA
Definition: VcstViirsGeo.h:27
int GEO_validate_scan_encoder_data(viirsSdrGeoPtrs *ptrs)
int Check_Ham_Start_Not_Nominal(viirsSdrGeoPtrs *ptrs)
string time_coverage_end_
Definition: VcstViirsGeo.h:179
@ MAX_NUM_GEO_OUTPUTS
Definition: VcstViirsGeo.h:118
int write_nav_data(NcFile *nc_output)
double scan_time_valid_max_
Definition: VcstViirsGeo.h:196
void GEO_determine_DNB_sample_time_offsets(const focal_plane_geometry_struct &geometry_params, const int actScans, const double t_sync[MAX_SCAN_NUMBER], double sample_time[MAX_SCAN_NUMBER][MAX_SCAN_SAMPLE])
void GEO_determine_sample_time_offsets(const focal_plane_geometry_struct &geometry_params, double sample_time[MAX_SCAN_SAMPLE])
int getSaa(viirsSdrGeoPtrs *geoPtrs, float dLat, float dLon, VcstCmnGeo *cmnGeoPtr, unsigned char &inSAA)
@ ON
Definition: VcstViirsGeo.h:54
const unsigned char GEO_SCAN_QUALITY_SOLAR_ECLIPSE
Definition: VcstViirsGeo.h:30
const unsigned char GEO_SCAN_QUALITY_SCESIDE_INVALID
Definition: VcstViirsGeo.h:40
const unsigned char GEO_SCAN_QUALITY_HA_MIRROR_SIDE_MASK
Definition: VcstViirsGeo.h:35
const unsigned char GEO_SCAN_QUALITY_LUNAR_ECLIPSE
Definition: VcstViirsGeo.h:33
GEO_param_struct * geoParams
Definition: VcstViirsGeo.h:146
const unsigned char GEO_SCAN_QUALITY_SCESIDE_B_ON
Definition: VcstViirsGeo.h:39
const unsigned char GEO_SCAN_QUALITY_NO_SOLAR_ECLIPSE
Definition: VcstViirsGeo.h:29
void setGeoPixelQuality(viirsSdrGeoPtrs *ptrs, const int inRow, const int inCol, const unsigned char pixeQuality)
int calculateNadirData(const int inScan, viirsSdrGeoPtrs *ptrs, VcstCmnGeo *geoPtr, ViirsGeoFullType *outFull)
const int VEC_SIZE
void setSource(string source)
Definition: VcstViirsGeo.h:278
const unsigned char GEO_SCAN_QUALITY_NO_LUNAR_ECLIPSE
Definition: VcstViirsGeo.h:32
@ OFF
Definition: VcstViirsGeo.h:54
int extract_pixel_stop_
Definition: VcstViirsGeo.h:190
double * sample_time
int Check_Tel_Start_Not_Nominal(viirsSdrGeoPtrs *ptrs)
int getDnbLunarEclipse(viirsSdrGeoPtrs *geoPtrs, double startTime, double endTime, int endRow, int startRow, VcstCmnGeo *cmnGeoPtr, unsigned char &lunEclipse)
const unsigned char GEO_PIXEL_QUALITY_TERRAIN_BAD
Definition: VcstViirsGeo.h:49
subroutine diff(x, conec, n, dconecno, dn, dconecmk, units, u, inno, i, outno, o, input, deriv)
Definition: ffnet.f:205
int write_scan_data(NcFile *nc_output)
string day_night_flag_
Definition: VcstViirsGeo.h:177
const unsigned char GEO_SCAN_QUALITY_HAMIMP_MISSINGDATA
Definition: VcstViirsGeo.h:26
static string DISABLE_SERVO_CONTROL
Definition: VcstViirsGeo.h:198
int GEO_interpolate_telescope_encoder(int const scan_number, int const sample_number, double *const sample_enc, viirsSdrGeoPtrs *ptrs)
@ MISS
Definition: VcstViirsGeo.h:101
ViirsGeoOutputType * sdrGeo
Definition: VcstViirsGeo.h:151
int GEO_absolute_limit_check(double data_samples[], int const number_of_samples, double data_limits[2], int sample_flags[])
string history
Definition: ncattredit.py:30
string source_files_
Definition: VcstViirsGeo.h:184
ViirsMoonArrays moonArray
Definition: VcstViirsGeo.h:144
int doProcessing()
const unsigned char GEO_SCAN_QUALITY_HAM_START_IS_NOMINAL
Definition: VcstViirsGeo.h:41
proSdrViirsCalQALUT * QALUT
Definition: VcstViirsGeo.h:161
void setHistory(string history)
Definition: VcstViirsGeo.h:270
string versionid_
Definition: VcstViirsGeo.h:182
int calculateSCESide(viirsSdrGeoPtrs *ptrs)
const unsigned char GEO_PIXEL_QUALITY_SOLARANGLE_INVALID
Definition: VcstViirsGeo.h:51
int write_img(int iscan, viirsSdrGeoPtrs *geoPtrs_)
const int MAX_SCAN_NUMBER
const unsigned char GEO_SCAN_QUALITY_HAMIMP_GOODDATA
Definition: VcstViirsGeo.h:23
int updateBbox(GeoOutputs geotype, size_t x0, size_t nx)
#define fabs(a)
Definition: misc.h:93
int32_t iscan
const unsigned char GEO_SCAN_QUALITY_HAM_START_NOT_NOMINAL
Definition: VcstViirsGeo.h:42
int storeGranule(const ViirsGeoFullType &inFull, const ViirsGeoRctnglType &inRect, viirsSdrGeoPtrs *ptrs)
const unsigned char GEO_SCAN_QUALITY_ABOVE_SAA
Definition: VcstViirsGeo.h:28
const unsigned char GEO_SCAN_QUALITY_HAMIMP_BADDATA
Definition: VcstViirsGeo.h:24
void geolocateAllRecPix(int scan, viirsSdrGeoPtrs *ptrs, ViirsGeoRctnglType *inRec, VcstCmnGeo *geoPtr, ViirsGeoFullType *ioFull, int extractPixelLimits[2])
float * lon
const unsigned char VIIRS_GEO_CMN_GEO_FAIL
Definition: VcstViirsGeo.h:95
virtual ~VcstViirsGeo()
const unsigned char GEO_SCAN_QUALITY_HA_MIRROR_SIDE_SHIFT
Definition: VcstViirsGeo.h:34
int getLandWaterMask(GeoOutputs geotype, size_t x0, size_t nx)
string endDirection_
Definition: VcstViirsGeo.h:176
int initialize()
int appendQualityFlag2(viirsSdrGeoPtrs *ptrs, int scan, unsigned char flag)
@ MAX_NUM_GEO_QUAL
Definition: VcstViirsGeo.h:101
string history_
Definition: VcstViirsGeo.h:183
const unsigned char GEO_SCAN_QUALITY_SCESIDE_A_ON
Definition: VcstViirsGeo.h:38
GeoOutputs
Definition: VcstViirsGeo.h:107
int GEO_process_parameters(GEO_param_struct *geoParams, ViirsGeoProcType *procStruct)
@ MOD_RGEO_TC
Definition: VcstViirsGeo.h:111
ViirsGeoProcType * procStruct
Definition: VcstViirsGeo.h:149
VcstCmnGeo * pCmnGeo
Definition: VcstViirsGeo.h:140
double scan_time_valid_min_
Definition: VcstViirsGeo.h:195
@ IMG_RGEO
Definition: VcstViirsGeo.h:108
int GEO_find_next_flag(int sample_flags[], int const number_of_samples, int const start_sample)
const unsigned char VIIRS_GEO_TERRAIN_CORR_FAIL
Definition: VcstViirsGeo.h:97
int VcstCreateInterpRectangles(const int bandType, int numZones, int *numPixPerZone, ViirsGeoRctnglType *outRec)
void cleanupDataItems()
@ IMG_GEO
Definition: VcstViirsGeo.h:113
int GEO_determine_view_vectors(const int scan_number, const int sample_number, const int det, viirsSdrGeoPtrs *ptrs, unsigned char *flag, double u_inst[VEC_SIZE])