OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022

#include <VcstViirsBandMod.h>

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

Public Types

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 Member Functions

 ViirsBandMod (VcstObc *pObc, VIIRS_BAND_ENUM band)
 
 ~ViirsBandMod ()
 
virtual int initialize ()
 
int get_l1bdata (float *l1bdata)
 
int initialize_L1A_data ()
 
- 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)
 
virtual int write_cdg (const NcFile *nc_output)
 

Public Attributes

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

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
 

Protected Member Functions

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_scan (int scan)
 
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)
 
virtual int getSVFromEV ()
 

Additional Inherited Members

- 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_
 

Detailed Description

Definition at line 20 of file VcstViirsBandMod.h.

Member Typedef Documentation

◆ byte_pix_array

typedef int8_t byte_pix_array[EV_PIXELS]

Definition at line 67 of file VcstViirsBandMod.h.

◆ dn_ev_array

typedef short dn_ev_array[DETECTORS][EV_PIXELS]

Output arrays

Definition at line 63 of file VcstViirsBandMod.h.

◆ flt_pix_array

typedef float flt_pix_array[EV_PIXELS]

Definition at line 64 of file VcstViirsBandMod.h.

◆ int_pix_array

typedef unsigned int int_pix_array[EV_PIXELS]

Definition at line 66 of file VcstViirsBandMod.h.

◆ shrt_pix_array

typedef unsigned short shrt_pix_array[EV_PIXELS]

Definition at line 65 of file VcstViirsBandMod.h.

Constructor & Destructor Documentation

◆ ViirsBandMod()

ViirsBandMod ( VcstObc pObc,
VIIRS_BAND_ENUM  band 
)

Class constructor

◆ ~ViirsBandMod()

Class destructor

Member Function Documentation

◆ calibrate_pixel()

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 
)
protectedvirtual

NAME: calibrate_pixel()

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

Reimplemented in ViirsBandModSGTeb, and ViirsBandModSGRsb.

◆ calibrate_scan()

virtual int calibrate_scan ( int  scan)
protectedvirtual

calibrate_scan()

Calibrate TEB scan

Reimplemented from ViirsBand.

Reimplemented in ViirsBandModDG.

◆ check_pixel_quality()

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

check_pixel_quality()

Check EV and set quality flags

Reimplemented from ViirsBand.

◆ get_l1bdata()

int get_l1bdata ( float *  l1bdata)
virtual

Get a pointer to L1B data

Reimplemented from ViirsBand.

◆ getSVFromEV()

virtual int getSVFromEV ( )
protectedvirtual

NAME: getSVFromEV()

DESCRIPTION: Obtain background reference from EV rather than SV.

Reimplemented in ViirsBandModDG.

◆ initialize()

virtual int initialize ( )
virtual

Initialize class

Reimplemented from ViirsBand.

◆ initialize_L1A_data()

int initialize_L1A_data ( )
virtual

Initialize L1A data

Reimplemented from ViirsBand.

Reimplemented in ViirsBandModDG.

◆ initialize_L1B_data()

virtual int initialize_L1B_data ( )
protectedvirtual

Initialize L1B data

Reimplemented from ViirsBand.

◆ precheck_scan()

bool precheck_scan ( int  scan)
protectedvirtual

precheck_scan()

Precheck_scan to determine if it is good for calibration. Returns true or false.

Reimplemented from ViirsBand.

Member Data Documentation

◆ badDetector_

unsigned char badDetector_[DETECTORS]

Definition at line 75 of file VcstViirsBandMod.h.

◆ C_COEFFS

const int C_COEFFS = 4
static

Definition at line 44 of file VcstViirsBandMod.h.

◆ CAL_SAMPLES

const int CAL_SAMPLES = 48
static

Definition at line 41 of file VcstViirsBandMod.h.

◆ DETECTORS

const int DETECTORS = 16
static

Definition at line 40 of file VcstViirsBandMod.h.

◆ dg_band_

Definition at line 55 of file VcstViirsBandMod.h.

◆ DN_EV_

dn_ev_array* DN_EV_

Definition at line 68 of file VcstViirsBandMod.h.

◆ EV_PIXELS

const int EV_PIXELS = 3200
static

Definition at line 39 of file VcstViirsBandMod.h.

◆ GAIN_STATE

const int GAIN_STATE = 2
static

Definition at line 43 of file VcstViirsBandMod.h.

◆ long_val_

int_pix_array* long_val_

Definition at line 71 of file VcstViirsBandMod.h.

◆ M_BANDS

const int M_BANDS = 16
static

Definition at line 37 of file VcstViirsBandMod.h.

◆ MIRROR

const int MIRROR = 2
static

Definition at line 42 of file VcstViirsBandMod.h.

◆ mod_band_

VIIRS_M_BAND_ENUM mod_band_

Band identifiers

Definition at line 53 of file VcstViirsBandMod.h.

◆ mrsb_band_

Definition at line 56 of file VcstViirsBandMod.h.

◆ mteb_band_

Definition at line 57 of file VcstViirsBandMod.h.

◆ pixelQuality_

shrt_pix_array* pixelQuality_

Definition at line 72 of file VcstViirsBandMod.h.

◆ radiance_

flt_pix_array* radiance_

Definition at line 69 of file VcstViirsBandMod.h.

◆ sample_quality_flag_masks_

vector<unsigned short> sample_quality_flag_masks_

Definition at line 48 of file VcstViirsBandMod.h.

◆ sg_band_

Definition at line 54 of file VcstViirsBandMod.h.

◆ short_val_

shrt_pix_array* short_val_

Definition at line 70 of file VcstViirsBandMod.h.

◆ unc_idx_

byte_pix_array* unc_idx_

Definition at line 73 of file VcstViirsBandMod.h.


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