OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022

#include <VcstViirsBandModDG.h>

Inheritance diagram for ViirsBandModDG:
[legend]
Collaboration diagram for ViirsBandModDG:
[legend]

Public Member Functions

 ViirsBandModDG (VcstObc *pObc, VIIRS_BAND_ENUM band, bool bCdg)
 
 ~ViirsBandModDG ()
 
int initialize_L1A_data ()
 
- Public Member Functions inherited from ViirsBandMod
 ViirsBandMod (VcstObc *pObc, VIIRS_BAND_ENUM band)
 
 ~ViirsBandMod ()
 
virtual int initialize ()
 
int get_l1bdata (float *l1bdata)
 
- Public Member Functions inherited from ViirsBand
 ViirsBand (VcstObc *pObc, VIIRS_BAND_ENUM band)
 
virtual ~ViirsBand ()
 
int calibrate ()
 
virtual int write_data (const NcFile *nc_output)
 
virtual int write_rsb (const NcFile *nc_output, float *obs_val, unsigned short *short_val, unsigned short *pixelQuality, int8_t *unc_idx, bool bRad)
 
virtual int write_teb (const NcFile *nc_output, float *obs_val, unsigned short *short_val, unsigned int *long_val, unsigned short *pixelQuality, int8_t *unc_idx, bool bRad)
 

Protected Types

typedef short dn_ev_array[DETECTORS][EV_SAMPLES]
 
typedef unsigned char ev_gain_array[DETECTORS][EV_SAMPLES]
 
typedef float ev_rad_array[EV_SAMPLES]
 
typedef unsigned short ev_flag_array[EV_SAMPLES]
 

Protected Member Functions

int calibrate_scan (int scan)
 
virtual int calibrate_sample (int row, int scan, int det, int &frm, short MS, short DN_EV, float &rad, unsigned short &qual, short &gain)
 
virtual int check_pixel_quality (int band, int scan, int det, short &DN_EV, unsigned short &qual, short gain)
 
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)
 
int write_cdg (const NcFile *nc_output)
 
int getSVFromEV ()
 
virtual int check_pixel_quality (int band, int scan, int det, short &DN_EV, unsigned short &qual)
 
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)
 
- Protected Member Functions inherited from ViirsBandMod
virtual int initialize_L1B_data ()
 
bool precheck_scan (int scan)
 
virtual int check_pixel_quality (int band, int scan, int det, short &DN_EV, unsigned short &qual)
 
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)
 

Protected Attributes

dn_ev_arrayDN_EV_
 
ev_gain_arrayEV_GAIN_
 
ev_rad_arrayEV_RAD_
 
ev_flag_arrayEV_FLAG_
 
bool bCdg_
 
- Protected Attributes inherited from ViirsBand
bool bLWIR_
 
VcstObcpObc_
 
VIIRS_BAND_ENUM band_
 
VIIRS_TEB_BAND_ENUM teb_band_
 
VIIRS_RSB_BAND_ENUM rsb_band_
 
short det_432_
 

Static Protected Attributes

static const int EV_SAMPLES = 6304
 
static const int FIRST_AG_START = 0
 
static const int FIRST_AG_END = 639
 
static const int SECOND_AG_START = 640
 
static const int SECOND_AG_END = 1375
 
static const int FOURTH_AG_START = 4928
 
static const int FOURTH_AG_END = 5663
 
static const int FIFTH_AG_START = 5664
 
static const int FIFTH_AG_END = 6303
 
static const int HIGH_GAIN = 0
 
static const int LOW_GAIN = 1
 
static const int TrimTable_DG_ [DETECTORS][2]
 

Additional Inherited Members

- Public Types inherited from ViirsBandMod
typedef short dn_ev_array[DETECTORS][EV_PIXELS]
 
typedef float flt_pix_array[EV_PIXELS]
 
typedef unsigned short shrt_pix_array[EV_PIXELS]
 
typedef unsigned int int_pix_array[EV_PIXELS]
 
typedef int8_t byte_pix_array[EV_PIXELS]
 
- Public Attributes inherited from ViirsBandMod
vector< unsigned short > sample_quality_flag_masks_
 
VIIRS_M_BAND_ENUM mod_band_
 
VIIRS_MOD_SG_BAND_ENUM sg_band_
 
VIIRS_MOD_DG_BAND_ENUM dg_band_
 
VIIRS_MOD_RSB_BAND_ENUM mrsb_band_
 
VIIRS_MOD_TEB_BAND_ENUM mteb_band_
 
dn_ev_arrayDN_EV_
 
flt_pix_arrayradiance_
 
shrt_pix_arrayshort_val_
 
int_pix_arraylong_val_
 
shrt_pix_arraypixelQuality_
 
byte_pix_arrayunc_idx_
 
unsigned char badDetector_ [DETECTORS]
 
- Public Attributes inherited from ViirsBand
string band_str_
 
string ev_var_str_
 
float obs_fill_value_
 
float obs_valid_min_
 
float obs_valid_max_
 
float flt_valid_min_
 
float flt_valid_max_
 
float flt_scale_factor_
 
float flt_add_offset_
 
float shrt_rad_scale_factor_
 
float shrt_rad_add_offset_
 
unsigned short shrt_fill_value_
 
unsigned short shrt_valid_min_
 
unsigned short shrt_valid_max_
 
unsigned int M13_fill_value_
 
unsigned int M13_valid_min_
 
unsigned int M13_valid_max_
 
float shrt_scale_factor_
 
float shrt_add_offset_
 
float bt_fill_value_
 
float bt_valid_min_
 
float bt_valid_max_
 
unsigned short pixel_quality_fill_value_
 
vector< unsigned short > pixel_quality_flag_masks_
 
vector< unsigned char > detector_quality_flag_
 
unsigned char detector_quality_flag_masks_ [8]
 
float uncidx_scale_factor_
 
unsigned short uncidx_fill_value_
 
unsigned short uncidx_valid_min_
 
unsigned short uncidx_valid_max_
 
vector< unsigned int > uncertainty_index_flag_values_
 
vector< unsigned int > m13_uncertainty_index_flag_values_
 
unsigned short * shrtPtr_
 
unsigned int * longPtr_
 
unsigned short * qualPtr_
 
int8_t * uncPtr_
 
float * radPtr_
 
float * cdgPtr_
 
- Static Public Attributes inherited from ViirsBandMod
static const int M_BANDS = 16
 
static const int EV_PIXELS = 3200
 
static const int DETECTORS = 16
 
static const int CAL_SAMPLES = 48
 
static const int MIRROR = 2
 
static const int GAIN_STATE = 2
 
static const int C_COEFFS = 4
 
- Static Public Attributes inherited from ViirsBand
static const int processAtNight [Viirs_Bands]
 
static constexpr int NUM_TAPS = 201
 
static constexpr int RSB_BANDS = 14
 
static constexpr int TEB_BANDS = 7
 
static constexpr int MIRROR_SIDE = 2
 
static constexpr int SATURATED_DN = 4095
 
static constexpr int MAX_NUM_HISTORY_ORBITS = 480
 
static constexpr double DEGtoRAD = 0.017453292519943296e0
 
static constexpr double RADtoDEG = 57.295779513082321e0
 
static constexpr int C_COEFFS = 4
 
static constexpr int A_COEFFS = 3
 
static constexpr int T_FP_LEVELS = 5
 
static constexpr int T_ELEC_LEVELS = 5
 
static constexpr unsigned char NIGHT_GRAN = 0
 
static constexpr unsigned char DAY_GRAN = 1
 
static constexpr unsigned char MIXED_GRAN = 2
 
static constexpr short NUM_PIXEL_QUALITY_FLAGS = 4
 
static constexpr unsigned char L1B_PIXEL_QUALITY_GOOD = 0x00
 
static constexpr unsigned char L1B_PIXEL_QUALITY_SUBSTITUTE_CAL = 0x01
 
static constexpr unsigned char L1B_PIXEL_QUALITY_OUTOFRANGE_RAD = 0x02
 
static constexpr unsigned char L1B_PIXEL_QUALITY_OUTOFRANGE_RFLBT = 0x02
 
static constexpr unsigned char L1B_PIXEL_QUALITY_ALLSATURATION = 0x04
 
static constexpr unsigned char L1B_PIXEL_QUALITY_TEMP_NOT_NOMINAL = 0x08
 
static constexpr unsigned char L1B_PIXEL_QUALITY_LOWER_MASK = 0x0f
 
static constexpr unsigned char L1B_PIXEL_QUALITY_UPPER_MASK = 0xf0
 
static constexpr unsigned char L1B_PIXEL_QUALITY_NOT_ALLSATURATION = 0xfb
 
static constexpr unsigned char L1B_PIXEL_QUALITY_NOT_OUTOFRANGE = 0xfd
 
static constexpr short NUM_DG_PIXEL_QUALITY_FLAGS = 8
 
static constexpr short NUM_UADG_PIXEL_QUALITY_FLAGS = 6
 
static constexpr unsigned char L1B_PIXEL_QUALITY_LOW_GAIN_STATE = 0x10
 
static constexpr unsigned char L1B_PIXEL_QUALITY_MIXED_GAIN_STATE = 0x20
 
static constexpr unsigned char L1B_PIXEL_QUALITY_DG_ANOMALY = 0x40
 
static constexpr unsigned char L1B_PIXEL_QUALITY_SOMESATURATION = 0x80
 
static constexpr short NUM_DNB_PIXEL_QUALITY_FLAGS = 5
 
static constexpr unsigned char L1B_PIXEL_QUALITY_DNB_STRAY_LIGHT = 0x10
 
static constexpr short NUM_BAD_PIXEL_QUALITY_FLAGS = 5
 
static constexpr short BAD_PIXEL_QUAL_SHIFT = 8
 
static constexpr unsigned short L1B_PIXEL_QUALITY_BOWTIE = 0x0100
 
static constexpr unsigned short L1B_PIXEL_QUALITY_MISSING = 0x0200
 
static constexpr unsigned short L1B_PIXEL_QUALITY_NOCALIBRATE = 0x0400
 
static constexpr unsigned short L1B_PIXEL_QUALITY_DEAD_DETECTOR = 0x0800
 
static constexpr unsigned short L1B_PIXEL_QUALITY_NOISY_DETECTOR = 0x1000
 
static constexpr short TOTAL_SG_PIXEL_QUALITY_FLAGS = NUM_PIXEL_QUALITY_FLAGS + NUM_BAD_PIXEL_QUALITY_FLAGS
 
static constexpr short TOTAL_DG_PIXEL_QUALITY_FLAGS = NUM_DG_PIXEL_QUALITY_FLAGS + NUM_BAD_PIXEL_QUALITY_FLAGS
 
static constexpr short TOTAL_UADG_PIXEL_QUALITY_FLAGS = NUM_UADG_PIXEL_QUALITY_FLAGS + NUM_BAD_PIXEL_QUALITY_FLAGS
 
static constexpr short TOTAL_DNB_PIXEL_QUALITY_FLAGS = NUM_DNB_PIXEL_QUALITY_FLAGS + NUM_BAD_PIXEL_QUALITY_FLAGS
 
static constexpr unsigned char L1B_ROW_QUALITY_SUBSTITUTE_CAL = 0x01
 
static constexpr unsigned char L1B_ROW_QUALITY_NO_CALIBRATION = 0x02
 
static constexpr unsigned char L1B_ROW_QUALITY_MOON_IN_SPACE_VIEW = 0x04
 
static constexpr unsigned char L1B_ROW_QUALITY_DG_ANOMALY = 0x08
 
static constexpr unsigned char L1B_ROW_QUALITY_DEAD_DETECTOR = 0x10
 
static constexpr unsigned char L1B_ROW_QUALITY_BB_TEMP_NOT_NOMINAL = 0x20
 
static constexpr unsigned char L1B_ROW_QUALITY_LWIR_TEMP_NOT_NOMINAL = 0x40
 
static constexpr unsigned char L1B_ROW_QUALITY_DNB_STRAY_LIGHT = 0x80
 
static constexpr int MOON_IN_SV_SCANS_TO_SKIP_FORWARD = 6
 
static constexpr int MOON_IN_SV_SCANS_TO_SKIP_BACK = 4
 
static constexpr float L1B_FILL_FLOAT = -999.9f
 
static constexpr double L1B_FILL_DOUBLE = -999.9L
 
static constexpr short L1B_FILL_SHORT = -999
 
static constexpr unsigned short L1B_FILL_USHORT = 65535
 
static constexpr unsigned int L1B_FILL_UINT_M13 = 327680
 
static constexpr char L1B_FILL_BYTE = -1
 
static constexpr unsigned char L1B_FILL_UBYTE = 255
 
static constexpr float VDNE_FLOAT32_FILL = -999.9f
 
static constexpr float ELLIPSOID_FLOAT32_FILL = -999.9f
 
static constexpr float ERR_FLOAT32_FILL = -999.9f
 
static constexpr float ONBOARD_PT_FLOAT32_FILL = -999.9f
 
static constexpr float MISS_FLOAT32_FILL = -999.9f
 
static constexpr float NA_FLOAT32_FILL = -999.9f
 
static constexpr float FLOAT_FILL_TEST = -999.0f
 
static constexpr short SHORT_FILL_TEST = -990
 
static constexpr char BYTE_FILL_TEST = 0
 
static constexpr unsigned char UBYTE_FILL_TEST = 247
 

Detailed Description

Definition at line 20 of file VcstViirsBandModDG.h.

Member Typedef Documentation

◆ dn_ev_array

typedef short dn_ev_array[DETECTORS][EV_SAMPLES]
protected

Definition at line 55 of file VcstViirsBandModDG.h.

◆ ev_flag_array

typedef unsigned short ev_flag_array[EV_SAMPLES]
protected

Definition at line 58 of file VcstViirsBandModDG.h.

◆ ev_gain_array

typedef unsigned char ev_gain_array[DETECTORS][EV_SAMPLES]
protected

Definition at line 56 of file VcstViirsBandModDG.h.

◆ ev_rad_array

typedef float ev_rad_array[EV_SAMPLES]
protected

Definition at line 57 of file VcstViirsBandModDG.h.

Constructor & Destructor Documentation

◆ ViirsBandModDG()

ViirsBandModDG ( VcstObc pObc,
VIIRS_BAND_ENUM  band,
bool  bCdg 
)

Class constructor

◆ ~ViirsBandModDG()

Class destructor

Member Function Documentation

◆ calibrate_pixel() [1/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 
)
protectedvirtual

◆ calibrate_pixel() [2/2]

virtual int calibrate_pixel
protected

NAME: calibrate_pixel()

DESCRIPTION: Calibrate single aggregated DG pixel and set quality flags as indicated.

◆ calibrate_sample()

virtual int calibrate_sample ( int  row,
int  scan,
int  det,
int &  frm,
short  MS,
short  DN_EV,
float &  rad,
unsigned short &  qual,
short &  gain 
)
protectedvirtual

NAME: calibrate_sample()

DESCRIPTION: Calibrate single DG frame and set quality flags as indicated.

Reimplemented in ViirsBandModDGTeb, and ViirsBandModDGRsb.

◆ calibrate_scan()

int calibrate_scan ( int  scan)
protectedvirtual

calibrate_scan

Calibrate dual-gain scan

Reimplemented from ViirsBandMod.

◆ check_pixel_quality() [1/2]

virtual int check_pixel_quality
protected

check_pixel_quality()

Check EV and set quality flags

◆ check_pixel_quality() [2/2]

virtual int check_pixel_quality ( int  band,
int  scan,
int  det,
short &  DN_EV,
unsigned short &  qual,
short  gain 
)
protectedvirtual

◆ getSVFromEV()

int getSVFromEV ( )
protectedvirtual

NAME: getSVFromEV()

DESCRIPTION: Obtain background reference from EV rather than SV.

Reimplemented from ViirsBandMod.

◆ initialize_L1A_data()

int initialize_L1A_data ( )
virtual

Initialize L1A data

Reimplemented from ViirsBandMod.

◆ write_cdg()

int write_cdg ( const NcFile *  nc_output)
protectedvirtual

Write calibrated dual-gain output data as radiance with float data type

Reimplemented from ViirsBand.

Member Data Documentation

◆ bCdg_

bool bCdg_
protected

Definition at line 65 of file VcstViirsBandModDG.h.

◆ DN_EV_

dn_ev_array* DN_EV_
protected

Definition at line 60 of file VcstViirsBandModDG.h.

◆ EV_FLAG_

ev_flag_array* EV_FLAG_
protected

Definition at line 63 of file VcstViirsBandModDG.h.

◆ EV_GAIN_

ev_gain_array* EV_GAIN_
protected

Definition at line 61 of file VcstViirsBandModDG.h.

◆ EV_RAD_

ev_rad_array* EV_RAD_
protected

Definition at line 62 of file VcstViirsBandModDG.h.

◆ EV_SAMPLES

const int EV_SAMPLES = 6304
staticprotected

Definition at line 35 of file VcstViirsBandModDG.h.

◆ FIFTH_AG_END

const int FIFTH_AG_END = 6303
staticprotected

Definition at line 46 of file VcstViirsBandModDG.h.

◆ FIFTH_AG_START

const int FIFTH_AG_START = 5664
staticprotected

Definition at line 45 of file VcstViirsBandModDG.h.

◆ FIRST_AG_END

const int FIRST_AG_END = 639
staticprotected

Definition at line 40 of file VcstViirsBandModDG.h.

◆ FIRST_AG_START

const int FIRST_AG_START = 0
staticprotected

Definition at line 39 of file VcstViirsBandModDG.h.

◆ FOURTH_AG_END

const int FOURTH_AG_END = 5663
staticprotected

Definition at line 44 of file VcstViirsBandModDG.h.

◆ FOURTH_AG_START

const int FOURTH_AG_START = 4928
staticprotected

Definition at line 43 of file VcstViirsBandModDG.h.

◆ HIGH_GAIN

const int HIGH_GAIN = 0
staticprotected

Definition at line 48 of file VcstViirsBandModDG.h.

◆ LOW_GAIN

const int LOW_GAIN = 1
staticprotected

Definition at line 49 of file VcstViirsBandModDG.h.

◆ SECOND_AG_END

const int SECOND_AG_END = 1375
staticprotected

Definition at line 42 of file VcstViirsBandModDG.h.

◆ SECOND_AG_START

const int SECOND_AG_START = 640
staticprotected

Definition at line 41 of file VcstViirsBandModDG.h.

◆ TrimTable_DG_

const int TrimTable_DG_[DETECTORS][2]
staticprotected

Definition at line 53 of file VcstViirsBandModDG.h.


The documentation for this class was generated from the following file: