OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
SC_scan.h
Go to the documentation of this file.
1 #ifndef SC_SCAN_H
2 #define SC_SCAN_H
3 
4 /*
5 !C-INC************************************************************************
6 
7 !Description: This include file contains the definition of the modis_scan
8  structures. This includes the Scan Data structure (section
9  4 of the MODIS Level 1A Data Product Format) and the Pixel
10  Quality Data structure (section 3 of the MODIS Level 1A Data
11  Product Format).
12 
13  All definitions in this file will begin with "SC_".
14 
15 !Input Parameters:
16  N/A
17 
18 !Output Parameters:
19  N/A
20 
21 Return Values:
22  N/A
23 
24 Externally Defined:
25  PD_DN_NUM_250M_DETECTORS (PD_pkt_data.h)
26  PD_DN_NUM_250M_BANDS (PD_pkt_data.h)
27  PD_DN_BAND_RATIO_250M (PD_pkt_data.h)
28  PD_DN_NUM_500M_DETECTORS (PD_pkt_data.h)
29  PD_DN_NUM_500M_BANDS (PD_pkt_data.h)
30  PD_DN_BAND_RATIO_500M (PD_pkt_data.h)
31  PD_DN_NUM_1KMDAY_DETECTORS (PD_pkt_data.h)
32  PD_DN_NUM_1KMDAY_BANDS (PD_pkt_data.h)
33  PD_DN_BAND_RATIO_1KM (PD_pkt_data.h)
34  PD_DN_NUM_1KMNIGHT_DETECTORS (PD_pkt_data.h)
35  PD_DN_NUM_1KMNIGHT_BANDS (PD_pkt_data.h)
36  PD_DN_BAND_RATIO_1KM (PD_pkt_data.h)
37  PD_E1P1_NUM_FPA_DCR_OFFSETS (PD_pkt_data.h)
38  PD_E1P2_NUM_EARTH_ENCODER_TIMES (PD_pkt_data.h)
39  PD_E1P2_NUM_VIEW_SECTOR_DEFINITIONS (PD_pkt_data.h)
40  PD_E1P2_NUM_VIEW_SECTOR_ACTUALS (PD_pkt_data.h)
41  PD_E2P1_NUM_HK_TELEM_BYTES (PD_pkt_data.h)
42  PD_E2P1_NUM_SC_ANCIL_WORDS (PD_pkt_data.h)
43  PD_E2P1_NUM_PARAM_BYTES (PD_pkt_data.h)
44  PD_E2P2_NUM_PV_GAINS (PD_pkt_data.h)
45  PH_MOD_SOURCE_ID_EARTH_FRAME_CNT_LIMIT (PH_pkt_hdr.h)
46  PH_MOD_SOURCE_ID_CAL_FRAME_CNT_MAX (PH_pkt_hdr.h)
47  PH_MOD_FPA_AEM_CONFIG_NUM_ELEMENTS (PH_pkt_hdr.h)
48  PH_SEC_PKT_TYPE_MAX_PKTS_IN_GROUP (PH_pkt_hdr.h)
49  int8 (hdfi.h)
50  int16 (hdfi.h)
51 
52 Called By:
53  N/A
54 
55 Routines Called:
56  N/A
57 
58 !Revision History:
59 $Log: SC_scan.h,v $
60 Revision 5.1 2004/09/30 18:54:46 seaton
61 Updated to run Collection 5 L1A code.
62 seaton@saicmodis.com
63 
64 
65  Revision 3.0 2001/04/13
66  John Seaton SAIC/GSC
67  Changed raw_mir_enc from int16 to uint16
68  DDTS GSFcd02139
69 
70  Revision 2.1 2000/07/05
71  John Seaton/SAIC/GSC (seaton@ltpmail.gsfc.nasa.gov)
72  Added SC_SCAN_PROC_STATE_t type for split scan fix.
73  DDTS MODx101733
74 
75  Revision 2.0 1997/07/09 14:15
76  Tom Johnson/SAIC/GSC (johnson@ltpmail.gsfc.nasa.gov)
77  Created include file from Version 1 include file
78  modis_scan.h for Version 2
79 
80  Revision 1.0 1996/06/24 14:00 EDT
81  Keith Degnan/SAIC/GSC (keith.degnan@gsfc.nasa.gov)
82  Created the PDL for module
83 
84 !Team-unique Header:
85  This software is developed by the MODIS Science
86  Data Support Team (SDST) for the National Aeronautics
87  and Space Administration (NASA), Goddard Space Flight
88  Center (GSFC), under contract NAS5-32373.
89 
90 !References and Credits:
91  HDF portions developed at the National Center for
92  Supercomputing Applications at the University of Illinois
93  at Urbana-Champaign.
94 
95 !Design Notes:
96  The ".h" file below was specifically written for development
97  in C. Any other language choice may require reworking of the
98  ".h" file before coding can begin.
99 
100 !END**********************************************************************
101 */
102 
103 #include "PH_pkt_hdr.h"
104 #include "PD_pkt_data.h"
105 #include "hdfi.h"
106 
107 
108 /************************************************************************/
109 /* The following are the time offset percentages from the start of */
110 /* the scan (ie the SD start time). These percentages were */
111 /* calculated based on a scan rate of 1.477, but should apply no */
112 /* matter what the scan rate. Remember, these are only percentages */
113 /* and not the actual time between sectors. */
114 /************************************************************************/
115 
116 #define SC_SD_TIME_OFFSET_PERCENTAGE 0.0
117 #define SC_SRCA_TIME_OFFSET_PERCENTAGE 0.072742045
118 #define SC_BB_TIME_OFFSET_PERCENTAGE 0.13473934
119 #define SC_SV_TIME_OFFSET_PERCENTAGE 0.21849695
120 #define SC_EV_TIME_OFFSET_PERCENTAGE 0.34462424
121 
122 
123 #define SC_SCAN_RATE_TOLERANCE 0.05
124 
125 
126 /************************************************************************/
127 /* The following are the values of the instrument field of view (IFOV) */
128 /* pixel quality flags. */
129 /************************************************************************/
130 
131 #define SC_GOOD_PIXEL_PACKET 0
132 #define SC_MISSING_PACKET 1
133 #define SC_BAD_CHECKSUM_PACKET 2
134 #define SC_DISCARDED_PACKET 4
135 
136 
137 /************************************************************************/
138 /* The following are the default values */
139 /************************************************************************/
140 
141 #define SC_FILL_VALUE -1
142 #define TIME_FILL_VALUE -2E9
143 
144 /**********************************************************************/
145 
146 #define SC_NUM_SCI_ENG_BYTES_IN_SDS 224
147 
148 
149  /******************************************************************/
150  /* The following are the typedefs for calibration target arrays */
151  /******************************************************************/
152 
157 
162 
167 
172 
173 
174  /******************************************************************/
175  /* The following are the typedefs for earth target arrays */
176  /******************************************************************/
177 
182 
187 
192 
197 
198 
199  /******************************************************************/
200  /* The following is the data structure for the Scan Data */
201  /* (section 4 of the MODIS Level 1A Data Product Format */
202  /******************************************************************/
203 
204 typedef struct
205  {
206  /* SOLAR DIFFUSER SOURCE (SD) */
211 
212  /* SRCA CALIBRATION SOURCE (SRCA) */
217 
218  /* BLACK BODY SOURCE (BB) */
223 
224  /* SPACE VIEW SOURCE (SV) */
229 
230  /* EARTH VIEW SOURCE (EV) */
235 
236  /* Data from the engineering packets */
237 
241  int8 fpa_dcr_offset[PD_E1P1_NUM_FPA_DCR_OFFSETS];
245  int8 raw_sci_eng[SC_NUM_SCI_ENG_BYTES_IN_SDS];
246  int8 raw_hk_telem[PD_E2P1_NUM_HK_TELEM_BYTES];
248  int8 raw_param[PD_E2P1_NUM_PARAM_BYTES];
249  int8 raw_pv_gains[PD_E2P2_NUM_PV_GAINS];
250 
251  } SC_SCAN_DATA_t;
252 
253 
254 typedef struct
255  {
266 
268 
269 typedef struct
270  {
271  PGSt_double pkt_TAI_time;
274 
275 
276 #endif /* SC_SCAN_H */
277 
#define PD_DN_NUM_500M_BANDS
Definition: PD_pkt_data.h:97
integer, parameter int16
Definition: cubeio.f90:3
#define PD_DN_NUM_1KMDAY_BANDS
Definition: PD_pkt_data.h:106
SC_CAL_1KM_NIGHT SRCA_1km_night
Definition: SC_scan.h:216
#define PD_DN_NUM_250M_BANDS
Definition: PD_pkt_data.h:90
#define PD_DN_BAND_RATIO_500M
Definition: PD_pkt_data.h:96
int16 SC_EV_500M[PD_DN_NUM_500M_DETECTORS][PD_DN_NUM_500M_BANDS][PH_MOD_SOURCE_ID_EARTH_FRAME_CNT_LIMIT *PD_DN_BAND_RATIO_500M]
Definition: SC_scan.h:186
#define PH_SEC_PKT_TYPE_MAX_PKTS_IN_GROUP
Definition: PH_pkt_hdr.h:166
int16 SC_EV_250M[PD_DN_NUM_250M_DETECTORS][PD_DN_NUM_250M_BANDS][PH_MOD_SOURCE_ID_EARTH_FRAME_CNT_LIMIT *PD_DN_BAND_RATIO_250M]
Definition: SC_scan.h:181
int16 SC_EV_1KM_DAY[PD_DN_NUM_1KMDAY_DETECTORS][PD_DN_NUM_1KMDAY_BANDS][PH_MOD_SOURCE_ID_EARTH_FRAME_CNT_LIMIT *PD_DN_BAND_RATIO_1KM]
Definition: SC_scan.h:191
PGSt_double pkt_TAI_time
Definition: SC_scan.h:271
#define PD_E2P1_NUM_SC_ANCIL_WORDS
Definition: PD_pkt_data.h:152
int16 SC_CAL_500M[PD_DN_NUM_500M_DETECTORS][PD_DN_NUM_500M_BANDS][PH_MOD_SOURCE_ID_CAL_FRAME_CNT_MAX *PD_DN_BAND_RATIO_500M]
Definition: SC_scan.h:161
#define PD_DN_NUM_250M_DETECTORS
Definition: PD_pkt_data.h:91
int16 SC_CAL_250M[PD_DN_NUM_250M_DETECTORS][PD_DN_NUM_250M_BANDS][PH_MOD_SOURCE_ID_CAL_FRAME_CNT_MAX *PD_DN_BAND_RATIO_250M]
Definition: SC_scan.h:156
#define PD_E1P1_NUM_FPA_DCR_OFFSETS
Definition: PD_pkt_data.h:125
SC_CAL_500M SRCA_500m
Definition: SC_scan.h:214
#define PD_DN_NUM_500M_DETECTORS
Definition: PD_pkt_data.h:98
#define PH_MOD_SOURCE_ID_EARTH_FRAME_CNT_LIMIT
Definition: PH_pkt_hdr.h:195
#define PD_DN_NUM_1KMNIGHT_DETECTORS
Definition: PD_pkt_data.h:109
#define PD_E2P1_NUM_PARAM_BYTES
Definition: PD_pkt_data.h:154
#define PD_DN_NUM_1KMNIGHT_BANDS
Definition: PD_pkt_data.h:108
SC_CAL_1KM_DAY SD_1km_day
Definition: SC_scan.h:209
#define PH_MOD_SOURCE_ID_CAL_FRAME_CNT_MAX
Definition: PH_pkt_hdr.h:216
SC_CAL_1KM_NIGHT SV_1km_night
Definition: SC_scan.h:228
#define SC_NUM_SCI_ENG_BYTES_IN_SDS
Definition: SC_scan.h:146
SC_EV_500M EV_500m
Definition: SC_scan.h:232
#define PD_E1P2_NUM_VIEW_SECTOR_DEFINITIONS
Definition: PD_pkt_data.h:136
int8 science_abnormal
Definition: SC_scan.h:240
#define PD_E1P2_NUM_EARTH_ENCODER_TIMES
Definition: PD_pkt_data.h:134
SC_CAL_1KM_NIGHT SD_1km_night
Definition: SC_scan.h:210
SC_EV_1KM_DAY EV_1km_day
Definition: SC_scan.h:233
#define PD_DN_NUM_1KMDAY_DETECTORS
Definition: PD_pkt_data.h:107
#define PD_DN_BAND_RATIO_250M
Definition: PD_pkt_data.h:89
SC_CAL_1KM_NIGHT BB_1km_night
Definition: SC_scan.h:222
int8 sector_packet_count
Definition: SC_scan.h:272
#define PD_E1P2_NUM_VIEW_SECTOR_ACTUALS
Definition: PD_pkt_data.h:138
SC_CAL_1KM_DAY BB_1km_day
Definition: SC_scan.h:221
SC_CAL_250M SD_250m
Definition: SC_scan.h:207
SC_CAL_250M SRCA_250m
Definition: SC_scan.h:213
SC_CAL_1KM_DAY SV_1km_day
Definition: SC_scan.h:227
SC_CAL_500M SV_500m
Definition: SC_scan.h:226
int8 science_state
Definition: SC_scan.h:239
SC_CAL_1KM_DAY SRCA_1km_day
Definition: SC_scan.h:215
#define PD_E2P2_NUM_PV_GAINS
Definition: PD_pkt_data.h:163
#define PD_E2P1_NUM_HK_TELEM_BYTES
Definition: PD_pkt_data.h:149
int16 SC_EV_1KM_NIGHT[PD_DN_NUM_1KMNIGHT_DETECTORS][PD_DN_NUM_1KMNIGHT_BANDS][PH_MOD_SOURCE_ID_EARTH_FRAME_CNT_LIMIT *PD_DN_BAND_RATIO_1KM]
Definition: SC_scan.h:196
#define PH_MOD_FPA_AEM_CONFIG_NUM_ELEMENTS
Definition: PH_pkt_hdr.h:221
int16 SC_CAL_1KM_NIGHT[PD_DN_NUM_1KMNIGHT_DETECTORS][PD_DN_NUM_1KMNIGHT_BANDS][PH_MOD_SOURCE_ID_CAL_FRAME_CNT_MAX *PD_DN_BAND_RATIO_1KM]
Definition: SC_scan.h:171
SC_CAL_500M SD_500m
Definition: SC_scan.h:208
#define PD_DN_BAND_RATIO_1KM
Definition: PD_pkt_data.h:105
SC_CAL_500M BB_500m
Definition: SC_scan.h:220
SC_CAL_250M BB_250m
Definition: SC_scan.h:219
int16 SC_CAL_1KM_DAY[PD_DN_NUM_1KMDAY_DETECTORS][PD_DN_NUM_1KMDAY_BANDS][PH_MOD_SOURCE_ID_CAL_FRAME_CNT_MAX *PD_DN_BAND_RATIO_1KM]
Definition: SC_scan.h:166
SC_EV_1KM_NIGHT EV_1km_night
Definition: SC_scan.h:234
SC_CAL_250M SV_250m
Definition: SC_scan.h:225
SC_EV_250M EV_250m
Definition: SC_scan.h:231