OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
VcstViirsBandDnb.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * NAME: ViirsBandDnb.h
4  *
5  * DESCRIPTION: Subclass of ViirsBand object class to provide data structures and
6  * processes specific to day-night band (DNB) calibration.
7  *
8  * Created on: Aug 25, 2014
9  * Author: Sam Anderson, VCST
10  *
11  *******************************************************************************/
12 
13 #ifndef VIIRSBANDDNB_H_
14 #define VIIRSBANDDNB_H_
15 
16 #include <VcstViirsBand.h>
17 
18 struct dnbLutPtrs {
19  // Pointers to LUT data structures
26 };
27 
28 class ViirsBandDnb : public ViirsBand {
29 public:
30 
36 
41  ~ViirsBandDnb();
42 
47  int initialize();
48 
53  int initialize_L1A_data();
54 
59  int initialize_LUT_data();
60 
65  int initialize_L1B_data();
66 
71  int write_data(const NcFile* nc_output);
72 
73  // Get L1b data to pass to l2gen
74 
75  int get_l1bdata(float *l1bdata) {
76  return 0;
77  }
78 
79 protected:
80 
81  // observation attributes:
82 
86 
87  // quality attributes:
88 
89  unsigned short pixel_quality_fill_value_;
90  vector<unsigned short> pixel_quality_flag_masks_;
91 
92  // scan quality flags
93 
94  static constexpr unsigned char L1B_SCAN_QUALITY_DNB_STRAY_LIGHT = 0x80; //x0000000
95 
96  // constants
97 
98  static constexpr int DETECTORS = 16;
99  static constexpr int CAL_SAMPLES = 64;
100  static constexpr int EV_PIXELS = 4064;
101  static constexpr int C_COEFFS = 3;
102  static constexpr int GAIN_STATES = 3;
103  static constexpr int GAIN_RATIOS = 2;
104  static constexpr int MIRROR = 2;
105  static constexpr int AGG_ZONES = 32;
106  static constexpr int SZA_BINS = 469;
107  static constexpr int HEMISPHERES = 2;
108 
109  static constexpr int DNB_HIGH = 1;
110  static constexpr int DNB_MED = 2;
111  static constexpr int DNB_LOW = 3;
112 
113  static constexpr float radOffset = -0.0000000015;
114  static constexpr float radRange = 0.04;
115 
116  static constexpr unsigned short SATURATED_DNB_DN = 8191;
117  static constexpr unsigned short out_of_range_dn = 7860;
118  // float max_rad_;
119 
120  // DPP Configuration Data
121 
125 
126  // calibration and earth view data
127 
130 
133 
135 
137 
138  // output arrays
139 
143  unsigned char badDetector_[DETECTORS];
144 
145  // Pointer to structure of LUT pointer defined above
146 
148 
149  //Map to store LUT input item objects.
150 
151  std::map<std::string, VcstLutInputItem*> dnbLutItems_;
152 
159  int compute_CRVS();
160 
167  int calibrate_scan(int scan);
168 
176  bool precheck_scan(int scan);
177 
184  virtual int check_pixel_quality(int scan, int detector, int frame);
185 
193  int check_limits(int row, int frame);
194 
195 };
196 
197 #endif /* VIIRSBANDIMG_H_ */
int initialize_LUT_data()
proSdrViirsCalDnbFrameToZoneLUT * ftz
vector< unsigned short > pixel_quality_flag_masks_
static constexpr int DNB_MED
static constexpr int HEMISPHERES
int compute_CRVS()
static constexpr int DNB_HIGH
static constexpr int CAL_SAMPLES
unsigned char dp_dnb_1a_1b_stage_[VIIRS_SCANS]
VIIRS_BAND_ENUM
int calibrate_scan(int scan)
int get_l1bdata(float *l1bdata)
static constexpr int C_COEFFS
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)
unsigned char rowQuality_[VIIRS_SCANS *DETECTORS]
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 constexpr int GAIN_STATES
int check_limits(int row, int frame)
unsigned short pixelQuality_[VIIRS_SCANS *DETECTORS][EV_PIXELS]
short DN_EV_[VIIRS_SCANS][DETECTORS][EV_PIXELS]
static constexpr unsigned short out_of_range_dn
static constexpr int DETECTORS
ViirsBandDnb(VcstObc *pObc, VIIRS_BAND_ENUM band)
float DN_BB_[VIIRS_SCANS][DETECTORS][CAL_SAMPLES]
static constexpr float radRange
static constexpr int SZA_BINS
unsigned char dp_dnb_dark_sub_eth_[VIIRS_SCANS]
float DN_SV_[VIIRS_SCANS][DETECTORS][CAL_SAMPLES]
proSdrViirsCaldnbRVSLUT * RVS_DNB
static constexpr int GAIN_RATIOS
virtual int check_pixel_quality(int scan, int detector, int frame)
bool precheck_scan(int scan)
unsigned char dp_dnb_tmg_mode_[VIIRS_SCANS]
proSdrViirsDnbDn0Type * dnbDn0
int initialize_L1A_data()
int initialize()
static constexpr int DNB_LOW
static constexpr int AGG_ZONES
int initialize_L1B_data()
proSdrViirsCalDnbStrayLightLUT * strayLight
unsigned short pixel_quality_fill_value_
static constexpr unsigned char L1B_SCAN_QUALITY_DNB_STRAY_LIGHT
ProSdrViirsCalDnbLgsGainsLUT * TableDnbLgsGains
const int VIIRS_SCANS
Definition: VcstCmnConsts.h:58
int write_data(const NcFile *nc_output)
dnbLutPtrs pLut_
bool strayLightRegion_[VIIRS_SCANS]
static constexpr int MIRROR
unsigned char badDetector_[DETECTORS]
float radiance_[VIIRS_SCANS *DETECTORS][EV_PIXELS]
static constexpr unsigned short SATURATED_DNB_DN
std::map< std::string, VcstLutInputItem * > dnbLutItems_
ProSdrViirsCalDnbGainRatiosLUT * TableDnbGainRatios
double CRVS_[DETECTORS][EV_PIXELS][GAIN_STATES][MIRROR][C_COEFFS]
unsigned char EV_GAIN_[VIIRS_SCANS][DETECTORS][EV_PIXELS]
static constexpr int EV_PIXELS
static constexpr float radOffset