OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ias_const.h
Go to the documentation of this file.
1 #ifndef IAS_CONST_H
2 #define IAS_CONST_H
3 
4 #ifndef TRUE
5 #define TRUE 1
6 #endif
7 
8 #ifndef FALSE
9 #define FALSE 0
10 #endif
11 
12 #define SUCCESS 0
13 #define ERROR -1
14 #define WARNING -2
15 
16 /* Put IAS-specific constants here. */
17 #define IAS_DAYS_IN_YEAR 365
18 #define IAS_DAYS_IN_LEAP_YEAR 366 /* Number of days per year
19  (+1 for leap years) */
20 #define IAS_SOFTWARE_VERSION_SIZE 11
21 #define IAS_INSTRUMENT_SOURCE_SIZE 32
22 #define IAS_BAND_NAME_SIZE 30
23 #define IAS_COLLECT_TYPE_SIZE 50
24 
25 #define IAS_EPOCH_2000 2451545.0 /* Julian date of epoch 2000 */
26 #define IAS_JULIAN_CENTURY 36525.0 /* Julian century */
27 
28 #define IAS_SEC_PER_DAY 86400 /* Seconds Per Day */
29 #define IAS_DAILY_SECONDS_IN_LEAP_YEAR 86401 /* Number of seconds per day
30  (+1 to account for leap
31  seconds) */
32 
33 /*
34  * GPS epoch year. 1970 was chosen to support DOQ GCPs that have slightly bogus
35  * dates of 7/1/1970
36  */
37 #define IAS_MIN_YEAR 1970
38 
39 #define IAS_MAX_YEAR 2099
40 #define IAS_MAX_MONTH 12
41 #define IAS_MIN_MONTH 1
42 
43 /* Length of the composite IAS sensor name "L8_OLITIRS" */
44 #define IAS_SENSOR_NAME_LENGTH 11
45 
46 /* Size of the composite IAS sensor ID "OLI_TIRS",
47  including null terminator */
48 #define IAS_SENSOR_ID_SIZE 9
49 
50 /* Length of the satellite name "Landsat_8" */
51 #define IAS_SPACECRAFT_NAME_LENGTH 10
52 
53 #define IAS_MODIFIED_JULIAN_DATE 2400000.5
54 /* The Modified Julian Date Constant Modified Julian Date = FullJuilanDate -
55  * MDJ (where FullJulianDate is a running day count since Jan 1 4713 B.C. */
56 
57 /* define some constants related to projection definitions */
58 #define IAS_UNITS_SIZE 12
59 /* maximum size of the units string (i.e. METERS, FEET, etc) */
60 
61 #define IAS_DATUM_SIZE 16
62 /* maximum size of the datum name string */
63 
64 #define IAS_PROJ_PARAM_SIZE 15
65 /* size of the array for holding projection parameters */
66 
67 #define IAS_WORKORDER_ID_LENGTH 12
68 /* length of a Work Order ID */
69 #define IAS_WORKORDER_ID_SIZE (IAS_WORKORDER_ID_LENGTH + 1)
70 /* size of a Work Order ID string, including null terminator */
71 
72 #define IAS_PRODUCT_REQUEST_ID_LENGTH 20
73 /* length of a Product Request ID */
74 #define IAS_PRODUCT_REQUEST_ID_SIZE (IAS_PRODUCT_REQUEST_ID_LENGTH + 1)
75 /* size of a Product Request ID string, including null terminator */
76 
77 #define IAS_CHAR_ID_LENGTH 20
78 /* length of a characterization ID */
79 #define IAS_CHAR_ID_SIZE (IAS_CHAR_ID_LENGTH + 1)
80 /* size of a characterization ID string, including null terminator */
81 
82 /* RPS report header string sizes (include NULL terminator) */
83 #define IAS_DIFFUSER_TYPE_SIZE 9
84 #define IAS_BIAS_MODEL_TYPE_SIZE 11
85 
86 /* Number of points to use in Lagrange interpolation */
87 #define IAS_LAGRANGE_PTS 4
88 
89 /* Number of values in the LOS LEGRENDRE Coefficeint arrays */
90 #define IAS_LOS_LEGENDRE_TERMS 4
91 
92  /* If roll angle is this far from 0 degrees, call it off-nadir */
93 #define IAS_OFF_NADIR_BOUNDARY 0.5
94 
95 /* Macro to determine odd/even image data lines. The convention assumed
96  here is that line index 0 is an "odd" line, line index 1 is an "even"
97  line, etc. This convention applies to both radiometric and geometric
98  processing.
99 
100  This is needed for radiometric processing of the OLI PAN band (band 8),
101  because there is a coherent noise-like effect creating a response
102  difference between "odd" and "even" image lines. Several RPS processing
103  algorithms need to account for this difference.
104 
105  The parentheses around the parameter name in the macro definition ARE
106  IMPORTANT, so don't delete them */
107 #define IAS_IS_EVEN_LINE(line_index) \
108  (((line_index) & 0x01) != 0)
109 
110 
111 /* Common value used by create_grid and terrain_occlusion to represent
112  an invalid elevation value. Other GPS (and perhaps RPS) needing
113  a value to represent an invalid elevation data value should use
114  this constant */
115 #define INVALID_ELEVATION -999999
116 
117 /* ******* QUALITY BAND BIT IDENTIFICATION *******
118 
119  Each sample is assigned a 16-bit mask indicating the status of that sample.
120  The bit positions of the mask are described below. The representation of a
121  16-bit mask is shown on the right with a flag indicating where each class's
122  confidence level is stored.
123 
124  Flag Description Bits Flag
125  ------------------ ----- ----
126  Fill: 0 f
127  Dropped Frame: 1 d CCcc ssvv RRww Rtdf
128  Terrain Occlusion: 2 t 1111 1111 1111 1111
129  <reserved>: 3 R
130  Water: 4-5 w
131  <reserved>: 6-7 R
132  Vegetation: 8-9 v
133  Snow & Ice: 10-11 s
134  Cirrus: 12-13 c
135  Cloud: 14-15 C
136 
137  The following defines can be used to extract the bit information from a
138  quality band sample.
139 */
140 
141 #define IAS_QUALITY_BIT_NOTHING 0x0000 /* No bits are selected */
142 
143 #define IAS_QUALITY_BIT_FILL 0x0001 /* Bit 0 */
144 
145 #define IAS_QUALITY_BIT_DROPPED_FRAME 0x0002 /* Bit 1 */
146 
147 #define IAS_QUALITY_BIT_TERRAIN_OCCLUSION 0x0004 /* Bit 2 */
148 
149 #define IAS_QUALITY_BIT_RESERVED_1 0x0008 /* Bit 3 */
150 
151 #define IAS_QUALITY_BIT_WATER_01 0x0010 /* Bit 4 */
152 #define IAS_QUALITY_BIT_WATER_10 0x0020 /* Bit 5 */
153 #define IAS_QUALITY_BIT_WATER_11 0x0030 /* Bits 4 and 5 */
154 
155 #define IAS_QUALITY_BIT_RESERVED_2 0x0040 /* Bit 6 */
156 #define IAS_QUALITY_BIT_RESERVED_3 0x0080 /* Bit 7 */
157 
158 #define IAS_QUALITY_BIT_VEGETATION_01 0x0100 /* Bit 8 */
159 #define IAS_QUALITY_BIT_VEGETATION_10 0x0200 /* Bit 9 */
160 #define IAS_QUALITY_BIT_VEGETATION_11 0x0300 /* Bits 8 and 9 */
161 
162 #define IAS_QUALITY_BIT_SNOW_ICE_01 0x0400 /* Bit 10 */
163 #define IAS_QUALITY_BIT_SNOW_ICE_10 0x0800 /* Bit 11 */
164 #define IAS_QUALITY_BIT_SNOW_ICE_11 0x0C00 /* Bits 10 and 11 */
165 
166 #define IAS_QUALITY_BIT_CIRRUS_01 0x1000 /* Bit 12 */
167 #define IAS_QUALITY_BIT_CIRRUS_10 0x2000 /* Bit 13 */
168 #define IAS_QUALITY_BIT_CIRRUS_11 0x3000 /* Bits 12 and 13 */
169 
170 #define IAS_QUALITY_BIT_CLOUD_01 0x4000 /* Bit 14 */
171 #define IAS_QUALITY_BIT_CLOUD_10 0x8000 /* Bit 15 */
172 #define IAS_QUALITY_BIT_CLOUD_11 0xC000 /* Bits 14 and 15 */
173 
174 #endif
175