Due to the lapse in federal government funding, NASA is not updating this website. We sincerely regret this inconvenience.
NASA Logo
Ocean Color Science Software

ocssw V2022
cldmsk Namespace Reference

Classes

struct  SSESData
 

Typedefs

typedef bool(* get_valid) (const l1str &, int, int, int)
 
typedef float(* get_value) (const l1str &, int, int, int)
 

Enumerations

enum  product_types { SST, SST3, SST4 }
 

Functions

std::vector< float > & month_data ()
 
std::string get_sensor (int key)
 
float btrefdiffv6 (int32_t ip, float BT39, float BT40, const l1str *l1rec, int fullscanpix)
 
void get_var_mask (int *mask, const l1str &l1str, size_t npix, int nbands, int ib, get_valid get_mask)
 
void get_var_vals (float *BT, const l1str &l1str, size_t npix, int nbands, int ib, get_value get_val)
 
void get_window_1D_max (float *maxs_1d, const float *inp1d, const int *mask1d, size_t npix, size_t radius)
 
void get_total_2d_max (float *max_global, const float *inp2d, size_t npix, size_t nscan, size_t center, size_t radius)
 
void get_window_1D_min (float *mins_1d, const float *inp1d, const int *mask1d, size_t npix, size_t radius)
 
void get_total_2d_min (float *min_global, const float *inp2d, size_t npix, size_t nscan, size_t center, size_t radius)
 
void get_std_box (const float *inp2d, const int *mask2d, size_t npix, size_t nscan, size_t radius_x, size_t radius_y, float *out, size_t center, l1qstr *l1qrec)
 
void read_sst_bands (const std::string &sat, std::unordered_map< std::string, int > &bands)
 
template<class T >
std::ostream & operator<< (std::ostream &stream, const std::vector< T > &data)
 

Variables

std::vector< float > month_data_
 
const float cldthresh = -1.0
 
const std::unordered_map< std::string, float > cldthresh_list
 
const std::unordered_map< std::string, const std::unordered_map< std::string, int > > bands_set
 
const std::unordered_map< std::string, size_t > bt_box_sizes
 
const float hisenz = 55.0
 
const float vhisenz = 75.0
 
const float vhisenzv2 = 65.0
 
const float solznight = 85.0
 
const float Btmin = -4.0
 
const float Btmax = 37.0
 
const float Btmax40 = 35.0
 
const float SSTmin = -1.8
 
const float SSTmax = 40.0
 
const float SSTmaxn = 37.0
 
const float glintmax = 0.005
 
const float dBtmin = 0.0
 
const float dBtmax = 3.6
 
const float dBt4min = 0.0
 
const float dBt4max = 8.0
 
const float SSTdiff = 3.0
 
const float SSTvdiff = 5.0
 
const float SST4diff1 = -0.8
 
const float SST4diff2 = -1.0
 
const float SST3diff1 = 0.8
 
const float SST3diff2 = 1.0
 
const float Bt11unif1 = 0.7
 
const float Bt12unif1 = 0.7
 
const float Bt11unif2 = 1.9
 
const float Bt12unif2 = 1.9
 
const float Bt37unif1 = 0.7
 
const float Bt37unif2 = 1.9
 
const float Bt39unif1 = 0.7
 
const float Bt40unif1 = 0.7
 
const float Bt39unif2 = 1.9
 
const float Bt40unif2 = 1.9
 
const float dBtrefmin = -1.1
 
const float dBtrefmax = 10.0
 
const float equatorialNorth = 30.0
 
const float equatorialSouth = -10.0
 
const float equatorialWest = -105.0
 
const float equatorialEast = 105.0
 
const float invalid_val = (BAD_FLT + 0.1)
 
const float max_bt = BT_HI - 0.1
 
const float min_bt = BT_LO + 0.1
 
const float min_lt = BAD_FLT + 1.0
 
const float max_lt = BT_HI - 1.0
 
const std::unordered_set< int > modis_sensors
 
const std::unordered_set< int > viirs_sensors = {VIIRSJ1, VIIRSJ2, VIIRSN}
 
const std::unordered_map< std::string, std::unordered_set< int > > all_sensors
 
const std::unordered_map< int, std::stringplatforms
 
const double scan_time_modis_t_day1 = 972777600
 
const double scan_time_modis_t_day2 = 993945600
 
const float el_corr_modis_t_1 = 0.4452
 
const float el_corr_modis_t_2 = 0.2593
 
const get_valid cirrus_mask
 
const get_value cirrus_value
 
const get_valid bt_mask
 
const get_value bt_value
 
const get_valid rho_mask
 
const get_value rho_value
 
const get_value cldrh_value
 
const get_valid cldrh_mask
 
const std::unordered_map< std::string, float *(*)(const l1str &)> get_non_BT_vars
 

Detailed Description

Contains supportive functions and constants.

Typedef Documentation

◆ get_valid

typedef bool(* get_valid) (const l1str &, int, int, int)

Definition at line 215 of file sst_cloud_mask_utils.hpp.

◆ get_value

typedef float(* get_value) (const l1str &, int, int, int)

Definition at line 216 of file sst_cloud_mask_utils.hpp.

Enumeration Type Documentation

◆ product_types

Enumerator
SST 
SST3 
SST4 

Definition at line 208 of file sst_cloud_mask_utils.hpp.

Function Documentation

◆ btrefdiffv6()

float btrefdiffv6 ( int32_t  ip,
float  BT39,
float  BT40,
const l1str *  l1rec,
int  fullscanpix 
)

Legacy BT diff test with interpolation adjutment.

Parameters
ip- pixel
BT39- Bt39
BT40- Bt40
l1rec- l1 record
fullscanpix- full scan size
Returns
float

Definition at line 31 of file sst_cloud_mask_utils.cpp.

◆ get_sensor()

std::string get_sensor ( int  key)

Get the sensor string.

Parameters
key- integer sensor ID
Returns
std::string

Definition at line 20 of file sst_cloud_mask_utils.cpp.

◆ get_std_box()

void get_std_box ( const float *  inp2d,
const int *  mask2d,
size_t  npix,
size_t  nscan,
size_t  radius_x,
size_t  radius_y,
float *  out,
size_t  center,
l1qstr *  l1qrec 
)

Compute standard deviation in a window.

Parameters
inp2d- input array
mask2d- mask
npix- pixel in a line (x dim)
nscan- queue size ( y dim)
radius_x- radius along npix
radius_y- radiis along nscan
out- STD
center- Center of the queu
l1qrec- queue struct

Definition at line 121 of file sst_cloud_mask_utils.cpp.

◆ get_total_2d_max()

void get_total_2d_max ( float *  max_global,
const float *  inp2d,
size_t  npix,
size_t  nscan,
size_t  center,
size_t  radius 
)

Get the max value of center line with 2D sliding window using a 1D max queue computed with get_window_1D_max.

Parameters
max_global- max values, out
inp2d- input queue, obtained from get_window_1D_max
npix- number of pixels
nscan- queue size/ nubmer of scans
center- center of the line
radius- window size

Definition at line 72 of file sst_cloud_mask_utils.cpp.

◆ get_total_2d_min()

void get_total_2d_min ( float *  min_global,
const float *  inp2d,
size_t  npix,
size_t  nscan,
size_t  center,
size_t  radius 
)

the same as get_total_2d_max but for min

Definition at line 105 of file sst_cloud_mask_utils.cpp.

◆ get_var_mask()

void get_var_mask ( int *  mask,
const l1str &  l1str,
size_t  npix,
int  nbands,
int  ib,
get_valid  get_mask 
)

Get the mask (line) of a BT.

Parameters
mask- mask
l1str- l1 record
npix- number of pixel in a line
nbands- number of bands
ib- band number
get_mask- mask function ptr

Definition at line 43 of file sst_cloud_mask_utils.cpp.

◆ get_var_vals()

void get_var_vals ( float *  BT,
const l1str &  l1str,
size_t  npix,
int  nbands,
int  ib,
get_value  get_val 
)

the same as get_var_mask but gets values

Definition at line 49 of file sst_cloud_mask_utils.cpp.

◆ get_window_1D_max()

void get_window_1D_max ( float *  maxs_1d,
const float *  inp1d,
const int *  mask1d,
size_t  npix,
size_t  radius 
)

Compute max values within a 1D window in one line in a queue.

Parameters
maxs_1d- output queue
inp1d- inputd queu
mask1d- input mask
npix- number of pixels
radius- radius of the sliding window

Definition at line 55 of file sst_cloud_mask_utils.cpp.

◆ get_window_1D_min()

void get_window_1D_min ( float *  mins_1d,
const float *  inp1d,
const int *  mask1d,
size_t  npix,
size_t  radius 
)

the same as get_window_1D_max but for min

Definition at line 87 of file sst_cloud_mask_utils.cpp.

◆ month_data()

std::vector< float > & month_data ( )

month variable for the desicion tree traversal

Returns

Definition at line 18 of file sst_cloud_mask_utils.cpp.

◆ operator<<()

std::ostream& cldmsk::operator<< ( std::ostream &  stream,
const std::vector< T > &  data 
)

prints a vector

Template Parameters
T
Parameters
stream- out stream
data- vector
Returns
std::ostream&

Definition at line 188 of file sst_cloud_mask_utils.hpp.

◆ read_sst_bands()

void read_sst_bands ( const std::string sat,
std::unordered_map< std::string, int > &  bands 
)

Definition at line 166 of file sst_cloud_mask_utils.cpp.

Variable Documentation

◆ all_sensors

const std::unordered_map<std::string, std::unordered_set<int> > all_sensors
Initial value:
= {{"modis", modis_sensors},
{"viirs", viirs_sensors}}

Definition at line 154 of file sst_cloud_mask_utils.hpp.

◆ bands_set

const std::unordered_map<std::string, const std::unordered_map<std::string, int> > bands_set
Initial value:
=
{{"modis",
{{"ibred", 678},
{"ib07", 748},
{"ib16", 1640},
{"ib37", 3750},
{"ib39", 3959},
{"ib40", 4050},
{"ib67", 6715},
{"ib73", 7325},
{"ib85", 8550},
{"ib11", 11000},
{"ib12", 12000}}},
{"viirs",
{{"ibred", 672},
{"ib07", 748},
{"ib16", 1601},
{"ib37", 3750},
{"ib40", 4050},
{"ib85", 8550},
{"ib11", 11000},
{"ib12", 12000}}}}

Definition at line 85 of file sst_cloud_mask_utils.hpp.

◆ Bt11unif1

const float Bt11unif1 = 0.7

Definition at line 130 of file sst_cloud_mask_utils.hpp.

◆ Bt11unif2

const float Bt11unif2 = 1.9

Definition at line 132 of file sst_cloud_mask_utils.hpp.

◆ Bt12unif1

const float Bt12unif1 = 0.7

Definition at line 131 of file sst_cloud_mask_utils.hpp.

◆ Bt12unif2

const float Bt12unif2 = 1.9

Definition at line 133 of file sst_cloud_mask_utils.hpp.

◆ Bt37unif1

const float Bt37unif1 = 0.7

Definition at line 134 of file sst_cloud_mask_utils.hpp.

◆ Bt37unif2

const float Bt37unif2 = 1.9

Definition at line 135 of file sst_cloud_mask_utils.hpp.

◆ Bt39unif1

const float Bt39unif1 = 0.7

Definition at line 136 of file sst_cloud_mask_utils.hpp.

◆ Bt39unif2

const float Bt39unif2 = 1.9

Definition at line 138 of file sst_cloud_mask_utils.hpp.

◆ Bt40unif1

const float Bt40unif1 = 0.7

Definition at line 137 of file sst_cloud_mask_utils.hpp.

◆ Bt40unif2

const float Bt40unif2 = 1.9

Definition at line 139 of file sst_cloud_mask_utils.hpp.

◆ bt_box_sizes

const std::unordered_map<std::string, size_t> bt_box_sizes
Initial value:
= {{"modis", 3},
{"viirs", 5}}

Definition at line 107 of file sst_cloud_mask_utils.hpp.

◆ bt_mask

const get_valid bt_mask
Initial value:
= [](const l1str &l1str_, int pixel, int nbands, int ib) {
const float bt = l1str_.Bt[pixel * nbands + ib];
return bt > min_bt && bt < max_bt;
}

Definition at line 224 of file sst_cloud_mask_utils.hpp.

◆ bt_value

const get_value bt_value
Initial value:
= [](const l1str &l1str_, int pixel, int nbands, int ib) {
return l1str_.Bt[pixel * nbands + ib];
}

Definition at line 228 of file sst_cloud_mask_utils.hpp.

◆ Btmax

const float Btmax = 37.0

Definition at line 114 of file sst_cloud_mask_utils.hpp.

◆ Btmax40

const float Btmax40 = 35.0

Definition at line 115 of file sst_cloud_mask_utils.hpp.

◆ Btmin

const float Btmin = -4.0

Definition at line 113 of file sst_cloud_mask_utils.hpp.

◆ cirrus_mask

const get_valid cirrus_mask
Initial value:
= [](const l1str &l1str_, int pixel, int nbands, int ib) {
return l1str_.rho_cirrus[pixel] > invalid_val;
}

Definition at line 218 of file sst_cloud_mask_utils.hpp.

◆ cirrus_value

const get_value cirrus_value
Initial value:
= [](const l1str &l1str_, int pixel, int nbands,
int ib) { return l1str_.rho_cirrus[pixel]; }

Definition at line 221 of file sst_cloud_mask_utils.hpp.

◆ cldrh_mask

const get_valid cldrh_mask
Initial value:
= [](const l1str &l1str_, int pixel, int nbands, int ib) {
const float lt = l1str_.Lt[pixel * nbands + ib];
return lt > 0.0 && lt < max_lt;
}

Definition at line 255 of file sst_cloud_mask_utils.hpp.

◆ cldrh_value

const get_value cldrh_value
Initial value:
= [](const l1str &l1str_, int pixel, int nbands, int ib) {
const float lt = l1str_.Lt[pixel * nbands + ib];
const float fo = l1str_.Fo[ib];
const float tg_sol = l1str_.tg_sol[pixel * nbands + ib];
const float tg_sen = l1str_.tg_sen[pixel * nbands + ib];
const float t_sen = l1str_.t_sen[pixel * nbands + ib];
const float t_sol = l1str_.t_sol[pixel * nbands + ib];
const float cldrh = M_PI * lt / fo / tg_sol / tg_sen / t_sol / t_sen;
return cldrh;
}

Definition at line 244 of file sst_cloud_mask_utils.hpp.

◆ cldthresh

const float cldthresh = -1.0

Definition at line 82 of file sst_cloud_mask_utils.hpp.

◆ cldthresh_list

const std::unordered_map<std::string, float> cldthresh_list
Initial value:
= {{"modis", 0.01},
{"viirs", 0.04}}

Definition at line 83 of file sst_cloud_mask_utils.hpp.

◆ dBt4max

const float dBt4max = 8.0

Definition at line 123 of file sst_cloud_mask_utils.hpp.

◆ dBt4min

const float dBt4min = 0.0

Definition at line 122 of file sst_cloud_mask_utils.hpp.

◆ dBtmax

const float dBtmax = 3.6

Definition at line 121 of file sst_cloud_mask_utils.hpp.

◆ dBtmin

const float dBtmin = 0.0

Definition at line 120 of file sst_cloud_mask_utils.hpp.

◆ dBtrefmax

const float dBtrefmax = 10.0

Definition at line 141 of file sst_cloud_mask_utils.hpp.

◆ dBtrefmin

const float dBtrefmin = -1.1

Definition at line 140 of file sst_cloud_mask_utils.hpp.

◆ el_corr_modis_t_1

const float el_corr_modis_t_1 = 0.4452

Definition at line 163 of file sst_cloud_mask_utils.hpp.

◆ el_corr_modis_t_2

const float el_corr_modis_t_2 = 0.2593

Definition at line 164 of file sst_cloud_mask_utils.hpp.

◆ equatorialEast

const float equatorialEast = 105.0

Definition at line 145 of file sst_cloud_mask_utils.hpp.

◆ equatorialNorth

const float equatorialNorth = 30.0

Definition at line 142 of file sst_cloud_mask_utils.hpp.

◆ equatorialSouth

const float equatorialSouth = -10.0

Definition at line 143 of file sst_cloud_mask_utils.hpp.

◆ equatorialWest

const float equatorialWest = -105.0

Definition at line 144 of file sst_cloud_mask_utils.hpp.

◆ get_non_BT_vars

const std::unordered_map<std::string, float *(*)(const l1str &)> get_non_BT_vars
Initial value:
=
{
{"solz", [](const l1str &l1rec) { return l1rec.solz; }},
{"senz", [](const l1str &l1rec) { return l1rec.senz; }},
{"wv", [](const l1str &l1rec) { return l1rec.wv; }},
{"glintcoef", [](const l1str &l1rec) { return l1rec.glint_coef; }},
{"lat", [](const l1str &l1rec) { return l1rec.lat; }},
{"lon", [](const l1str &l1rec) { return l1rec.lon; }},
{"month", [](const l1str &l1rec) { return month_data().data(); }}}

Definition at line 260 of file sst_cloud_mask_utils.hpp.

◆ glintmax

const float glintmax = 0.005

Definition at line 119 of file sst_cloud_mask_utils.hpp.

◆ hisenz

const float hisenz = 55.0

Definition at line 109 of file sst_cloud_mask_utils.hpp.

◆ invalid_val

const float invalid_val = (BAD_FLT + 0.1)

Definition at line 146 of file sst_cloud_mask_utils.hpp.

◆ max_bt

const float max_bt = BT_HI - 0.1

Definition at line 147 of file sst_cloud_mask_utils.hpp.

◆ max_lt

const float max_lt = BT_HI - 1.0

Definition at line 150 of file sst_cloud_mask_utils.hpp.

◆ min_bt

const float min_bt = BT_LO + 0.1

Definition at line 148 of file sst_cloud_mask_utils.hpp.

◆ min_lt

const float min_lt = BAD_FLT + 1.0

Definition at line 149 of file sst_cloud_mask_utils.hpp.

◆ modis_sensors

const std::unordered_set<int> modis_sensors
Initial value:

Definition at line 151 of file sst_cloud_mask_utils.hpp.

◆ month_data_

std::vector<float> month_data_

Definition at line 17 of file sst_cloud_mask_utils.cpp.

◆ platforms

const std::unordered_map<int, std::string> platforms
Initial value:
= {{MODIST, "terra"},
{MODISA, "aqua"},
{VIIRSN, "npp"},
{VIIRSJ1, "j1"},
{VIIRSJ2, "j2"}}

Definition at line 156 of file sst_cloud_mask_utils.hpp.

◆ rho_mask

const get_valid rho_mask
Initial value:
= [](const l1str &l1str_, int pixel, int nbands, int ib) {
const float lt = l1str_.Lt[pixel * nbands + ib];
return lt > min_lt && lt < max_lt;
}

Definition at line 232 of file sst_cloud_mask_utils.hpp.

◆ rho_value

const get_value rho_value
Initial value:
= [](const l1str &l1str_, int pixel, int nbands, int ib) {
const float lt = l1str_.Lt[pixel * nbands + ib];
const float fo = l1str_.Fo[ib];
const float csolz = l1str_.csolz[pixel];
const float rho = M_PI * lt / fo / csolz;
return rho;
}

Definition at line 236 of file sst_cloud_mask_utils.hpp.

◆ scan_time_modis_t_day1

const double scan_time_modis_t_day1 = 972777600

Definition at line 161 of file sst_cloud_mask_utils.hpp.

◆ scan_time_modis_t_day2

const double scan_time_modis_t_day2 = 993945600

Definition at line 162 of file sst_cloud_mask_utils.hpp.

◆ solznight

const float solznight = 85.0

Definition at line 112 of file sst_cloud_mask_utils.hpp.

◆ SST3diff1

const float SST3diff1 = 0.8

Definition at line 128 of file sst_cloud_mask_utils.hpp.

◆ SST3diff2

const float SST3diff2 = 1.0

Definition at line 129 of file sst_cloud_mask_utils.hpp.

◆ SST4diff1

const float SST4diff1 = -0.8

Definition at line 126 of file sst_cloud_mask_utils.hpp.

◆ SST4diff2

const float SST4diff2 = -1.0

Definition at line 127 of file sst_cloud_mask_utils.hpp.

◆ SSTdiff

const float SSTdiff = 3.0

Definition at line 124 of file sst_cloud_mask_utils.hpp.

◆ SSTmax

const float SSTmax = 40.0

Definition at line 117 of file sst_cloud_mask_utils.hpp.

◆ SSTmaxn

const float SSTmaxn = 37.0

Definition at line 118 of file sst_cloud_mask_utils.hpp.

◆ SSTmin

const float SSTmin = -1.8

Definition at line 116 of file sst_cloud_mask_utils.hpp.

◆ SSTvdiff

const float SSTvdiff = 5.0

Definition at line 125 of file sst_cloud_mask_utils.hpp.

◆ vhisenz

const float vhisenz = 75.0

Definition at line 110 of file sst_cloud_mask_utils.hpp.

◆ vhisenzv2

const float vhisenzv2 = 65.0

Definition at line 111 of file sst_cloud_mask_utils.hpp.

◆ viirs_sensors

const std::unordered_set<int> viirs_sensors = {VIIRSJ1, VIIRSJ2, VIIRSN}

Definition at line 153 of file sst_cloud_mask_utils.hpp.

float tg_sen[NBANDS]
Definition: atrem_corl1.h:127
read l1rec
#define VIIRSN
Definition: sensorDefs.h:23
const std::unordered_set< int > viirs_sensors
#define MODIST
Definition: sensorDefs.h:18
#define M_PI
Definition: dtranbrdf.cpp:19
const float min_bt
float tg_sol[NBANDS]
Definition: atrem_corl1.h:127
const float invalid_val
const float max_lt
const float max_bt
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution pixel
Definition: HISTORY.txt:192
std::vector< float > & month_data()
month variable for the desicion tree traversal
int32_t nbands
#define VIIRSJ2
Definition: sensorDefs.h:44
const float min_lt
#define MODISA
Definition: sensorDefs.h:19
#define VIIRSJ1
Definition: sensorDefs.h:37
const std::unordered_set< int > modis_sensors