OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
DDProcess.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * NAME: DDProcess.h
4  *
5  * DESCRIPTION: Declaration of the DDProcess object class.
6  *
7  * Created on: August 25, 2020
8  * Author: Sam Anderson, NASA Ocean Color
9  *
10  *******************************************************************************/
11 
12 #ifndef DDProcess_H_
13 #define DDProcess_H_
14 
15 #include <math.h>
16 #include <map>
17 #include <vector>
18 #include <netcdf>
19 #include <DDataset.hpp>
20 
21 using namespace std;
22 
23 // Enumerations
24 
25 enum class algorithm {
26  VIIRS_LIB,
27  OCI_L1B,
28  DARKTARGET,
29  DEEPBLUE,
30  ALLALGS,
31  NOTHING
32 };
33 
34 enum class rhot_band {
35  W410, // m01
36  W445, // m02
37  W490, // m03
38  W550, // m04
39  W670, // m05
40  W865, // m07
41  W1240, // m08
42  W1380, // m09
43  W1610, // m10
44  W2250, // m11
45  W8550, // m14
46  W11000, // m15
47  W12000, // m16
49 };
50 
51 enum class aot_band {
52  W410, // m01
53  W490, // m03
54  W550, // m04
55  W670, // m05
56  W865, // m07
57  W1240, // m08
58  W1610, // m10
59  W2250, // m11
61 };
62 
63 enum class srf_band {
64  W410, // m01
65  W490, // m03
66  W670, // m05
67  W2250, // m11
69 };
70 
71 
72 enum class SEASON
73 {
74  WINTER,
75  SPRING,
76  SUMMER,
77  FALL,
78  NEVER
79 };
80 
81 enum class SENSOR
82 {
83  VIIRS,
84  POCI,
85  NOTHING
86 };
87 
88 enum class LW {
89  OCEAN,
90  LAND,
91  COAST
92 };
93 
94 static constexpr int P_LEVELS = 26;
95 static constexpr int M_LEVELS = 21;
96 static constexpr int WIND_LUT_ENTRIES = 4;
97 
98 static constexpr int NOWL = 7;
99 static constexpr int NLWL = 3;
100 static constexpr int NTWL = 10;
101 
102 static constexpr int DTDB_SUCCESS = 0;
103 static constexpr int DTDB_FAIL = 1;
104 static constexpr int NUM_SEASONS = 4;
105 static constexpr double DEGtoRAD = M_PI/180.0L;
106 static constexpr double RADtoDEG = 180.0L/M_PI;
107 
108 // Compression
109 static constexpr bool bShuffleFilter = true;
110 static constexpr bool bDeflateFilter = true;
111 static constexpr int deflateLevel = 5;
112 
113 class DDSensor;
114 class DDAncillary;
115 class DDAlgorithm;
117 {
118 public:
119 
120  string config_file_;
121  string history_;
123 
124 // Instrument-specific data
125 
126  string title_;
127  bool bday_;
132  size_t lines_;
133  size_t pixels_;
134  size_t lprw_;
136 
140  DDProcess();
141  virtual ~DDProcess ();
142 
146  int initialize();
147 
151  virtual int process();
152 
156  static const map<string, rhot_band> rhot_band_names;
157  static const map<string, aot_band> aot_band_names;
158  static const map<string, srf_band> srf_band_names;
159 
160 
161 protected:
162 
163  map<int,NcDim> dmap_;
164 
172 
173  vector<string> out_products;
174  static const vector<string> out_groups;
175  static const map<string, dtype> input_names;
176  static const map<string, dtype> dtdb_names;
177 
181  int query_granule();
182 
186  int create_nc4( map<string, ddata*> imap );
187 
191  int write_nc4( map<string, ddata*> omap );
192 
197  int write_decimated(vector<string> names, size_t& nwin);
198 };
199 
200 #endif /* DDProcess_H_ */
DDAlgorithm * po_
Definition: DDProcess.h:171
string title_
Definition: DDProcess.h:126
string source_files_
Definition: DDProcess.h:122
bool bcloudmask_
Definition: DDProcess.h:128
map< int, NcDim > dmap_
Definition: DDProcess.h:163
aot_band
Definition: DDProcess.h:51
void initialize(int pixref_flag, int blkref_flag)
Definition: Usds.c:1371
bool bday_
Definition: DDProcess.h:127
algorithm alg_
Definition: DDProcess.h:135
DDAlgorithm * pl_
Definition: DDProcess.h:170
SEASON
Definition: DDProcess.h:72
SENSOR instrument_
Definition: DDProcess.h:131
bool bglintmask_
Definition: DDProcess.h:129
DDAncillary * pancillary_
Definition: DDProcess.h:169
string config_file_
Definition: DDProcess.h:120
@ COAST
DDSensor * psensor_
Definition: DDProcess.h:168
static const map< string, srf_band > srf_band_names
Definition: DDProcess.h:158
static const map< string, dtype > input_names
Definition: DDProcess.h:175
#define M_PI
Definition: pml_iop.h:15
static const map< string, aot_band > aot_band_names
Definition: DDProcess.h:157
#define NUM_SEASONS
Definition: AfrtConstants.h:32
SENSOR
Definition: DDProcess.h:81
size_t pixels_
Definition: DDProcess.h:133
rhot_band
Definition: DDProcess.h:34
Definition: names.f90:1
const bool bDeflateFilter
size_t lines_
Definition: DDProcess.h:132
const bool bShuffleFilter
static const map< string, dtype > dtdb_names
Definition: DDProcess.h:176
LW
Definition: DDProcess.h:88
string history_
Definition: DDProcess.h:121
srf_band
Definition: DDProcess.h:63
const int deflateLevel
size_t lprw_
Definition: DDProcess.h:134
static const map< string, rhot_band > rhot_band_names
Definition: DDProcess.h:156
bool bgascorrect_
Definition: DDProcess.h:130
vector< string > out_products
Definition: DDProcess.h:173
algorithm
Definition: DDProcess.h:25
static const vector< string > out_groups
Definition: DDProcess.h:174
@ OCEAN