OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
RsViirs.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * NAME: RsViirs.h
4  *
5  * DESCRIPTION: Object class that supports the resampling of VIIRS GEO and L1B
6  * files in order to eliminate unsightly bowtie fill regions in L1B.
7  *
8  * Created on: February 17, 2019
9  * Author: Sam Anderson, NASA Ocean Color
10  *
11  *******************************************************************************/
12 
13 #ifndef RsViirs_H_
14 #define RsViirs_H_
15 
16 #include <string>
17 #include <math.h>
18 
19 using namespace std;
20 
21 static constexpr int RS_SUCCESS = 0;
22 static constexpr int RS_FAIL = 1;
23 
24 enum RESAM_ENUM {
25  M01,
26  M02,
27  M03,
28  M04,
29  M05,
30  M06,
31  M07,
32  M08,
33  M09,
34  M10,
35  M11,
36  M12,
37  M13,
38  M14,
39  M15,
40  M16,
42 };
43 
44 // Bands 1-11 reflectance, and bands 12, 14-16 brightnesss temperature
45 const unsigned short NA_UINT16_FILL = 65535;
46 const unsigned short MISS_UINT16_FILL = 65534;
47 const unsigned short ONBOARD_PT_UINT16_FILL = 65533;
48 const unsigned short ONGROUND_PT_UINT16_FILL = 65532;
49 const unsigned short ERR_UINT16_FILL = 65531;
50 const unsigned short VDNE_UINT16_FILL = 65529;
51 const unsigned short SOUB_UINT16_FILL = 65528;
52 
53 // Band 13 brightnesss temperature
54 const float NA_FLOAT32_FILL = -999.9;
55 const float ONBOARD_PT_FLOAT32_FILL = -999.7;
56 const float ONGROUND_PT_FLOAT32_FILL = -999.6;
57 const float VDNE_FLOAT32_FILL = -999.3;
58 
61 
62 const int NMBANDS = 16;
63 const int NSCANS = 203;
64 const int NPIXELS = 3200;
65 const int NDETECTORS = 16;
66 const int NBREAKS = 11;
67 
68 const float D2R = M_PI/180.0;
69 const float R2D = 180.0/M_PI;
70 
71 struct fio {
74 };
75 struct sio {
78 };
79 struct usio {
80  unsigned short in[NSCANS*NDETECTORS][NPIXELS];
81  unsigned short out[NSCANS*NDETECTORS][NPIXELS];
82 };
83 struct uio {
84  unsigned int in[NSCANS*NDETECTORS][NPIXELS];
85  unsigned int out[NSCANS*NDETECTORS][NPIXELS];
86 };
87 
88 
89 class RsViirs
90 {
91 public:
92 
93 // Class constructor
94  RsViirs ();
95  RsViirs ( int lines, int pixels );
96 
97 // Class destructor
98  ~RsViirs ();
99 
100 // Apply algorithm to data, produce product
101  int process();
102 
103 // Strings
104  string config_file_;
105  string history_;
107 
108 // Instrument-specific dimensions
109  int lines_;
110  int pixels_;
111  short si_[NSCANS*NDETECTORS][NPIXELS];
112 
113  int generate_sort_index ();
114  int resort (sio* io);
115  int resort (usio* io);
116  int resort (uio* io);
117  int resort (fio* io);
118  int fill_the_fills (usio* io);
119  int fill_the_fills (uio* io);
120  int fill_the_fills (fio* io);
121 
122 };
123 
124 #endif /* RsViirs_H_ */
const unsigned short DELETION_ZONE_INT
Definition: RsViirs.h:59
const float VDNE_FLOAT32_FILL
Definition: RsViirs.h:57
@ M08
Definition: RsViirs.h:32
const float D2R
Definition: RsViirs.h:68
string history_
Definition: RsViirs.h:105
@ M15
Definition: RsViirs.h:39
@ M14
Definition: RsViirs.h:38
const float R2D
Definition: RsViirs.h:69
const unsigned short MISS_UINT16_FILL
Definition: RsViirs.h:46
const unsigned short ERR_UINT16_FILL
Definition: RsViirs.h:49
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
Definition: HISTORY.txt:422
const float ONBOARD_PT_FLOAT32_FILL
Definition: RsViirs.h:55
@ M02
Definition: RsViirs.h:26
const unsigned short SOUB_UINT16_FILL
Definition: RsViirs.h:51
string config_file_
Definition: RsViirs.h:104
const unsigned short ONBOARD_PT_UINT16_FILL
Definition: RsViirs.h:47
@ M05
Definition: RsViirs.h:29
int pixels_
Definition: RsViirs.h:110
@ M01
Definition: RsViirs.h:25
@ NUM_MOD_BANDS
Definition: RsViirs.h:41
@ M16
Definition: RsViirs.h:40
const int NDETECTORS
Definition: RsViirs.h:65
const unsigned short ONGROUND_PT_UINT16_FILL
Definition: RsViirs.h:48
@ M12
Definition: RsViirs.h:36
@ M13
Definition: RsViirs.h:37
const float ONGROUND_PT_FLOAT32_FILL
Definition: RsViirs.h:56
Definition: RsViirs.h:79
#define M_PI
Definition: pml_iop.h:15
@ M07
Definition: RsViirs.h:31
@ M10
Definition: RsViirs.h:34
const int NMBANDS
Definition: RsViirs.h:62
@ M04
Definition: RsViirs.h:28
RESAM_ENUM
Definition: RsViirs.h:24
@ M03
Definition: RsViirs.h:27
const unsigned short VDNE_UINT16_FILL
Definition: RsViirs.h:50
string source_files_
Definition: RsViirs.h:106
const float DELETION_ZONE_FLOAT
Definition: RsViirs.h:60
int lines_
Definition: RsViirs.h:109
@ M06
Definition: RsViirs.h:30
const int NBREAKS
Definition: RsViirs.h:66
const int NSCANS
Definition: RsViirs.h:63
@ M09
Definition: RsViirs.h:33
Definition: RsViirs.h:71
const float NA_FLOAT32_FILL
Definition: RsViirs.h:54
Definition: RsViirs.h:75
Definition: RsViirs.h:83
@ M11
Definition: RsViirs.h:35
const unsigned short NA_UINT16_FILL
Definition: RsViirs.h:45
const int NPIXELS
Definition: RsViirs.h:64