OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
Granule.h
Go to the documentation of this file.
1 #ifndef GRANULE_H
2 #define GRANULE_H
3 
4 #include "PGS_SMF.h" /* define PGSt_SMF_status */
5 #include "hdf.h" /* contain prototype for hdf functions */
6 #include "mfhdf.h" /* contain prototype for hdf functions */
7 #include "HdfEosDef.h" /* contain prototype for eos hdf functions */
8 
9 #define MAX_NC_NAME H4_MAX_NC_NAME
10 #define MAX_VAR_DIMS H4_MAX_VAR_DIMS
11 
12 /*
13 !C-INC***********************************************************************
14 !Description: Public header file containing macros, structure definitions
15  and external function declarations.
16 
17 !Revision History:
18  $Log: Granule.h,v $
19  Revision 2.8 2011-04-07 14:41:29-04 xgeng
20  1. RSB &TEB uncertainty algorithm update; 2. The quadratic RSB RVS changed to 4th order.
21 
22  Revision 2.7 2010-11-15 10:19:05-05 xgeng
23  Defined a new fill value UNABLE_CALIBRATE_SI (65524); Added a new boolean member Electronic_Anomaly[MAX_NUM_SCANS] to structure QA_Common_t
24 
25  Revision 2.5 2009/08/27 14:29:45 xgeng
26  Fixed a bug for the Log message
27 
28 
29  Revision 6.0.0, December 12, 2007 Razor Issue #216
30  Added a new constant "DEAD_SUBFRAME_SI" for dead subframe
31  Added a new constant "NUM_HIGH_RESOLUTION DETECTORS"
32  Added a new constant "NUM_HIGH_RESOLUTION SUBFRAMES"
33  Added a new variable "dead_subframe_pixels" in L1B_granule_t
34  Added a new variable "num_dead_subframe_EV_data" in QA_Common_t
35  Xu Geng, SAIC GSO (xu.geng@saic.com)
36 
37  Revision 2.2 2006/10/30 15:02:17 ltan
38  Added parameter PGE02_Version. Changed for ANSI-C compliance. Correction for the generation of code change log.
39 
40  Revision 02.36, October 31, 2003 Razor Issue #195
41  Added ProcessingCenter to runtime parameters
42  Liqin Tan, SAIC GSO (ltan@saicmodis.com)
43 
44  Revision 02.35 March 26, 2003 Razor Issue #191
45  Changed name of dn_28 to dn_X for use with any emissive band.
46  Added band number to L1B_Scan structure type.
47  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
48 
49  Revision 02.34 October 2, 2002 Razor Issue #166
50  Removed include file "utsname" for use in determining PROCESSINGENVIRONMENT
51  (function "getenv" used instead)
52  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
53 
54  Revision 02.33 August 11, 2002 Razor Issue #166
55  Added include file "utsname" for use in determining PROCESSINGENVIRONMENT
56  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
57 
58  Revision 02.32 June 28, 2002 Razor Issue #161
59  Moved NUM_*_SUBSAMP definitions from Preprocess.h; added NUM_REFL_INDICES
60  Gwyn Fireman, SAIC-GSO <Gwyn.Fireman@gsfc.nasa.gov>
61 
62  Revision 02.31 April 16, 2002 Razor Issue #166
63  Added leading_granule_scan_gap and trailing_granule_scan_gap to
64  QA_Common_t
65  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
66 
67  Revision 02.30 March 21, 2002 Razor Issue #181
68  Added ProcessingEnvironment to runtime parameters
69  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
70 
71  Revision 02.29 March 19, 2002 Razor Issue #182
72  Applicable to MODIS/TERRA (PFM) processing only.
73  Added b26_fr_b5_scaled_corr to RSB_Cal_Coeff_t.
74  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
75 
76  Revision 02.28 March 10, 2002 Razor Issue #174
77  Added RVS tables to RSB_Cal_Coeff_t. Defined TEB_Cal_Coeff_t to hold
78  RVS tables.
79  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
80 
81  Revision 02.27 February 7, 2002 Razor Issue #180
82  Added flag TEB_B1_NOT_CALCULATED and counter for it in QA_Common.
83  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
84 
85  Revision 02.26 December 14, 2001
86  Changed MAX_*_TRACK_DIM parameters so that they are automatically determined
87  by MAX_NUM_SCANS.
88  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
89 
90  Revision 02.25 November 12, 2001 (Razor Issue #169)
91  Added boolean skip_night_hi_res to prototype for Close_L1B_Granule.
92  Added Write_Night_Mode_HiRes_Data to Run_Time_Parameters_t
93  Alice Isaacman (Alice.R.Isaacman.1@gsfc.nasa.gov), SAIC GSO
94 
95  Revision 02.24 November 6, 2001
96  Added MCST_LUT_Version to Run_Time_Parameters_t (Razor issue #167)
97  Alice Isaacman (Alice.R.Isaacman.1@gsfc.nasa.gov), SAIC GSO
98 
99  Revision 02.23 Sept. 28, 2001
100  Eliminated use of defined PI value due to conflict with SDP Toolkit 5.2.7
101  (PI was defined to be PGS_PI in any case) (Razor issue #168)
102  Alice Isaacman (Alice.R.Isaacman.1@gsfc.nasa.gov), SAIC GSO
103 
104  Revision 02.22 Feb 22, 2001, Issue 155
105  Added Run_Time_Parameters_t and Read_Run_Time_Parameters.
106  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
107 
108  Revision 02.21 Jan 29, 2001
109  Corrected variable names and simplified L1A_Scan_t.
110  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
111 
112  Revision 02.21 Dec. 5, 2000
113  Razor issue 147.
114  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
115 
116  Revision 02.20 Dec. 1, 2000
117  Added dn_28 to L1B_Scan_t
118  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
119 
120  Revision 02.19 October 29, 2000
121  Added new unusable data value for L > L_Max as per issue 139.
122  Added code for granule average QA values as per issue 140.
123  Added structure element to L1A_granule_t, Razor issue 142.
124  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
125 
126  Revision 02.18 September 21, 2000
127  Added counting num_rsb_at_night_scans as per issue 137.
128  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
129 
130  ... (many changes not logged) ...
131 
132  Revision 02.17 Nov 05, 1999
133  Change momos_t to RSB_Cal_Coeff_t and add new variables
134  Zhenying Gu (zgu@mcst.gsfc.nasa.gov)
135 
136  Revision 02.16 Sep 30, 1999
137  Made num_thermistor_outliers dimensioned [MAX_NUM_SCANS] in QA_Emiss_t
138  Jim Rogers (rogers@msct.gsfc.nasa.gov)
139 
140  Revision 02.15 May 13, 1999
141  Added band 26 section.
142  Jim Rogers (rogers@msct.gsfc.nasa.gov)
143 
144  Revision 02.14 Feb 22, 1999
145  Added macros INDEX_1000M_DAY and INDEX_1000M_NIGHT to allow clarity
146  uf usage elsewhere in the code.
147  Jim Rogers (rogers@msct.gsfc.nasa.gov)
148 
149  Revision 02.13 Feb 8, 1999
150  Moved definition of L1B_Scan_Metadata_t to L1B_SetupP.h since that structure
151  is local in scope to L1B_Setup.c
152  Jim Rogers (rogers@msct.gsfc.nasa.gov)
153 
154  Revision 02.12 Feb 2, 1999
155  Separated out parts belonging to L1B_Setup as part of the
156  process of separating L1B_Setup out into its own module.
157  Added L1B_BANDS_AT_RES as an external declaration.
158  Jim Rogers (rogers@msct.gsfc.nasa.gov)
159 
160  Revision 02.11 July 1998
161  Add Write_L1B_SI_UI() prototype
162  Zhenying Gu (zgu@ltpmail.gsfc.nasa.gov)
163 
164  Revision 02.10 April 13, 1998.
165  Removed the SUN_EARTH_DIST_ADJUST() and DAYS_IN_YEAR macros.
166  David Catozzi (cato@ltpmail.gsfc.nasa.gov)
167 
168  Revision 02.10 April 10, 1998.
169  Changed the L1A_granule_t's EVStartTime_TAIsecond, MirrorSide, and
170  ScanType from pointers to static arrays.
171  Removed the L1B_granule_t's SunAdj, EVStartTime_TAIday,
172  and EVStartTime_TAIyear.
173  Added momos_t variable to L1B_granule_t.
174  Removed the following from L1B_ScaleOffset_t:
175  rad_scale_RefSB
176  rad_offset_RefSB
177  refl_scale_RefSB
178  refl_offset_RefSB
179  (they're replaced by the momos_t)
180  David Catozzi (cato@ltpmail.gsfc.nasa.gov)
181 
182  Revision 02.10 April 1998
183  Added L1B_Scan_metadat_t structure.
184  Zhenying Gu (zgu@gscmail.gsfc.nasa.gov)
185 
186  Revision 02.10 April 1998.
187  Added the momos_t structure.
188  David Catozzi (cato@ltpmail.gsfc.nasa.gov)
189 
190  Revision 02.10 March 1998.
191  Add ADC, PCX and INT correction switch
192  Add emiss_band_index_t data structure
193  Shi-Yue Qiu (syqiu@ltpmail.gsfc.nasa.gov)
194 
195  Revision 02.00 March 1997.
196  Summarizes Geom_Param_Lib.h, Granule.h, L1A_to_L1B.h, ......
197  Zhidong Hao (hao@barebackride.gsfc.nasa.gov)
198 
199  Revision 01.01 1996/04/09
200  Updated to match Version 1 Design Document.
201  John Hannon(hannon@highwire.gsfc.nasa.gov)
202  Neal Devine(devine@ltpmail.gsfc.nasa.gov)
203  Joan Baden (baden@highwire.gsfc.nasa.gov)
204 
205  Revision 01.00 1993
206  Initial development
207  Geir E. Kvaran(geir@highwire.gsfc.nasa.gov)
208 
209  Revision 01.00 Nov. 1998
210  This is part of original Granule.h, L1B.h
211  Initial development
212  Zhenying Gu(zgu@mcst.gsfc.nasa.gov)
213 
214 !Team-unique Header:
215  This software is developed by the MODIS Characterization Support
216  Team (MCST)for the National Aeronautics and Space Administration,
217  Goddard Space Flight Center, under contract NAS5-32373.
218 
219 !References and Credits:
220  HDF portions developed at the National Center for Supercomputing
221  Applications at the University of Illinois at Urbana-Champaign.
222 
223 !Design Notes:
224 
225 1. L1A Granule. The L1A granule contains 4 HDF SDSs, each corresponding
226  to a group of MODIS bands:
227 
228  L1A SDS name MODIS bands
229  ------------ ---------------------------------------------------------
230  "XX_250m" 1,2
231  "XX_500m" 3,4,5,6,7
232  "XX_1km_day" 8,9,10,11,12,13lo,13hi,14lo,14hi,15,16,17,18,19
233  "XX_1km_night" 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36
234 
235  where:
236 
237  XX = SD (Solar Diffusor)
238  XX = SRCA (Spectro-Radiometric Calibration Assembly)
239  XX = BB (Black Body)
240  XX = SV (Space View)
241  XX = EV (Earth View)
242 
243  "lo" and "hi" refer to two different gain levels. Thus, 13lo and 13hi
244  are treated as different bands even though they have the same center
245  wavelegnth. Similarly for 14lo and 14hi. Thus, MODIS has 36 different
246  center wavelengths but 38 different "bands" of data.
247 
248  Within the code, we refer to the above L1A SDSs as 4 "resolutions", even
249  though the last two groups have the same resolution (1km). All SDSs are
250  present in one L1A granule HDF file. The logic implemented in
251  "Open_L1A_EV_SDS" is that each of the above SDSs must be present in the
252  L1A granule. If any is missing, then the function returns a
253  MODIS_F_READ_ERROR. The logic implemented in "Read_L1A_EV_Scan" (which
254  reads one scan) is that the "EV_1km_night" data are always read but the
255  other three are read only if the scan type is "DAY".
256 
257  Each L1A input granule covers a time period of approximately 5 minutes.
258  The actual number of scans will be either 203 or 204, depending on how a
259  scan fits into the granule (there are always whole scans in the granule).
260  Thus, the maximum number of scans that can occur in an L1A granule is 204.
261 
262 2. L1B Granules. The L1B EV granules group the MODIS bands slightly
263  differently than the above L1A SDSs. Band 26 (in the L1A "night" group)
264  is placed in the 1km reflective solar band (RefSB) group.
265 
266  L1B SDSs MODIS bands
267  ------------ ------------------------------------------------------
268  "EV_250_RefSB" 1,2
269  "EV_500_RefSB" 3,4,5,6,7
270  "EV_1KM_RefSB" 8,9,10,11,12,13lo,13hi,14lo,14hi,15,16,17,18,19,26
271  "EV_1KM_Emissive" 20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36
272 
273  The L1B SDSs are placed in three L1B output HDF files which are based on
274  resolution (see the file specifications). This includes aggregation of
275  the higher-resolution SDSs to a lower resolution.
276 
277  In the code, when we fill the L1B SDSs from the L1A data, there is logic
278  which specifically deals with MODIS band 26.
279 
280 3. Detectors. There are different numbers of detectors based on band
281  resolution. Also note that bands 13 and 14 also each have two sets
282  of detectors. In terms of the L1B SDSs:
283 
284  L1B SDSs # of detectors total in all bands of this res.
285  ---------- -------------- ------------------------------
286  "EV_250_RefSB" 40 80
287  "EV_500_RefSB" 20 100
288  "EV_1KM_RefSB" 10 150
289  "EV_1KM_Emissive" 10 160
290 
291  Thus, the total number of detectors is 490.
292 
293 4. Coordinate system:
294 
295  |---------------- ALONG SCAN ---------------->
296  |
297  | --------------------------------------
298  | --------------------------------------
299  | --------------------------------------
300  ALONG -------------- SCAN LINES ------------
301  TRACK --------------------------------------
302  | --------------------------------------
303  | --------------------------------------
304  | --------------------------------------
305  \|/ --------------------------------------
306 
307  For one sweep of the MODIS scan mirror, the number of scan lines generated
308  equals the number of detectors (which is dependent on band). The number of
309  samples generated along a scan line is also dependent on band (the 250m
310  bands being sampled at 0.25km IFOV, the 500m bands being sampled at 0.5km
311  IFOV and the 1km bands being sampled at 1km IFOV).
312 
313  Thus, for a given sweep of the mirror, 250m resolution bands have 4 times
314  the number of scan lines as 1km resolution bands since they have 4 times
315  the number of detectors. Similarly, for a given aperture width (such as
316  the earth view), 250m resolution bands have 4 times the number of samples
317  ("FRAMES") as 1km resolution bands.
318 
319  In the macros below, the following terminology is used:
320  "TRACK_DIM" refers to scan lines in the along-track direction
321  "FRAME_DIM" refers to samples in the along-scan direction.
322  "1km_FRAMES" refers to samples taken at the rate of 1km IFOV
323  "500m_FRAMES" refers to samples taken at the rate of 0.5km IFOV
324  "250m_FRAMES" refers to samples taken at the rate of 0.25km IFOV
325 
326 5. Aperture widths. The following table relates the basic aperture widths
327  in terms of 1km frames:
328 
329  Aperture acronym # 1km_frames
330  ---------- ------- ------------
331  earth view EV 1354
332  space view SV 50
333  black body BB 50
334  SRCA SRCA 10
335  solar diffuser SD 50
336 
337 !END***********************************************************************
338 */
339 
340 /***************************************************************************
341 Band/Detector/Frame Geometry constants
342 --------------------------------------
343  MAX_NUM_SCANS Maximum number of scans in one 5-minute granule.
344  NUM_BANDS Number of bands (see note 1 above).
345  NUM_DETECTORS Total number of detectors for all bands.
346  NUM_HIGH_RESOLUTION_DETECTORS Total number of detectors in 250m and 500m bands.
347  NUM_HIGH_RESOLUTION_SUBFRAMES Total number of subframes in 250m and 500m bands.
348  NUM_REFLECTIVE_DETECTORS Total number of detectors for the L1B reflective
349  solar bands (RefSB).
350  NUM_EMISSIVE_DETECTORS Total number of detectors for the L1B emissive
351  bands (16 emissive bands, 10 detectors each).
352  NUM_MIRROR_SIDES Number of mirror sides (2).
353  NUM_250M_BANDS Number of 250m-resolution bands (2).
354  NUM_500M_BANDS Number of 500m-resolution bands (5).
355  NUM_1000M_REFL_BANDS Number of L1B reflective solar bands that have
356  1km resolution.
357  NUM_REFLECTIVE_BANDS Total number of L1B reflective solar bands. This
358  is the sum of NUM_250M_BANDS, NUM_500M_BANDS and
359  NUM_1000M_REFL_BANDS.
360  NUM_1000M_EMISS_BANDS Number of L1B 1km-resolution emissive bands.
361  Since all emissive bands are 1km-resolution bands,
362  this macro means the same as the one below.
363  NUM_EMISSIVE_BANDS Number of L1B emissive bands.
364  NUM_1000M_DAY_BANDS Number of bands in the "EV_1km_day" L1A SDS.
365  NUM_1000M_NIGHT_BANDS Number of bands in the "EV_1km_night" L1A SDS.
366  DETECTORS_PER_1KM_BAND Number of detectors in any 1km-resolution band.
367  DETECTORS_PER_500M_BAND Number of detectors in any 500m-resolution band.
368  DETECTORS_PER_250M_BAND Number of detectors in any 250m-resolution band.
369  NUM_1KM_SUBSAMP Number of subsamples per frame in any
370  1km-resolution band.
371  NUM_500M_SUBSAMP Number of subsamples per frame in any
372  500m-resolution band.
373  NUM_250M_SUBSAMP Number of subsamples per frame in any
374  250m-resolution band.
375  NUM_REFL_INDICES Total number of valid reflective
376  band/detector/subframe/mirror side combinations.
377  MODIS_BAND26_INDEX For the set of 38 bands of this code (indexed 0
378  through 37), this is the index for MODIS band 26.
379  MODIS_BAND26_INDEX_AT_RES For the set of 17 L1A 1km night bands (indexed
380  0 through 16), this is the index corresponding to
381  MODIS band 26.
382  MODIS_BAND20_INDEX For the set of 38 bands of this code (indexed 0
383  through 37), this is the index for MODIS band 20.
384  MAX_250M_TRACK_DIM Maximum number of scan lines spanning the along-
385  track dimension of the entire granule for any 250m
386  resolution band. This equals the maximum number of
387  scans times the number of detectors for 250m
388  resolution).
389  MAX_500M_TRACK_DIM Maximum number of scan lines for any 500m
390  resolution band.
391  MAX_1KM_TRACK_DIM Maximum number of scan lines for any 1km
392  resolution band.
393  MAX_SWIR_TRACK_DIM Maximum number of scan lines for any SWIR band.
394  MAX_250M_OBC_FRAME_DIM Maximum number of 1km frames in any of the OBC
395  data sets (50) times the number of subsamples per
396  frame for a 250m-resolution band (4)
397  MAX_500M_OBC_FRAME_DIM Maximum number of 1km frames in any of the OBC
398  data sets (50) times the number of subsamples per
399  frame for a 500m-resolution band (2)
400  MAX_1KM_OBC_FRAME_DIM Maximum number of 1km frames in any of the OBC
401  data sets (50).
402  SRCA_250M_FRAME_DIM Number of 1km frames for the SRCA data sets (10)
403  times the number of subsamples per frame for a
404  250m-resolution band (4).
405  SRCA_500M_FRAME_DIM Number of 1km frames for the SRCA data sets (10)
406  times the number of subsamples per frame for a
407  500m-resolution band (2).
408  SRCA_1KM_FRAME_DIM Number of 1km frames for the SRCA data sets (10).
409  TOTAL_1km_FRAMES Total number of EV, SV, BB, SRCA and SD 1km frames.
410  EV_1km_FRAMES Number of earth view 1km frames.
411  EV_250m_FRAMES Number of earth view 250m frames
412  (EV_1km_FRAMES * 4).
413  EV_500m_FRAMES Number of earth view 500m frames
414  (EV_1km_FRAMES * 2).
415  SD_1km_FRAMES Number of solar diffusor 1km frames.
416  SRCA_1km_FRAMES Number of SRCA 1km frames.
417  BB_1km_FRAMES Number of black-body 1km frames.
418  SV_1km_FRAMES Number of space view 1km frames.
419  NADIR_1km_FRAME_NUM The 1km frame number nominally desginated as
420  the center frame number of the earth-view window.
421  MAX_DETECTORS_PER_BAND Maximum number of detectors in any band
422  (occurs in the 250m bands).
423  MAX_SAMPLES_PER_BAND Maximum number of subsamples in a 1km frame for
424  any band (occurs in the 250m bands).
425 ****************************************************************************/
426 #define NUM_SCANS_DIM_NAME "nscans"
427 
428 /* Normally MAX_NUM_SCANS should be 204. However, the number of scans could
429  * reach 208 due to a L1A abnormality. So, define it to be 208.
430  */
431 
432 #define MAX_NUM_SCANS 1000
433 #define NUM_BANDS 38
434 #define NUM_DETECTORS 490
435 #define NUM_HIGH_RESOLUTION_DETECTORS 180
436 #define NUM_HIGH_RESOLUTION_SUBFRAMES 520
437 #define NUM_REFLECTIVE_DETECTORS 330
438 #define NUM_EMISSIVE_DETECTORS 160
439 #define NUM_MIRROR_SIDES 2
440 #define NUM_250M_BANDS 2
441 #define NUM_500M_BANDS 5
442 #define NUM_1000M_REFL_BANDS 15
443 #define NUM_REFLECTIVE_BANDS 22
444 #define NUM_1000M_EMISS_BANDS 16
445 #define NUM_EMISSIVE_BANDS 16
446 #define NUM_1000M_DAY_BANDS 14
447 #define NUM_1000M_NIGHT_BANDS 17
448 #define DETECTORS_PER_1KM_BAND 10
449 #define DETECTORS_PER_500M_BAND 20
450 #define DETECTORS_PER_250M_BAND 40
451 #define NUM_1KM_SUBSAMP 1
452 #define NUM_500M_SUBSAMP 2
453 #define NUM_250M_SUBSAMP 4
454 #define NUM_REFL_INDICES 1340
455 #define MODIS_BAND5_INDEX 4
456 #define MODIS_BAND26_INDEX 27
457 #define MODIS_BAND26_INDEX_AT_RES 6
458 #define MODIS_BAND20_INDEX 21
459 
460 #define L1B_1KM_EMISS_BAND28_INDEX 7 /* emissive band group */
461 
462 /* The four macros below are related to the macro MAX_NUM_SCANS. */
463 
464 #define MAX_250M_TRACK_DIM MAX_NUM_SCANS*DETECTORS_PER_250M_BAND /* 8320 */ /* 208 * 40 */
465 #define MAX_500M_TRACK_DIM MAX_NUM_SCANS*DETECTORS_PER_500M_BAND /* 4160 */
466 #define MAX_1KM_TRACK_DIM MAX_NUM_SCANS*DETECTORS_PER_1KM_BAND /* 2080 */
467 #define MAX_SWIR_TRACK_DIM MAX_NUM_SCANS*DETECTORS_PER_500M_BAND /* 4160 */
468 
469 #define MAX_250M_OBC_FRAME_DIM 200 /* 50 * 4 */
470 #define MAX_500M_OBC_FRAME_DIM 100 /* 50 * 2 */
471 #define MAX_1KM_OBC_FRAME_DIM 50
472 #define SRCA_250M_FRAME_DIM 40 /* 10 * 4 */
473 #define SRCA_500M_FRAME_DIM 20
474 #define SRCA_1KM_FRAME_DIM 10
475 #define SD_1km_FRAMES 50
476 #define SRCA_1km_FRAMES 10
477 #define BB_1km_FRAMES 50
478 #define SV_1km_FRAMES 50
479 #define EV_1km_FRAMES 1354
480 #define EV_250m_FRAMES 5416
481 #define EV_500m_FRAMES 2708
482 #define TOTAL_1km_FRAMES 1514
483 #define NADIR_1km_FRAME_NUM 677
484 #define MAX_DETECTORS_PER_BAND 40
485 #define MAX_SAMPLES_PER_BAND 4
486 
487 
488 /* Three correction switch in Emissive Band */
489 typedef enum { OFF, ON } switch_t ;
490 
491 #define SCAN_TYPE_TEXT_SIZE 10
492 #define COMMON_TEXT_SIZE 10
493 #define MAX_ERROR_MESSAGE_LENGTH 1024
494 
495 #define NUM_BB_THERMISTORS 12
496 #define NUM_FOCAL_PLANES 4
497 
498 #define SCAN_QUALITY_ARRAY_NUM_ELEMENTS 4
499 
500 #define PGS_PI 3.14159265358979323846
501 
502 #define PGS_EXP 2.7182818284590452354
503 
504 #define SAME 0 /*Used with strcmp()*/
505 
506 /*
507  * Macros for L1B sector DNs, to be used with the Check_Valid_Range
508  * function. Note that the HDF default is currently used in the
509  * L1A code (does not comply with file specs, but we must allow it).
510  * L1A_DN_SDS_LB -- lower bound
511  * L1A_DN_SDS_UB -- upper bound
512  * L1A_DN_SDS_FV -- fill value
513  * These are strings since that is the interface to Check_Valid_Range.
514  */
515 
516 #define L1A_DN_SDS_LB "-1"
517 #define L1A_DN_SDS_UB "4095"
518 #define L1A_DN_SDS_FV "-32767" /* HDF default */
519 
520 #define HDF_DEFAULT_FILLVALUE -32767
521 #define SATURATED_DN 4095
522 
523 #define MISSING_L1B_DATA 65535
524 #define MISSING_L1B_UI 255
525 #define MISSING_L1A_FLAG -1
526 
527 #define L1A_SCAN_DATA_MISSING_SI 65535
528 #define L1A_DN_MISSING_SI 65534
529 #define SATURATED_DETECTOR_SI 65533
530 #define ZERO_POINT_DN_SI 65532
531 #define DEAD_DETECTOR_SI 65531
532 #define RSB_DN_STAR_BELOW_MIN_SI 65530
533 #define TEB_OR_RSB_GT_MAX_SI 65529
534 #define AGGREGATION_FAIL_SI 65528
535 #define SECTOR_ROTATION_SI 65527
536 #define TEB_B1_NOT_CALCULATED 65526
537 #define DEAD_SUBFRAME_SI 65525
538 #define UNABLE_CALIBRATE_SI 65524
539 #define UNRESCALED_HIGH_SI 65521
540 #define RESCALED_L1B_SI 65520
541 #define NAD_CLOSED_UPPER_SI 65500
542 #define L1A_SCAN_DATA_MISSING_UI 255
543 #define BAD_DATA_UI 15
544 
545 #define TOLERANCE 1.0E-20 /* defined zero */
546 
547 #define True 1
548 #define False 0
549 
550 /* Focal Plane Indices */
551 
552 #define VIS 0
553 #define NIR 1
554 #define SWIR 2
555 #define LWIR 3
556 
557 /* satellite ID */
558 
559 #define TERRA 0
560 #define AQUA 1
561 #define INVALID_SATELLITE_ID -1
562 
563 /* MOD_PR02 exit code */
564 
565 extern int32 MOD_PR02_Failure_Exit_Code;
566 
567 /*****************************************************************************
568  The following defines macros for the number of L1A or L1B "resolutions" (or
569  groupings of bands) and the indices representing the ordering of the
570  resolutions in arrays. Even though INDEX_1000M_DAY and INDEX_1000M_REFL are
571  both the same value, they represent different band groupings because of
572  MODIS band 26 (see earlier comments). Currently, the code uses these macros
573  somewhat inconsistently, so beware. Similar comments apply to
574  INDEX_1000M_NIGHT and INDEX_1000M_EMISS.
575  *****************************************************************************/
576 typedef int8 boolean;
577 
578 typedef enum {
585 #define INDEX_1000M_REFL INDEX_1000M_DAY
586 #define INDEX_1000M_EMISS INDEX_1000M_NIGHT
587 
588 /*****************************************************************************
589  The following defines macros for the number of earth-view products generated
590  and indices for each product.
591  *****************************************************************************/
592 
593 typedef enum {
599 
600 /***************************************************************************
601  L1B_BANDS_AT_RES Number of bands in each L1B "resolution"
602  (group of bands -- see notes at top)
603  L1A_BANDS_AT_RES Number of bands in each L1A "resolution"
604  (group of bands -- see notes at top)
605  DETECT_PER_BAND_AT_RES Number of detectors in any band of the 4 different
606  "resolutions" (same for both L1A and L1B even though
607  the "groupings" are defined slightly differently).
608  BAND_RATIO_AT_RES This is the ratio of the #samples at a resolution to
609  the number of samples at a 1km resolution (also the
610  ratio of the number of detectors relative to the
611  number of detectors for a 1km resolution band).
612  Same for both L1A and L1B "resolutions".
613  **************************************************************************/
615 
617 
619 
621 
623 
624 typedef enum {
642 
643 typedef enum {
651 
652 typedef enum {
656 
657 /******************************************************************************
658  * Define macros for granule average quantities.
659  *
660  * NOTE 1: the code uses loops when assigning some of these quantities.
661  * In particular, the number and order of BB, INS, CAV and RC temperatures
662  * must match the arrays defined in Temperatures_t in PreprocessP.h
663  * and the calculations in Read_Convert_Temperatures.
664  * Consequently, these cannot be arbitrarily rearranged without inspecting
665  * and possibly changing the code.
666  *
667  * NOTE 2: some elements of "granule_averages" (a structure member in
668  * QA_Common_t) are unused. This variable is currently
669  * initialized in Calculate_Temp_QA, where all non-zero values
670  * are assigned. The initialization sets the unused elements to zero.
671  * If other granule averages are added, then the location of the
672  * initialization may need to be changed.
673  */
674 
675 typedef enum {
676  GRAN_AVG_TP_BB_TEMP01, /* BB Thermistor 1 */
677  GRAN_AVG_TP_BB_TEMP02, /* BB Thermistor 2 */
678  GRAN_AVG_TP_BB_TEMP03, /* BB Thermistor 3 */
679  GRAN_AVG_TP_BB_TEMP04, /* BB Thermistor 4 */
680  GRAN_AVG_TP_BB_TEMP05, /* BB Thermistor 5 */
681  GRAN_AVG_TP_BB_TEMP06, /* BB Thermistor 6 */
682  GRAN_AVG_TP_BB_TEMP07, /* BB Thermistor 7 */
683  GRAN_AVG_TP_BB_TEMP08, /* BB Thermistor 8 */
684  GRAN_AVG_TP_BB_TEMP09, /* BB Thermistor 9 */
685  GRAN_AVG_TP_BB_TEMP10, /* BB Thermistor 10 */
686  GRAN_AVG_TP_BB_TEMP11, /* BB Thermistor 11 */
687  GRAN_AVG_TP_BB_TEMP12, /* BB Thermistor 12 */
688  GRAN_AVG_TA_AO_VIS_FPAE, /* (FPA1) VIS Focal Plane */
689  GRAN_AVG_TA_AO_NIR_FPAE, /* (FPA2) NIR Focal Plane */
690  GRAN_AVG_TA_RC_SMIR_CFPAE, /* (FPA3) SMIR Focal plane Temp */
691  GRAN_AVG_TA_RC_LWIR_CFPAE, /* (FPA4) LWIR Focal plane Temp */
692  GRAN_AVG_TP_SA_RCT1_MIRE, /* Scan Mirror Temp 1 */
693  GRAN_AVG_TP_SA_RCT2_MIRE, /* Scan Mirror Temp 2 */
694  GRAN_AVG_TP_SA_A_MTR, /* Scan motor temperature A */
695  GRAN_AVG_TP_MF_CALBKHD_SR, /* (CAV1) Cal bulkhead below SRCA mount */
696  GRAN_AVG_TP_SR_SNOUT, /* (CAV2) SRCA Bulkhead Temp */
697  GRAN_AVG_TP_MF_Z_BKHD_BB, /* (CAV3) Mid zenith bulkhead near BB */
698  GRAN_AVG_TP_MF_CVR_OP_SR, /* (CAV4) cover opposite SRCA */
699  GRAN_AVG_TP_AO_SMIR_OBJ, /* (INS1) SMIR Objective Lens Temp */
700  GRAN_AVG_TP_AO_LWIR_OBJ, /* (INS2) LWIR Objective Lens Temp */
701  GRAN_AVG_TP_AO_SMIR_LENS, /* (INS3) SMIR Eye Assy Temp */
702  GRAN_AVG_TP_AO_LWIR_LENS, /* (INS4) LWIR Eye Assy Temp */
703  GRAN_AVG_TA_RC_CS, /* (RC1) Cold stage Temp */
704  GRAN_AVG_TA_RC_CS_OG, /* (RC2) Cold stage outgas Temp */
705  GRAN_AVG_TA_RC_IS, /* (RC3) Intermediate Stage Temp */
706  GRAN_AVG_TA_RC_IS_OG, /* (RC4) Intermediate Stage outgas Temp */
707  GRAN_AVG_TA_RC_OS_OG, /* (RC5) Outerstage outgas Temp */
708  GRAN_AVG_VR_RC_LW_FPA_HTR, /* LWIR heater voltage */
711 
712 /* Define the dimension of the attribute. Unused elements are set to
713  * zero within the attribute.
714  */
715 
716 #define MAX_NUM_GRAN_AVERAGES 50
717 
718 /* Define the number of RC values in the above definition. This value
719  * is also used in Preprocess when calculating and temporarily storing
720  * the temperatures.
721  */
722 
723 #define NUM_T_RC_VALUES 5
724 
725 /* Define a bad value for voltages
726  */
727 
728 #define VOLTAGE_BAD_VALUE -1000.
729 
730 /***************************************************************************/
731 
732 /*--------------------------------------------------------------------------
733  Data Structures
734 --------------------------------------------------------------------------*/
735 
736  /* Upper bound on length of ProcessingEnvironment archive
737  * metadata item
738  */
739 
740 #define MAX_PROCESSING_ENVIRONMENT_STRLEN 200
741 
742 #define MAX_RUNTIME_PARAM_SIZE 256
743 
744 typedef struct {
745  char SatelliteInstrument[MAX_RUNTIME_PARAM_SIZE];
746  char ReprocessingPlanned[MAX_RUNTIME_PARAM_SIZE];
748  char PGE02_Version[MAX_RUNTIME_PARAM_SIZE];
749  char MCST_LUT_Version[MAX_RUNTIME_PARAM_SIZE];
750  char Write_Night_Mode_HiRes_Data[MAX_RUNTIME_PARAM_SIZE];
751  char ProcessingEnvironment[MAX_RUNTIME_PARAM_SIZE];
752  char ProcessingCenter[MAX_RUNTIME_PARAM_SIZE];
754 
755 typedef struct {
756  int32 v_id;
757  int32 sd_id;
758  int32 satellite_id;
759  int32 num_scans;
760  int32 num_day_scans;
761  int16 MirrorSide[MAX_NUM_SCANS];
762  char ScanType[MAX_NUM_SCANS][SCAN_TYPE_TEXT_SIZE];
763  float64 EVStartTime_TAIsecond[MAX_NUM_SCANS];
764  int32 scan_quality[MAX_NUM_SCANS][SCAN_QUALITY_ARRAY_NUM_ELEMENTS];
765  float64 data_collection_time;
766 
767  /* For L1B metadata */
768 
769  int32 num_night_scans;
770  int32 incomplete_scans;
771  int32 max_ev_frames;
772  int32 Extract_Pixel_Offset;
773  int32 Extract_Pixel_Count;
774  int32 Extract_Line_Offset;
775  int32 Extract_Line_Count;
776 
777  /* For identifying completely missing scans */
778 
779  boolean missing_scan[MAX_NUM_SCANS];
780 
781  } L1A_granule_t;
782 
783 typedef struct
784 {
785  int32 sds_id[NUM_L1A_RESOLUTIONS];
786 
789  [EV_250m_FRAMES];
790 
793  [EV_500m_FRAMES];
794 
795  int16 EV_1km_day [DETECTORS_PER_1KM_BAND]
797  [EV_1km_FRAMES];
798 
799  int16 EV_1km_night[DETECTORS_PER_1KM_BAND]
801  [EV_1km_FRAMES];
802 } L1A_Scan_t;
803 
804 /* Level 1B scale_offset data */
805 
806 typedef struct {
807  float32 dn_star_Max[NUM_REFLECTIVE_BANDS];
808  float32 dn_star_Min[NUM_REFLECTIVE_BANDS];
809 
810  float32 rad_scale_RefSB[NUM_REFLECTIVE_BANDS];
811  float32 rad_offset_RefSB[NUM_REFLECTIVE_BANDS];
812  float32 refl_scale_RefSB[NUM_REFLECTIVE_BANDS];
813  float32 refl_offset_RefSB[NUM_REFLECTIVE_BANDS];
814 
815  float32 counts_scale_RefSB[NUM_REFLECTIVE_BANDS];
816  float32 counts_offset_RefSB[NUM_REFLECTIVE_BANDS];
817 
818  float32 rad_scale_Emiss[NUM_EMISSIVE_BANDS];
819  float32 rad_offset_Emiss[NUM_EMISSIVE_BANDS];
821 
822 
823 typedef struct
824 {
825  float32 m1_des_sq[NUM_REFLECTIVE_BANDS]
829 
830  float32 m1_des_sq_max[NUM_REFLECTIVE_BANDS];
831 
832  float32 RVS_250m[NUM_250M_BANDS]
836 
837  float32 RVS_500m[NUM_500M_BANDS]
841 
842  float32 RVS_1km_RefSB[NUM_1000M_REFL_BANDS]
844  [EV_1km_FRAMES]
846 
847  float32 u2[NUM_REFLECTIVE_DETECTORS]
848  [EV_1km_FRAMES]
849  [NUM_MIRROR_SIDES];
850 
852 
853 typedef struct {
854  float32 RVS_1km_Emiss_EV[NUM_EMISSIVE_DETECTORS]
855  [EV_1km_FRAMES]
857  float32 RVS_1km_Emiss_SV[NUM_EMISSIVE_DETECTORS]
859  float32 RVS_1km_Emiss_BB[NUM_EMISSIVE_DETECTORS]
861  float32 sigma_RVS_Emiss_EV[NUM_EMISSIVE_DETECTORS]
862  [EV_1km_FRAMES]
865 
866 typedef struct {
867  int32 sw_f_id[NUM_L1B_EV_FILES];
868  int32 v_id[NUM_L1B_EV_FILES];
869  int32 sd_id[NUM_L1B_EV_FILES];
870  int32 num_scans;
871  int32 num_day_scans;
872 
873  RSB_Cal_Coeff_t RSB_Cal_Coeff;
874  Emiss_Cal_Coeff_t Emiss_Cal_Coeff;
876 
877  float32 b26_fr_b5_scaled_corr[DETECTORS_PER_1KM_BAND];
878 
879  /* For L1B metadata */
880 
881  float32 validEVPercent[NUM_BANDS];
882  float32 satEVPercent[NUM_BANDS];
883  float32 missEVPercent[NUM_BANDS];
884  uint32 elecRedVec[2];
885  int8 FPSetPointState[NUM_FOCAL_PLANES];
886 
887  uint32 total_pixels[NUM_BANDS];
888  uint32 valid_pixels[NUM_BANDS];
889  uint32 saturated_pixels[NUM_BANDS];
890  uint32 missing_pixels[NUM_BANDS];
891  uint32 interpolated_pixels[NUM_BANDS];
892  uint32 dead_detector_pixels[NUM_BANDS];
893  uint32 dead_subframe_pixels[NUM_BANDS];
894  uint32 negative_value_below_noise_pixels[NUM_BANDS];
895  int16 bad_data_flag[NUM_BANDS];
896  float32 Earth_Sun_Dist;
897 } L1B_granule_t;
898 
899 typedef struct
900 {
901  uint16 EV_250m_RefSB [NUM_250M_BANDS]
903  [EV_250m_FRAMES];
904 
905  uint16 EV_500m_RefSB [NUM_500M_BANDS]
907  [EV_500m_FRAMES];
908 
909  uint16 EV_1km_RefSB [NUM_1000M_REFL_BANDS]
911  [EV_1km_FRAMES];
912 
913  uint16 EV_1km_Emissive[NUM_1000M_EMISS_BANDS]
915  [EV_1km_FRAMES];
916 } L1B_Scan_SI_t;
917 
918 typedef struct
919 {
920  uint8 EV_250m_RefSB_UI [NUM_250M_BANDS]
922  [EV_250m_FRAMES];
923 
924  uint8 EV_500m_RefSB_UI [NUM_500M_BANDS]
926  [EV_500m_FRAMES];
927 
928  uint8 EV_1km_RefSB_UI [NUM_1000M_REFL_BANDS]
930  [EV_1km_FRAMES];
931 
932  uint8 EV_1km_Emissive_UI[NUM_1000M_EMISS_BANDS]
934  [EV_1km_FRAMES];
935 } L1B_Scan_UI_t;
936 
937 /************************* Begin Band 26 Section **************************/
938 /*
939  * If the macro WRITE_BAND_26_SDS is defined, then the MODIS band 26 SDSs will
940  * be written to the EV 1km file. Two SDSs are written: (1) scaled integer,
941  * (2) uncertainty index. These are written regardless of whether the scan
942  * is day or night.
943  */
944 
945 /*** UNCOMMENT THE FOLLOW STATEMENT TO ENABLE WRITING BAND 26 SDS ***/
946 
947 #define WRITE_BAND_26_SDS
948 
949 #ifdef WRITE_BAND_26_SDS
950 
951 #define BAND_26_SI_SDS_NAME "EV_Band26"
952 #define BAND_26_UI_SDS_NAME "EV_Band26_Uncert_Indexes"
953 #define BAND_26_SI_SDS_LONG_NAME "Earth View Band 26 Scaled Integers"
954 #define BAND_26_UI_SDS_LONG_NAME "Earth View Band 26 Uncertainty Indexes"
955 
956 typedef struct {
957  int32 SI_sds_id;
958  int32 UI_sds_id;
961 } Band_26_t;
962 
963 #endif /* WRITE_BAND_26_SDS */
964 /************************** End Band 26 Section ***************************/
965 
966 typedef struct {
967 /*-------------------------
968  SI == Scaled Integer
969  UI == Uncert Index
970  SU == Samples Used
971 -------------------------*/
972  int32 SI_sds_id[NUM_L1A_RESOLUTIONS];
973  int32 EV_250m_Aggr500m_RefSB_sds_id;
974  int32 EV_250m_Aggr1km_RefSB_sds_id;
975  int32 EV_500m_Aggr1km_RefSB_sds_id;
976  int32 UI_sds_id[NUM_L1A_RESOLUTIONS];
977  int32 EV_250m_Aggr500m_RefSB_UI_sds_id;
978  int32 EV_250m_Aggr1km_RefSB_UI_sds_id;
979  int32 EV_500m_Aggr1km_RefSB_UI_sds_id;
980  int32 EV_250m_Aggr500m_RefSB_SU_sds_id;
981  int32 EV_250m_Aggr1km_RefSB_SU_sds_id;
982  int32 EV_500m_Aggr1km_RefSB_SU_sds_id;
984  /* uint16 ***SI[NUM_L1A_RESOLUTIONS];*/ /*[band][det][frame]*/
985  uint16 EV_250m_Aggr500m_RefSB [NUM_250M_BANDS]
987  [EV_500m_FRAMES];
988 
989  uint16 EV_250m_Aggr1km_RefSB [NUM_250M_BANDS]
991  [EV_1km_FRAMES];
992 
993  uint16 EV_500m_Aggr1km_RefSB [NUM_500M_BANDS]
995  [EV_1km_FRAMES];
996 
997  L1B_Scan_UI_t UI;
998 
999  /* uint8 ***UI[NUM_L1A_RESOLUTIONS];
1000  */ /*
1001  [band][det][frame]*/
1002  uint8 EV_250m_Aggr500m_RefSB_UI[NUM_250M_BANDS]
1004  [EV_500m_FRAMES];
1005 
1006  uint8 EV_250m_Aggr1km_RefSB_UI [NUM_250M_BANDS]
1008  [EV_1km_FRAMES];
1009 
1010  uint8 EV_500m_Aggr1km_RefSB_UI [NUM_500M_BANDS]
1012  [EV_1km_FRAMES];
1013 
1014  int8 EV_250m_Aggr500m_RefSB_SU[NUM_250M_BANDS]
1016  [EV_500m_FRAMES];
1017 
1018  int8 EV_250m_Aggr1km_RefSB_SU [NUM_250M_BANDS]
1020  [EV_1km_FRAMES];
1021 
1022  int8 EV_500m_Aggr1km_RefSB_SU [NUM_500M_BANDS]
1024  [EV_1km_FRAMES];
1025 
1026 /************************* Begin Band 26 Section **************************/
1027 #ifdef WRITE_BAND_26_SDS
1028 /*
1029  * This structure member holds arrays dimensioned appropriately for one
1030  * scan of the Band 26 SDSs.
1031  */
1032  Band_26_t Band26;
1033 #endif /* WRITE_BAND_26_SDS */
1034 /************************** End Band 26 Section ***************************/
1035 
1036  int16 band_X;
1037  float32 dn_X[DETECTORS_PER_1KM_BAND][EV_1km_FRAMES];
1038 } L1B_Scan_t;
1039 
1040 typedef struct
1041 {
1042  uint8 noise_T_bb[12];
1043  uint8 noise_T_bb_avg;
1044  uint8 noise_T_lwir;
1045  uint8 noise_T_mwir;
1046  uint8 noise_T_mir1;
1047  uint8 noise_T_mir2;
1048  uint8 noise_T_mir_avg;
1049  uint8 noise_T_ins;
1050  uint8 noise_T_cav;
1051  uint8 NEdL[NUM_EMISSIVE_DETECTORS]; /*noise in system*/
1052  uint8 change_b1[NUM_EMISSIVE_DETECTORS];
1053  uint8 num_thermistor_outliers[MAX_NUM_SCANS]; /* range [0-12] */
1054  int8 change_dc_restore[MAX_NUM_SCANS]
1057  int8 emiss_band_bad_data[NUM_EMISSIVE_BANDS];
1058  int8 moon_in_SV_KOB_TEB[MAX_NUM_SCANS];
1059 } QA_Emiss_t;
1060 
1061 typedef struct
1062 {
1063  uint8 noise_T_vis;
1064  uint8 noise_T_nir;
1065  int8 change_dc_restore_250m[MAX_NUM_SCANS][NUM_250M_BANDS]
1067  int8 change_dc_restore_500m[MAX_NUM_SCANS][NUM_500M_BANDS]
1069  int8 change_dc_restore_1km[MAX_NUM_SCANS][NUM_1000M_REFL_BANDS]
1071  int8 refl_band_bad_data[NUM_REFLECTIVE_BANDS];
1072  int8 moon_in_SV_KOB_RSB[MAX_NUM_SCANS];
1073  int8 all_SV_DN_bad[MAX_NUM_SCANS];
1074  int8 all_BB_DN_bad[MAX_NUM_SCANS];
1075 } QA_Refl_t;
1076 
1077 typedef struct
1078 {
1079  int8 all_l1b_error_flags_off;
1080  boolean missing_leading_granule; /* True or False */
1081  boolean missing_trailing_granule; /* True or False */
1082  boolean leading_granule_scan_gap; /* True or False */
1083  boolean trailing_granule_scan_gap; /* True or False */
1084  boolean NAD_Door_Open[MAX_NUM_SCANS];
1085  boolean Sector_Rotation[MAX_NUM_SCANS];
1086  boolean Electronic_Anomaly[MAX_NUM_SCANS];
1087  int32 num_missing_scans;
1088  int32 num_rsb_at_night_scans;
1089  int32 num_missing_data_in_scans[NUM_DETECTORS];
1090  int32 num_dead_detector_EV_data[NUM_DETECTORS];
1091  int32 num_dead_subframe_EV_data[NUM_HIGH_RESOLUTION_DETECTORS];
1092  int32 num_sector_rotation_EV_data[NUM_DETECTORS];
1093  int32 num_saturated_EV_data[NUM_DETECTORS];
1094  int32 num_no_bg_DN_EV_data[NUM_DETECTORS];
1095  int32 num_moon_in_SVP_TEB_EV_data[NUM_DETECTORS];
1096  int32 num_bad_dn_star_star_RSB_EV_data[NUM_DETECTORS];
1097  int32 num_exceed_max_for_scaling[NUM_DETECTORS];
1098  int32 num_nadir_door_closed_EV_data[NUM_DETECTORS];
1099  int32 num_negative_b1[NUM_DETECTORS];
1100  uint32 bit_QA_flags_last_value;
1101  uint32 bit_QA_flags_change;
1102  float32 granule_averages[MAX_NUM_GRAN_AVERAGES];
1103 } QA_Common_t;
1104 
1105 typedef struct
1106 {
1107  QA_Common_t QA_common;
1108  QA_Emiss_t QA_emiss;
1109  QA_Refl_t QA_refl;
1110 } QA_Data_t;
1111 
1112 /* 16 Bit Constants for Re-Scaling of Radiance */
1113 #define DN15_SAT 32767
1114 #define DN_MIN 0
1115 
1116 /************************ Error message utilities ************************/
1117 /*
1118  * The following are global values to use for the "other_msg" input to
1119  * L1BErrorMsg. These errors may occur many times.
1120  */
1121 
1122 extern char Invalid_MOD01_Msg[]; /* Invalid or out of bounds L1A data */
1123 
1124 /*
1125  * Function protos
1126  */
1127 int safe_strcat(
1128  char *buf, /* A character buffer that we want to concatenate to */
1129  char *str, /* The string to be concatenated */
1130  int buflen /* The known memory limitation of the character buffer */
1131 );
1132 
1133 void L1BErrorMsg(
1134  /* name of L1B function that error occurred in */
1135  char *L1B_location,
1136 
1137  /* associated error code for this error */
1138  PGSt_SMF_code code,
1139 
1140  /* short (usually 1-line) description of error */
1141  char *input_message,
1142 
1143  /* name of the associated function that failed */
1144  char *assoc_function,
1145 
1146  /* associated LUN for the file being accessed */
1147  int32 lun,
1148 
1149  /* other message to add such as probable cause */
1150  char *other_msg,
1151 
1152  /* flag to tell whether or not to call SMF_ERROR */
1153  boolean error_out
1154 
1155 );
1156 
1157 void SMF_ERROR
1158  (PGSt_SMF_code code,
1159  char *messagestring);
1160 
1161 void Bad_L1A_Error_Out
1162  (char *name,
1163  char *message);
1164 
1165 /********************** Other function Prototypes **************************/
1166 
1167 PGSt_SMF_status Read_Run_Time_Parameters
1168  (Run_Time_Parameters_t *runtime_params);
1169 
1170 PGSt_SMF_status Open_and_Read_L1A
1171  (Run_Time_Parameters_t *runtime_params,
1172  L1A_granule_t *L1A_Gran,
1173  boolean *skip_night_hi_res);
1174 
1175 
1176 PGSt_SMF_status Get_Satellite_ID
1177  (PGSt_PC_Logical lun,
1178  int32 *satellite_ID);
1179 
1180 
1181 PGSt_SMF_status Read_L1A_EV_Scan
1182  (int16 S,
1183  L1A_granule_t *L1A_Gran,
1184  L1A_Scan_t *L1A_Scan);
1185 
1186 
1187 PGSt_SMF_status Aggregate_L1B
1188  (L1B_Scan_t *L1B_Scan);
1189 
1190 
1191 PGSt_SMF_status Fill_Dead_Detector_SI
1192  (boolean isdaymode,
1193  int8 *dead_detector,
1194  L1B_Scan_t *L1B_Scan,
1195  L1B_granule_t *L1B_Gran,
1196  QA_Common_t *QA_Common);
1197 
1198 
1199 PGSt_SMF_status Write_L1B_EV_Scan
1200  (int16 S,
1201  L1B_granule_t *L1B_Gran,
1202  L1B_Scan_t *L1B_Scan,
1203  boolean isdaymode);
1204 
1205 
1206 PGSt_SMF_status Close_L1A_Granule
1207  (L1A_granule_t *L1A_Gran,
1208  L1A_Scan_t *L1A_Scan);
1209 
1210 
1211 PGSt_SMF_status Close_L1B_Granule
1212  (L1B_granule_t *L1B_Gran,
1213  L1B_Scan_t *L1B_Scan,
1214  boolean skip_night_hi_res);
1215 
1216 
1217 #endif
1218 
@ GRAN_AVG_TA_RC_CS
Definition: Granule.h:709
@ GRAN_AVG_TP_BB_TEMP08
Definition: Granule.h:689
integer, parameter int16
Definition: cubeio.f90:3
#define NUM_1000M_DAY_BANDS
Definition: Granule.h:446
@ SV_INDEX
Definition: Granule.h:637
@ Earth_Frames
Definition: Granule.h:620
#define NUM_BANDS
Definition: Granule.h:433
@ BAND35
Definition: Granule.h:644
@ SD_Frames
Definition: Granule.h:621
#define MAX_DETECTORS_PER_BAND
Definition: Granule.h:484
int16 BAND_RATIO_AT_RES[NUM_L1A_RESOLUTIONS]
Definition: Granule.c:73
===========================================================================V4.1.3 12/18/2002============================================================================Changes which do not affect scientific output:1. The R *LUT was eliminated and the equivalent formulation for R *, i.e. 1/(m1 *e_sun_over_pi), was substituted for it in the only instance of its use, which is in the calculation of the RSB uncertainty index. This reduces the size of the Reflective LUT HDF file by approximately 1/4 to 1/3. The equivalent formulation of R *differed from the new by at most 0.056% in test granules and uncertainty differences of at most 1 count(out of a range of 0-15) were found in no more than 1 in 100, 000 pixels. 2. In Preprocess.c, a small error where the trailing dropped scan counter was incremented when the leading dropped scan counter should have been was fixed. This counter is internal only and is not yet used for any purpose. 3. NEW MYD02OBC Metadata Configuration Files. MCST wishes to have the OBC files archived even when the Orbit Number is recorded as "-1". Accordingly, ECS has delivered new MCF files for OBC output having all elements in the OrbitCalculatedSpatialDomain container set to "MANDATORY=FALSE". 4. pgs_in.version is now reset to "1" in Metadata.c before the call to look up the geolocation gringpoint information.============================================================================V4.1.1 CODE SPECIFIC TO MODIS/AQUA(FM1) 10/03/2002============================================================================Two changes were made to the code which do not affect scientific output:1. A bug which caused PGE02 to fail when scans were dropped between granules was fixed.(The length of the error message generated was shortened.) 2. Messages regarding an invalid MCST LUT Version or an invalid Write High Resolution Night Mode Output value in the PCF file were added.==============================================================================V4.1.0 CODE SPECIFIC TO MODIS/AQUA(FM1)(NEVER USED IN PRODUCTION) 07/30/2002==============================================================================Changes which impact scientific output of code:1. The LUT type of the RVS corrections was changed to piecewise linear. In addition the RVS LUTs were changed from listing the RVS corrections to listing the quadratic coefficients necessary to make the RVS corrections. The coefficients are now calculated by interpolating on the granule collection time and the RVS corrections are then generated using the interpolated coefficients. Previously used Emissive and Reflective RVS LUT tables were eliminated and new ones introduced. Several changes were made to the code which should not affect scientific output. They are:1. The ADC correction algorithm and related LUTs were stripped from the code.(The ADC correction has always been set to "0" so this has no scientific impact.) 2. Some small changes to the code, chiefly to casting of variables, were added to make it LINUX-compatible. Output of code run on LINUX machines displays differences of at most 1 scaled integer(SI) from output of code run on IRIX machines. The data type of the LUT "dn_sat_ev" was changed to float64 to avoid discrepancies seen between MOD_PR02 run on LINUX systems and IRIX systems where values were flagged under one operating system but not the other. 3. Checking for non-functioning detectors, sector rotation, incalculable values of the Emissive calibration factor "b1", and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal.c since none of these quantities are frame-dependent. 4. The code was altered so that if up to five scans are dropped between the leading/middle or middle/trailing granules, the leading or trailing granule will still be used in emissive calibration to form a cross-granule average. QA bits 25 and 26 are set for a gap between the leading/middle and middle/trailing granules respectively. This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule. 5.(MODIS/AQUA ONLY) The name of the seed(error message) file was changed from "MODIS_36100.h" to "MODIS_36110.h". 6. Metadata.c was changed so that the source of the geolocation metadata is the input geolocation file rather than the L1A granule. 7. To reduce to overall size of the reflective LUT HDF files, fill values were eliminated from all LUTs previously dimensioned "BDSM"([NUM_REFLECTIVE_BANDS] *[MAX_DETECTORS_PER_BAND] *[MAX_SAMPLES_PER_BAND] *[NUM_MIRROR_SIDES]) in the LUT HDF files. Each table piece is stored in the HDF file with dimensions NUM_REFLECTIVE_INDICES, where NUM_REFLECTIVE_INDICES=[NUM_250M_BANDS *DETECTORS_PER_250M_BAND *SAMPLES_PER_250M_BAND *NUM_MIRROR_SIDES]+[NUM_500M_BANDS *DETECTORS_PER_500M_BAND *SAMPLES_PER_500M_BAND *NUM_MIRROR_SIDES]+[NUM_1000M_BANDS *DETECTORS_PER_1KM_BAND *SAMPLES_PER_1KM_BAND *NUM_MIRROR_SIDES] with SAMPLES_PER_250M_BAND=4, SAMPLES_PER_500M_BAND=2, and SAMPLES_PER_1KM_BAND=1. Values within each table piece appear in the order listed above. The overall dimensions of time dependent BDSM LUTs are now[NUM_TIMES] *[NUM_REFLECTIVE_INDICES], where NUM_TIMES is the number of time dependent table pieces. 8. Checking for non-functioning detectors, sector rotation, incalculable values of the Emissive calibration factor "b1", and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal.c since none of these quantities are frame-dependent. 9. The code was altered so that if up to five scans are dropped between the leading/middle or middle/trailing granules, the leading or trailing granule will still be used in emissive calibration to form a cross-granule average. QA bits 25 and 26 are set for a gap between the leading/middle and middle/trailing granules respectively. This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule. 10. The array of b1s in Preprocess.c was being initialized to -1 outside the loop over bands, which meant that if b1 could not be computed, the value of b1 from the previous band for that scan/detector combination was used. The initialization was moved inside the band loop.============================================================================V3.1.0(Original Aqua-specific code version) 02/06/2002============================================================================AQUA-Specific changes made:1. A correction to a problem with blackbody warmup on bands 33, 35, and 36 was inserted. PC Bands 33, 35, and 36 on MODIS Aqua saturate on BB warmup before 310K, which means current code will not provide correct b1 calibration coefficients when the BB temperatures are above the saturation threshold. A LUT with default b1s and band-dependent temperature thresholds will be inserted in code. If the BB temperature is over the saturation threshold for the band, the default b1 from the table is used. 2. The number of possible wavelengths in the Emissive LUT RSR file was changed to 67 in order to accommodate the Aqua RSR tables. 3. Several changes to the upper and lower bound limits on LUT values were inserted. Changes to both Aqua and Terra Code:1. A check was put into Emissive_Cal.c to see whether the value of b1 being used to calibrate a pixel is negative. If so, the pixel is flagged with the newly created flag TEB_B1_NOT_CALCULATED, value 65526, and the number of pixels for which this occurs is counted in the QA_common table. 2. The array of b1s in Preprocess.c was being initialized to -1 outside the loop over bands, which meant that if b1 could not be computed, the value of b1 from the previous band for that scan/detector combination was used. The initialization was moved inside the band loop. 3. Minor code changes were made to eliminate compiler warnings when the code is compiled in 64-bit mode. 4. Temperature equations were upgraded to be MODIS/Aqua or MODIS/Terra specific and temperature conversion coefficients for Aqua were inserted.========================================================================================================================================================ALL CHANGES BELOW ARE TO COMMON TERRA/AQUA CODE USED BEFORE 02/06/2002========================================================================================================================================================v3.0.1 11/26/2001============================================================================Several small changes to the code were made, none of which changes the scientific output:1. The code was changed so that production of 250m and 500m resolution data when all scans of a granule are in night mode may be turned off/on through the PCF file. 2. A check on the times of the leading and trailing granules was inserted. If a leading or trailing granule does not immediately precede or follow(respectively) the middle granule, it is treated as a missing granule and a warning message is printed. 3. The code now reads the "MCST Version Number"(e.g. "3.0.1.0_Terra") from the PCF file and checks it against the MCST Version number contained in the LUT HDF files. This was done to allow the user to make sure the code is being run using the correct LUT files.(The designators "0_Terra", "1_Terra", etc.) refer to the LUT versions.) 4. A small bug in Preprocess.c was corrected code
Definition: HISTORY.txt:661
int16 DETECT_PER_BAND_AT_RES[NUM_L1A_RESOLUTIONS]
Definition: Granule.c:68
#define DETECTORS_PER_1KM_BAND
Definition: Granule.h:448
@ GRAN_AVG_TP_BB_TEMP12
Definition: Granule.h:693
@ BAND29
Definition: Granule.h:644
@ Number_Of_Scans
Definition: Granule.h:616
@ BAND36
Definition: Granule.h:644
#define EV_250m_FRAMES
Definition: Granule.h:480
void Bad_L1A_Error_Out(char *name, char *message)
Definition: Granule.c:1616
@ INDEX_1000M_DAY
Definition: Granule.h:571
#define DETECTORS_PER_500M_BAND
Definition: Granule.h:449
@ BAND32
Definition: Granule.h:644
@ INDEX_500M
Definition: Granule.h:570
@ BAND33
Definition: Granule.h:644
@ GRAN_AVG_TA_RC_OS_OG
Definition: Granule.h:713
@ GRAN_AVG_TP_AO_LWIR_OBJ
Definition: Granule.h:706
@ GRAN_AVG_TP_BB_TEMP07
Definition: Granule.h:688
@ GRAN_AVG_TP_BB_TEMP10
Definition: Granule.h:691
@ GRAN_AVG_TP_MF_CALBKHD_SR
Definition: Granule.h:701
@ Number_Night_Scans
Definition: Granule.h:618
int safe_strcat(char *buf, char *str, int buflen)
Definition: Granule.c:834
@ GRAN_AVG_TP_SA_RCT2_MIRE
Definition: Granule.h:699
L1B_EV_FILE_index_t
Definition: Granule.h:583
@ GRAN_AVG_TP_SA_A_MTR
Definition: Granule.h:700
@ SD_INDEX
Definition: Granule.h:634
#define SCAN_TYPE_TEXT_SIZE
Definition: Granule.h:491
@ BAND21
Definition: Granule.h:643
@ INDEX_250M
Definition: Granule.h:569
@ GRAN_AVG_TA_RC_LWIR_CFPAE
Definition: Granule.h:697
void L1BErrorMsg(char *L1B_location, PGSt_SMF_code code, char *input_message, char *assoc_function, int32 lun, char *other_msg, boolean error_out)
Definition: Granule.c:918
@ BAND20
Definition: Granule.h:643
#define NUM_500M_BANDS
Definition: Granule.h:441
@ NUM_TARGETS
Definition: Granule.h:639
@ Packets_With_Bad_CRC
Definition: Granule.h:628
@ BB_Frames
Definition: Granule.h:623
PGSt_SMF_status Close_L1A_Granule(L1A_granule_t *L1A_Gran, L1A_Scan_t *L1A_Scan)
Definition: Granule.c:192
PGSt_SMF_status Read_Run_Time_Parameters(Run_Time_Parameters_t *runtime_params)
Definition: Granule.c:2989
@ GRAN_AVG_TA_RC_IS_OG
Definition: Granule.h:712
@ GRAN_AVG_TP_BB_TEMP09
Definition: Granule.h:690
@ GRAN_AVG_TP_SR_SNOUT
Definition: Granule.h:702
@ BAND28
Definition: Granule.h:643
@ GRAN_AVG_VR_RC_LW_FPA_HTR
Definition: Granule.h:714
@ BAND30
Definition: Granule.h:644
#define NUM_FOCAL_PLANES
Definition: Granule.h:496
@ INDEX_L1B_250m
Definition: Granule.h:587
@ BAND25
Definition: Granule.h:643
@ GRAN_AVG_TA_RC_CS_OG
Definition: Granule.h:710
@ OFF
Definition: Granule.h:479
@ GRAN_AVG_TP_BB_TEMP02
Definition: Granule.h:683
#define MAX_RUNTIME_PARAM_SIZE
Definition: Granule.h:742
int32 SUBSAMPLES_AT_RES[NUM_L1A_RESOLUTIONS]
Definition: Preprocess.c:21
PGSt_SMF_status Fill_Dead_Detector_SI(boolean isdaymode, int8 *dead_detector, L1B_Scan_t *L1B_Scan, L1B_granule_t *L1B_Gran, QA_Common_t *QA_Common)
Definition: Granule.c:1919
int16 L1B_BANDS_AT_RES[NUM_L1A_RESOLUTIONS]
Definition: Granule.c:58
@ NUM_L1B_EV_FILES
Definition: Granule.h:590
@ GRAN_AVG_TP_BB_TEMP11
Definition: Granule.h:692
PGSt_SMF_status Get_Satellite_ID(PGSt_PC_Logical lun, int32 *satellite_ID)
Definition: Granule.c:2924
@ SRCA_Frames
Definition: Granule.h:622
@ BAND23
Definition: Granule.h:643
@ GRAN_AVG_TP_BB_TEMP04
Definition: Granule.h:685
char Invalid_MOD01_Msg[]
Definition: Granule.c:913
@ NUM_NIGHT_BANDS
Definition: Granule.h:644
target_index_t
Definition: Granule.h:633
@ BAND22
Definition: Granule.h:643
@ BAND27
Definition: Granule.h:643
@ Incomplete_Scans
Definition: Granule.h:626
@ BAND26
Definition: Granule.h:643
PGSt_SMF_status Close_L1B_Granule(L1B_granule_t *L1B_Gran, L1B_Scan_t *L1B_Scan, boolean skip_night_hi_res)
Definition: Granule.c:268
@ Discarded_Packets
Definition: Granule.h:629
#define DETECTORS_PER_250M_BAND
Definition: Granule.h:450
#define NUM_REFLECTIVE_BANDS
Definition: Granule.h:443
#define NUM_REFLECTIVE_DETECTORS
Definition: Granule.h:437
#define MAX_NUM_GRAN_AVERAGES
Definition: Granule.h:716
@ GRAN_AVG_TP_MF_Z_BKHD_BB
Definition: Granule.h:703
instead the metadata field ProcessingEnvinronment is filled in from the output of a call to the POSIX compliant function uname from within the L1B code A small bug in L1B_Tables an incorrect comparison of RVS coefficients for TEBs to RVS coefficients for RSBs was being made This was replaced with a comparison between TEB coefficients This error never resulted in an incorrect RVS correction but did lead to recalculating the coefficients for each detector in a thermal band even if the coefficients were the same for all detectors To reduce to overall size of the reflective LUT HDF fill values were eliminated from all LUTs previously dimensioned where and where NUM_TIMES is the number of time dependent table pieces In Preprocess a small error where the trailing dropped scan counter was incremented when the leading dropped scan counter should have been was fixed This counter is internal only and is not yet used for any chiefly to casting of were added to make it LINUX compatible Output of code run on LINUX machines displays differences of at most scaled sector incalculable values of the Emissive calibration factor and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal c since none of these quantities are frame dependent Initialization of b1 and XMS values in Preprocess c routine Process_OBCENG_Emiss was moved inside the detector loops The code was altered so that if up to five scans are dropped between the leading middle or middle trailing the leading or trailing granule will still be used in emissive calibration to form a cross granule average QA bits and are set for a gap between the leading middle and middle trailing granules respectively This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule A small bug in the Band correction algorithm was corrected an uncertainty value was being checked against an upper bound whereas the proper quantity to be checked was the corresponding which is the product of the Band radiance times the ratio of the Band to Band scaling factors times the LUT correction value for that detector In addition a new LUT which allows for a frame offset with regard to the Band radiance was added A LUT which switches the correction off or on was also added Changes which do not affect scientific output of the the pixel is flagged with the newly created flag and the number of pixels for which this occurs is counted in the QA_common table The array of b1s in Preprocess c was being initialized to outside the loop over which meant that if b1 could not be the value of b1 from the previous band for that scan detector combination was used The initialization was moved inside the band loop Minor code changes were made to eliminate compiler warnings when the code is compiled in bit mode Temperature equations were upgraded to be MODIS AQUA or MODIS TERRA specific and temperature conversion coefficients for AQUA were MOD_PR02 will not cease execution if the value of this parameter is not but will print a message
Definition: HISTORY.txt:644
@ BAND24
Definition: Granule.h:643
PGSt_SMF_status Aggregate_L1B(L1B_Scan_t *L1B_Scan)
Definition: Granule.c:78
#define NUM_EMISSIVE_BANDS
Definition: Granule.h:445
#define MAX_SAMPLES_PER_BAND
Definition: Granule.h:485
gran_average_def_t
Definition: Granule.h:665
@ BAND34
Definition: Granule.h:644
@ GRAN_AVG_TA_RC_IS
Definition: Granule.h:711
@ ON
Definition: Granule.h:479
README for MOD_PR03(V6.1.0) 2. POINTS OF CONTACT it can be either SDP Toolkit or MODIS Packet for Terra input files The orbit validation configuration because the validation criteria it uses are too strict for the low precision estimation methods we use in that mode The PGEVersion configuration or PM1M for Aqua data The ProcessingEnvironment configuration as executed in the processing environment The ReprocessingActual(LUN 800600) and ReprocessingPlanned(LUN 800605) should be set to the values that should appear in the corresponding ECS metadata items of the same name. Typically
@ NUM_L1A_ATTRIBUTES
Definition: Granule.h:630
@ Scan_Type
Definition: Granule.h:625
int32 MOD_PR02_Failure_Exit_Code
Definition: Granule.c:52
@ GRAN_AVG_TA_AO_NIR_FPAE
Definition: Granule.h:695
instead the metadata field ProcessingEnvinronment is filled in from the output of a call to the POSIX compliant function uname from within the L1B code A small bug in L1B_Tables an incorrect comparison of RVS coefficients for TEBs to RVS coefficients for RSBs was being made This was replaced with a comparison between TEB coefficients This error never resulted in an incorrect RVS correction but did lead to recalculating the coefficients for each detector in a thermal band even if the coefficients were the same for all detectors To reduce to overall size of the reflective LUT HDF fill values were eliminated from all LUTs previously dimensioned where and where NUM_TIMES is the number of time dependent table pieces In Preprocess a small error where the trailing dropped scan counter was incremented when the leading dropped scan counter should have been was fixed This counter is internal only and is not yet used for any chiefly to casting of were added to make it LINUX compatible Output of code run on LINUX machines displays differences of at most scaled sector incalculable values of the Emissive calibration factor and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal c since none of these quantities are frame dependent Initialization of b1 and XMS values in Preprocess c routine Process_OBCENG_Emiss was moved inside the detector loops The code was altered so that if up to five scans are dropped between the leading middle or middle trailing the leading or trailing granule will still be used in emissive calibration to form a cross granule average QA bits and are set for a gap between the leading middle and middle trailing granules respectively This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule A small bug in the Band correction algorithm was corrected an uncertainty value was being checked against an upper bound whereas the proper quantity to be checked was the corresponding SI
Definition: HISTORY.txt:595
@ GRAN_AVG_TP_BB_TEMP06
Definition: Granule.h:687
@ EV_INDEX
Definition: Granule.h:638
#define NUM_1000M_NIGHT_BANDS
Definition: Granule.h:447
#define EV_1km_FRAMES
Definition: Granule.h:479
#define NUM_MIRROR_SIDES
Definition: Granule.h:439
#define NUM_1000M_REFL_BANDS
Definition: Granule.h:442
@ Missing_Packets
Definition: Granule.h:627
#define NUM_HIGH_RESOLUTION_DETECTORS
Definition: Granule.h:435
@ GRAN_AVG_TP_AO_SMIR_LENS
Definition: Granule.h:707
int16 L1A_BANDS_AT_RES[NUM_L1A_RESOLUTIONS]
Definition: Granule.c:63
#define NUM_EMISSIVE_DETECTORS
Definition: Granule.h:438
@ INDEX_L1B_1km
Definition: Granule.h:589
const char * str
Definition: l1c_msi.cpp:35
PGSt_SMF_status Write_L1B_EV_Scan(int16 S, L1B_granule_t *L1B_Gran, L1B_Scan_t *L1B_Scan, boolean isdaymode)
Definition: Granule.c:1673
#define SCAN_QUALITY_ARRAY_NUM_ELEMENTS
Definition: Granule.h:498
@ INDEX_1000M_NIGHT
Definition: Granule.h:572
#define EV_500m_FRAMES
Definition: Granule.h:481
switch_t
Definition: Granule.h:479
#define NUM_1000M_EMISS_BANDS
Definition: Granule.h:444
PGSt_SMF_status Open_and_Read_L1A(Run_Time_Parameters_t *runtime_params, L1A_granule_t *L1A_Gran, boolean *skip_night_hi_res)
Definition: Granule.c:2450
#define NUM_250M_BANDS
Definition: Granule.h:440
int8 boolean
Definition: Granule.h:566
night_band_index_t
Definition: Granule.h:642
L1A_attr_index_t
Definition: Granule.h:614
#define MAX_NUM_SCANS
Definition: Granule.h:432
@ Total_Frames
Definition: Granule.h:619
@ Orbital_Node
Definition: Granule.h:615
@ NUM_GRAN_AVERAGES
Definition: Granule.h:715
resolution_index_t
Definition: Granule.h:568
@ Number_Day_Scans
Definition: Granule.h:617
@ SV_Frames
Definition: Granule.h:624
@ INDEX_L1B_500m
Definition: Granule.h:588
@ GRAN_AVG_TP_AO_LWIR_LENS
Definition: Granule.h:708
@ NUM_L1A_RESOLUTIONS
Definition: Granule.h:573
@ GRAN_AVG_TP_AO_SMIR_OBJ
Definition: Granule.h:705
@ BAND31
Definition: Granule.h:644
#define NUM_DETECTORS
Definition: Granule.h:434
@ GRAN_AVG_TP_BB_TEMP05
Definition: Granule.h:686
@ GRAN_AVG_TP_SA_RCT1_MIRE
Definition: Granule.h:698
PGSt_SMF_status Read_L1A_EV_Scan(int16 S, L1A_granule_t *L1A_Gran, L1A_Scan_t *L1A_Scan)
Definition: Granule.c:671
@ GRAN_AVG_TP_MF_CVR_OP_SR
Definition: Granule.h:704
@ GRAN_AVG_TA_RC_SMIR_CFPAE
Definition: Granule.h:696
void SMF_ERROR(PGSt_SMF_code code, char *messagestring)
Definition: Granule.c:1345
@ GRAN_AVG_TP_BB_TEMP01
Definition: Granule.h:682
@ SRCA_INDEX
Definition: Granule.h:635
@ BB_INDEX
Definition: Granule.h:636
@ GRAN_AVG_TP_BB_TEMP03
Definition: Granule.h:684
@ GRAN_AVG_TA_AO_VIS_FPAE
Definition: Granule.h:694