OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GEO_geo.h
Go to the documentation of this file.
1 /*
2 !C-INC*************************************************************************
3 !Description: define parameters for the geolocation software
4 
5 !Input Parameters: N/A
6 
7 !Output Parameters: N/A
8 
9 !Revision History:
10  $Log: GEO_geo.h,v $
11  Revision 6.7 2014/08/08 22:21:21 jkuyper
12  Removed macro no longer in use.
13 
14  Revision 6.6 2011/02/09 19:06:42 kuyper
15  Added external header guard for "PGS_DEM.h" to compesate for lack of
16  internal one.
17  Added enumeration of values for land/sea mask.
18  Added explanation of best guess at reason for odd value of landsea mask
19  fill value.
20 
21  Revision 6.5 2010/05/19 20:28:27 kuyper
22  Helped resolve Bug 1969 by adding THERMCORR_FVALUE macro.
23 
24  James Kuyper Jr. James.R.Kuyper@NASA.gov
25 
26  Revision 6.4 2009/09/15 20:15:46 kuyper
27  Removed obsolete macros.
28 
29  Revision 6.3 2009/03/27 20:39:00 kuyper
30  Changed macro name to MAX_PADDED.
31 
32  Revision 6.2 2009/03/18 20:53:15 kuyper
33  Corrected new definition of MAX_DETECTORS.
34  Added HIRES_FVALUE.
35 
36  Revision 6.1 2009/02/20 22:22:09 kuyper
37  Added new macros needed to support position averaging and high-resolution
38  offsets.
39 
40  Revision 5.4 2008/12/15 15:41:18 kuyper
41  Added LUN to control orbit number validation.
42 
43  Revision 5.3 2005/03/16 21:35:11 kuyper
44  Changed header guard macro name to avoid reserved name space.
45 
46  Revision 5.2 2004/11/05 01:46:54 kuyper
47  Corrected definition of L_SMASK_FVALUE.
48 
49  Revision 5.1 2004/08/24 18:54:45 vlin
50  L_SMASK_FVALUE changed to match the fill value used in DEM file.
51 
52  Revision 4.1 2002/11/19 23:11:55 kuyper
53  Added TEMP_FVALUE
54 
55 !Team-unique Header:
56  This software is developed by the MODIS Science Data Support
57  Team for the National Aeronautics and Space Administration,
58  Goddard Space Flight Center, under contract NAS5-32373.
59 
60 !END***************************************************************************
61 */
62 
63 #ifndef GEO_GEO_H
64 #define GEO_GEO_H
65 
66 #include "GEO_basic.h"
67 /* PGS_DEM.h does not have internal header guards, must provide externally. */
68 #ifndef H_PGS_DEM
69  #define H_PGS_DEM
70  #include "PGS_DEM.h"
71 #endif
72 
73 /*********************************************************
74 #defines
75 *********************************************************/
76 
77 /* General geolocation definitions */
78 #define MAX_SCAN_NUMBER 1000
79 #define MAX_FRAMES 1354
80 #define SAMPLE_RATIO_HKM 2
81 #define SAMPLE_RATIO_QKM 4
82 #define SAMPLES_HKM (MAX_FRAMES*SAMPLE_RATIO_HKM)
83 #define SAMPLES_QKM (MAX_FRAMES*SAMPLE_RATIO_QKM)
84 #define MAX_PADDED (SAMPLES_QKM+3)
85 #define DETECTORS_1KM 10
86 #define DETECTORS_HKM (DETECTORS_1KM*SAMPLE_RATIO_HKM)
87 #define DETECTORS_QKM (DETECTORS_1KM*SAMPLE_RATIO_QKM)
88 #define MAX_SCAN_SAMPLE MAX_FRAMES /* Obsolescent */
89 #define MAX_DETECTORS DETECTORS_1KM /* Obsolescent */
90 
91 #define MAX_IMPULSE_NUMBER 25
92 #define MAX_POLY_DEGREE 4
93 #define EA_SOURCE_SELECT_LUN 600280
94 #define VALIDATE_ORBIT_NO_LUN 600281
95 #define TERRAIN_CORRECT_LUN 600310
96 
97 /* Instrument model */
98 #define MAX_BAND_NUMBER 36
99 #define FIRST_BAND 30
100 #define LATCH_TO_CENTER 0.5
101 #define BASE_SAMPLES DETECTORS_1KM /* Obsolescent */
102 #define MAX_SAMPLES SAMPLE_RATIO_QKM /* Obsolescent */
103 #define ROLL 0
104 #define PITCH 1
105 #define YAW 2
106 #define POSITION 0
107 #define VELOCITY 3
108 #define ELEC_SIDES 2
109 
110 /* Input L1A data definitions */
111 #define ENCODER_LENGTH 78
112 #define SECTOR_LENGTH 40
113 #define ANCIL_LENGTH 64
114 #define NUM_L1A_QUALITY_FLAGS 4
115 #define NUM_L1A_SECTOR_VIEWS 6
116 
117 /* Flag values */
118 #define INVALID_INPUT_DATA 128
119 #define NO_ELLIPSE_INTERSECT 64
120 #define BAD_TERRAIN 32
121 #define NEAR_LIMB 4
122 #define INVALID_SENSOR_ANGLES 8
123 #define INVALID_SOLAR_ANGLES 8
124 #define TAI_FLAG 1.e10
125 #define TERRAIN_CORRECT "TRUE"
126 
127 /* Land/Water mask values. */
130  L_SMASK_FVALUE = (0x10000 + PGSd_DEM_NO_FILLVALUE)>>8};
131 /* That peculiar expression for L_SMASK_FVALUE has a value of 221. It is the
132  * actual value we find for the _FillValue attribute in the SDP Toolkit's DEM
133  * files. The expression given above reflects my best guess as to where that
134  * peculiar value came from.
135  * PGSd_DEM_NO_FILLVALUE (-8888) is the value that the SDP Toolkit DEM routines
136  * use for the Land/Water mask, apparently indicating that it was not supposed
137  * to have fill values. If someone called the appropriate HDF function to give
138  * it a fill value anyway, and used a 16 bit 2's complement big-endian integer
139  * with a value of -8888 to do so, that would explain why the actual value came
140  * out as 221. That's because an HDF _FillValue attribute is always of the same
141  * type as the SDS, and this SDS is stored as uint8, so that HDF routine would
142  * have looked only at the first byte of that integer.
143  */
144 
145 /* Fill values. */
146 #define LONG_FVALUE (-999.0)
147 #define LAT_FVALUE (-999.0)
148 #define HGHT_FVALUE (-32767)
149 #define SENSORZEN_FVALUE (-32767)
150 #define SENSORAZIM_FVALUE (-32767)
151 #define RANGE_FVALUE 0
152 #define SOLARZEN_FVALUE (-32767)
153 #define SOLARAZIM_FVALUE (-32767)
154 #define TEMP_FVALUE (-999.0)
155 #define THERMCORR_FVALUE (-999.0)
156 #define GFLAGS_FVALUE 255
157 #define HIRES_FVALUE (-128)
158 
159 /* DEM definitions */
160 #define MAX_DEM_ROWS 108
161 #define MAX_DEM_TILES 26410
162 #define MAX_DEM_HORIZONTAL 200
163 #define MAX_DEM_VERTICAL 200
164 #define NO_DEM_DATA (-1)
165 
166 /* DEM validation definitions */
167 /* Nominal values with about 10% margin, in m */
168 #define MIN_TERRAIN_HEIGHT (-450.0)
169 #define MAX_TERRAIN_HEIGHT 9600.0
170 
171 /* Mathematical constants (that should have been in ANSI math.h) */
172 #define PGS_PI 3.14159265358979323846
173 #define RAD2DEG (180.0/PGS_PI)
174 #define DEG2RAD (PGS_PI/180.0)
175 #define MAX_UINT16_VAL (0xFFFF)
176 
177 /* End of definitions */
178 
179 /* Structures */
180 /* Structure for bounding coordinate ECS core metadata (radians) */
181 typedef struct {
182  double northcoord; /* Northern-most granule bounding latitude */
183  double eastcoord; /* Eastern-most granule bounding longitude */
184  double southcoord; /* Southern-most granule bounding latitude */
185  double westcoord; /* Western-most granule bounding longitude */
186  double easthemi_ebc; /* Eastern-most granule bounding longitude
187  in the Eastern hemisphere. */
188  double easthemi_wbc; /* Western-most granule bounding longitude
189  in the Eastern hemisphere. */
190  double westhemi_ebc; /* Eastern-most granule bounding longitude
191  in the Western hemisphere. */
192  double westhemi_wbc; /* Western-most granule bounding longitude
193  in the Western hemisphere. */
195 
196 #endif
197 
@ SHALLOW_OCEAN
Definition: GEO_geo.h:128
@ SHALLOW_INLAND
Definition: GEO_geo.h:128
@ NUM_LWMASK
Definition: GEO_geo.h:129
double westhemi_ebc
Definition: GEO_geo.h:190
@ CONTINENTAL
Definition: GEO_geo.h:129
double westhemi_wbc
Definition: GEO_geo.h:192
@ DRYLAND
Definition: GEO_geo.h:128
@ DEEP_OCEAN
Definition: GEO_geo.h:129
@ L_SMASK_FVALUE
Definition: GEO_geo.h:130
double westcoord
Definition: GEO_geo.h:185
@ DEEP_INLAND
Definition: GEO_geo.h:128
@ EPHEMERAL
Definition: GEO_geo.h:128
double easthemi_ebc
Definition: GEO_geo.h:186
double southcoord
Definition: GEO_geo.h:184
double eastcoord
Definition: GEO_geo.h:183
double easthemi_wbc
Definition: GEO_geo.h:188
@ COAST
Definition: GEO_geo.h:128
double northcoord
Definition: GEO_geo.h:182