OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
VcstViirsBandModDG.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * NAME: ViirsBandModDG.h
4  *
5  * DESCRIPTION: Subclass of ViirsBandMod object class that provides data structures
6  * and processes common to all dual-gain moderate resolution bands required to
7  * support calibration processing. It is the base class for the the
8  * ViirsBandModDGRsb and ViirsBandModDGTeb object classes.
9  *
10  * Created on: Aug 25, 2014
11  * Author: Sam Anderson, VCST
12  *
13  *******************************************************************************/
14 
15 #ifndef VIIRSBANDMODDG_H_
16 #define VIIRSBANDMODDG_H_
17 
18 #include <VcstViirsBandMod.h>
19 
20 class ViirsBandModDG : public ViirsBandMod {
21 protected:
22 
23  static const int EV_SAMPLES = 6304;
24 
25  // Aggregation zones for moderate resolution dual-gain bands
26 
27  static const int FIRST_AG_START = 0; // FIRST AGG ZONE USE 1 Pixel
28  static const int FIRST_AG_END = 639; // END OF FIRST ZONE
29  static const int SECOND_AG_START = 640; // START OF SECOND AGG ZONE 2 Pixels Avg
30  static const int SECOND_AG_END = 1375; // END OF SECOND AGG ZONE
31  static const int FOURTH_AG_START = 4928; // START OF FOURTH AGG ZONE 2 PIXELS Avg
32  static const int FOURTH_AG_END = 5663; // END OF FOURTH AGG ZONE
33  static const int FIFTH_AG_START = 5664; // START OF LAST AGG ZONE
34  static const int FIFTH_AG_END = 6303; // END OF LAST AGG ZONE
35 
36  static const int HIGH_GAIN = 0;
37  static const int LOW_GAIN = 1;
38 
39  // Trim Table for unaggregated moderate resolution dual gain bands
40 
41  static const int TrimTable_DG_[DETECTORS][2];
42 
43  typedef short dn_ev_array[DETECTORS][EV_SAMPLES];
44  typedef unsigned char ev_gain_array[DETECTORS][EV_SAMPLES];
45  typedef float ev_rad_array[EV_SAMPLES];
46  typedef unsigned short ev_flag_array[EV_SAMPLES];
47 
52 
53  bool bCdg_;
54 
55 public:
56 
62 
68 
73  int initialize_L1A_data();
74 
75 
76 protected:
77 
84  int calibrate_scan(int scan);
85 
92  virtual int calibrate_sample(int row, int scan, int det, int& frm, short MS,
93  short DN_EV, float& rad, unsigned short& qual, short& gain);
94 
101  virtual int check_pixel_quality(int band, int scan, int det,
102  short& DN_EV, unsigned short& qual, short gain);
103 
111  virtual int calibrate_pixel(int row, int scan, int det, int& frm, short MS,
112  short* DN_EV, float& rad, float& refl,
113  unsigned int& shrt, unsigned short& qual);
114 
119  int write_cdg( const NcFile* nc_output );
120 
127  int getSVFromEV();
128 };
129 
130 
132 public:
133 
138  ViirsBandModDGRsb(VcstObc* pObc, VIIRS_BAND_ENUM band, bool bCdg);
139 
145 
146 protected:
147 
154  int calibrate_sample(int row, int scan, int det, int& frm, short MS,
155  short DN_EV, float& rad, unsigned short& qual, short& gain);
156 
157 };
158 
159 
161 public:
162 
167  ViirsBandModDGTeb(VcstObc* pObc, VIIRS_BAND_ENUM band, bool bCdg);
168 
174 
175  protected:
176 
183  int calibrate_sample(int row, int scan, int det, int& frm,
184  short MS, short DN_EV, float& rad, unsigned short& qual, short& gain);
185 
186 };
187 
188 #endif /* VIIRSBANDMODDG_H_ */
ev_gain_array * EV_GAIN_
unsigned short ev_flag_array[EV_SAMPLES]
static const int EV_SAMPLES
int16 * gain
Definition: l1_czcs_hdf.c:33
ViirsBandModDG(VcstObc *pObc, VIIRS_BAND_ENUM band, bool bCdg)
VIIRS_BAND_ENUM
int16_t * qual
Definition: l2bin.cpp:86
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
virtual int check_pixel_quality(int band, int scan, int det, short &DN_EV, unsigned short &qual)
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second band
static const int FIFTH_AG_START
ev_rad_array * EV_RAD_
static const int FOURTH_AG_END
static const int SECOND_AG_START
dn_ev_array * DN_EV_
virtual int calibrate_sample(int row, int scan, int det, int &frm, short MS, short DN_EV, float &rad, unsigned short &qual, short &gain)
static const int HIGH_GAIN
static const int FIRST_AG_START
int calibrate_scan(int scan)
short dn_ev_array[DETECTORS][EV_SAMPLES]
int write_cdg(const NcFile *nc_output)
static const int FIFTH_AG_END
static const int TrimTable_DG_[DETECTORS][2]
virtual int calibrate_pixel(int row, int scan, int det, int &frm, short MS, short *DN_EV, float &rad, float &refl, unsigned int &shrt, unsigned short &qual)
unsigned char ev_gain_array[DETECTORS][EV_SAMPLES]
static const int DETECTORS
virtual int calibrate_pixel(int row, int scan, int det, int &frm, short MS, short DN_EV, float &rad, float &refl_bt, unsigned int &shrt, unsigned short &qual)
int calibrate_sample(int row, int scan, int det, int &frm, short MS, short DN_EV, float &rad, unsigned short &qual, short &gain)
static const int FIRST_AG_END
ev_flag_array * EV_FLAG_
int calibrate_sample(int row, int scan, int det, int &frm, short MS, short DN_EV, float &rad, unsigned short &qual, short &gain)
static const int FOURTH_AG_START
static const int LOW_GAIN
virtual int check_pixel_quality(int band, int scan, int det, short &DN_EV, unsigned short &qual, short gain)
ViirsBandModDGTeb(VcstObc *pObc, VIIRS_BAND_ENUM band, bool bCdg)
float ev_rad_array[EV_SAMPLES]
int MS[]
Definition: Usds.c:106
static const int SECOND_AG_END
ViirsBandModDGRsb(VcstObc *pObc, VIIRS_BAND_ENUM band, bool bCdg)
int initialize_L1A_data()