OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
PreprocessP.h
Go to the documentation of this file.
1 #ifndef PREPROCESSP_H
2 #define PREPROCESSP_H
3 
4 #include "Preprocess.h"
5 /*
6 !C-INC**********************************************************************
7 !Description: Private header file to be used only in Preprocess.c.
8  Contains variable and macro definition, function prototypes.
9 
10 !Revision History:
11  $Log: PreprocessP.h,v $
12  Revision 1.21 2016-07-22 13:23:32-04 xgeng
13  Applied xtalk correction to Terra LWIR PV bands (27-30)
14 
15  Revision 1.19 2015-03-13 10:41:19-04 xgeng
16  Fix the anomaly before and after the sector rotation due to the timing mismatch between the command performed and the status updated.
17 
18  Revision 1.18 2011-04-07 14:41:30-04 xgeng
19  1. RSB &TEB uncertainty algorithm update; 2. The quadratic RSB RVS changed to 4th order.
20 
21  Revision 1.17 2010-11-15 10:21:51-05 xgeng
22  Defined a new constant (ELECTRONICS_BOTH).
23 
24  Revision 1.16 2009/07/24 21:05:29 xgeng
25  Added a member "Last_Valid_Scans" to structure L1A_granule_OBCEng_t and Overlap_OBCEng_t to fix the sector rotation abnormal
26 
27  Revision 1.15 2008/02/04 16:24:56 ltan
28  Changed for ANSI-C compliance. Correction for the generation of code change log.
29 
30 
31  Revision 01.15 April 16, 2003
32  Changed the nominal platform height from 750.259 to its correct value, 705.295. The
33  platform height is used only to determine the pixel offset when the Moon in SV
34  keep-out-box (KOB) algorithm is used. The incorrect value resulted in an actual SV KOB
35  slightly smaller than intended (approximately 3 pixels in the along- scan direction and
36  .9 pixels in the along-track direction). Since the actual desired boundaries of the SV
37  KOB are at +/-15 pixels along track and +/-55 pixels along scan and the pixels where SV
38  data are taken are +/-5 along track and +/-25 along scan, the impact of the error was
39  minimal.
40  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
41 
42  Revision 01.14, March 27, 2003 Razor issue #173
43  In the initialization of the Engineering_Coefficients_t structures
44  Engineering_Coefficients_PFM and Engineering_Coefficients_FM1, enclosed the
45  rows of the 2-dimensional arrays C_FP3, C_FP4, C_RC, and BB_a with braces
46  for ANSI-C compliance.
47  Liqin Tan, SAIC GSO (ltan@saicmodis.com)
48 
49  Revision 01.13, April 15, 2002 Razor issue #166
50  Removed GRANULE_TIME_INTERVAL and GRANULE_TIMEDIFF_TOLERANCE
51  Added INNER_GRANULE_TIMEDIFF_TOLERANCE and OUTER_GRANULE_TIMEDIFF_TOLERANCE.
52  Change Read_Overlap_OBCEng prototype to allow passing of boolean pointer
53  "scan_gap".
54  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
55 
56  Revision 01.12 March 25, 2002 Razor Issue #178
57  Strip out ADC Correction
58  Alice_Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
59 
60  Revision 01.11, March 11, 2002 Razor Issue #174
61  Change function prototypes to pass
62  Emissive SV and BB RVS corrections.
63  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
64 
65  Revision 01.10, January 29, 2002 Razor Issue #175
66  Change function prototypes as appropriate to pass satellite ID.
67  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
68 
69  Revision 01.09, Dec. 28, 2001, Razor issue #154
70  Added temperature coefficient structure and made Terra- and Aqua- specific
71  coefficient structures.
72  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
73 
74  Revision 01.08, Nov. 5, 2001, Razor issue 166
75  Added GRANULE_TIME_INTERVAL and GRANULE_TIMEDIFF_TOLERANCE.
76  Alice Isaacman, SAIC GSO (Alice.R.Isaacman.1@gsfc.nasa.gov)
77 
78  Revision 01.07, Dec 7, 2000, Razor issue 146.
79  Remove Fill_DN_Sat_Prime, add MirrorSide to Fill_xxx_DN_OBC_Avg.
80  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
81 
82  Revision 01.06 October 24, 2000
83  Added code for granule average QA values as per issue 140.
84  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
85 
86  Revision 01.05 Sep 5, 2000
87  Made several changes for Razor issue 130 (errors computing "b1" when
88  near a sector rotation or if Ecal ends in the last 40 scans of the leading
89  granule or starts in the 1st 40 scans of the trailing granule).
90  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
91 
92  Revision 01.04 November 23, 1999
93  Read_LeadingOverlap and Read_TrailingOverlap replaced by Read_Overlap_OBCEng.
94  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
95 
96  Revision 01.03 September 30, 1999
97  Added num_thermistor_outliers to Temperature_t structure.
98  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
99 
100  Revision 01.02 May 6, 1999
101  Removed ADC_correction, Best_Pixel_Avg_int16(), Calculate_SV_Best_Pixel()
102  and Get_L1B_SD_SRCA_BB_SV().
103  Zhenying Gu(zgu@mcst.gsfc.nasa.gov)
104 
105  Revision 01.01 Feb 17, 1999
106  Moved ADC_correction into this module from Reflective_Cal as part of
107  DN_to_DN_star to avoid circular include dependencies.
108  Jim Rogers (rogers@mcst.gsfc.nasa.gov)
109 
110  Revision 01.00 Nov. 1998
111  part of original Preprocess.h into this header file
112  Initial development
113  Zhenying Gu(zgu@mcst.gsfc.nasa.gov)
114 
115 !References and Credits:
116  This software is developed by the MODIS Characterization Support
117  Team (MCST)for the National Aeronautics and Space Administration,
118  Goddard Space Flight Center, under contract NAS5-32373.
119 
120  HDF portions developed at the National Center for Supercomputing
121  Applications at the University of Illinois at Urbana-Champaign.
122 
123 !Design Notes:
124 
125 !END***********************************************************************
126 */
127 
128 
129 /* numbers of different kinds of bands used as dimensionality */
130 
131 #define MAX_NUM_BANDS_PER_TYPE 11
132 #define NUM_BAND_TYPES 5
133 #define NUM_PV_VIS_BANDS 7
134 #define NUM_PV_NIR_BANDS 11
135 #define NUM_SM_BANDS 10
136 #define NUM_PV_LW_BANDS 4
137 #define NUM_PC_LW_BANDS 6
138 
139 #define ELECTRONICS_PRIMARY 0 /* Electronics side "A" */
140 #define ELECTRONICS_REDUNDANT 1 /* Electronics side "B" */
141 #define ELECTRONICS_BOTH 2 /* both side of Electronics on */
142 #define MAX_NUM_OVERLAP_SCANS MAX_NUM_SCANS
143 #define MAX_OVERLAP_TRACK_DIM MAX_1KM_TRACK_DIM
144 #define MAX_TOTAL_XGRAN_SCANS (2*MAX_NUM_OVERLAP_SCANS + MAX_NUM_SCANS)
145 #define GEO_NUM_SCANS_NAME "Number of Scans"
146 #define GEO_SD_SUN_AZ_SDS_NAME "SD Sun azimuth"
147 #define GEO_SD_SUN_ZEN_SDS_NAME "SD Sun zenith"
148 #define OBC_SD_SUN_AZ_SDS_NAME "SD Sun Azimuth"
149 #define OBC_SD_SUN_ZEN_SDS_NAME "SD Sun Zenith"
150 #define DN_BG_FIRST_FRAME_SDS_NAME "DN_obc_avg_first_frame_to_use"
151 #define DN_BG_NUM_FRAMES_SDS_NAME "DN_obc_avg_number_of_frames_to_use"
152 #define VEC_DIM_NAME "vecdim"
153 #define NUM_BANDS_DIM_NAME "num_bands"
154 #define MOON_IN_KOB_SDS_NAME "Moon in keep-out-box"
155 #define VEC_DIM 3
156 #define MOON_VECTOR_SDS_NAME "Moon Vector"
157 #define MAX_ENG_MEM_DATA_DIM 550
158 #define MAX_NUM_VDATA 100
159 #define MAX_VDATA_SIZE 1024
160 #define NOMINAL_PIXEL_WIDTH 1.0
161 #define NOMINAL_PLATFORM_HEIGHT 705.295
162 #define PIXEL_WIDTH_RADIANS (NOMINAL_PIXEL_WIDTH/NOMINAL_PLATFORM_HEIGHT)
163 #define SV_CNTR_ANG_FROM_Y (-8.425 * (PGS_PI/180.0))
164 #define SC_ANCIL_SIZE 128
165 #define MOON_X_DATA_POSITION_IN_SC_ANCIL 61
166 #define CONVERT_TO_UINT8(x,y) \
167  if ( x < 0 ) y = 0; \
168  else if ( x >= 9) y = 255; \
169  else y = (uint8) (255.0 * (x / 9.0));
170 
171 #define Celsius_To_Kelvin_Offset 273.15
172 #define DN_SAT_9BITS 511 /* saturation level for 9-bit temperature DN */
173 #define DN_SAT_10BITS 1023 /* saturation level for 10-bit voltage DN */
174 #define DN_SAT_12BITS 4095 /* saturation level for 12-bit temperature DN */
175 
176  /*
177  * Emissive L_vs_DN Algorithm Planck function MACRO
178  * (needs two constants, C_1 and C_2,
179  * for radiance in the units of W/m^2/micron/sr)
180  */
181 #define C_1 1.19106e+8
182 #define C_2 1.43879e+4
183 #define L(lambda,T) (C_1 / pow((double) (lambda), (double) 5) / \
184  (exp((double) (C_2 / ((lambda) * (T))) ) - 1) )
185 
186  /* Upper and Lower limits on calculated RVS Correction terms */
187 #define RVS_CORRECTION_UPPER_LIMIT 2.4e+0
188 #define RVS_CORRECTION_LOWER_LIMIT 4.0e-1
189 
190  /* Time elapsed between MODIS scans in seconds */
191 #define SCAN_TIME_INTERVAL 1.47717
192 
193  /* Highest acceptable number of dropped scans between granules */
194 #define DROPPED_SCAN_UPPER_LIMIT 5
195 
196  /* Tolerance of difference between estimated and actual time differences. */
197 #define INNER_GRANULE_TIMEDIFF_TOLERANCE .5*SCAN_TIME_INTERVAL
198 #define OUTER_GRANULE_TIMEDIFF_TOLERANCE \
199  (DROPPED_SCAN_UPPER_LIMIT + .5)*SCAN_TIME_INTERVAL
200 
201 /* satellite ID */
202 
203 #define TERRA 0
204 #define AQUA 1
205 #define INVALID_SATELLITE_ID -1
206 
207  /* Structure which holds engineering coefficients */
208  typedef struct {
209  int32 Rp ;
210  float32 V0_CPA ;
211  float32 I_CPA ;
212  float32 V0_CPB ;
213  float32 I_CPB ;
214 
215  float32 C_FP1[6];
216  float32 C_FP2[6];
217  float32 C_FP3[3][6];
218  float32 C_FP4[3][6];
219  float32 C_MIR_A[6];
220  float32 C_MIR_B[6];
221  float32 C_CAV_A[6];
222  float32 C_CAV_B[6];
223  float32 C_ADC[6];
224  float32 C_INS_A[6];
225  float32 C_INS_B[6];
226  float32 C_RC[NUM_T_RC_VALUES][6];
227  float32 C_RC_VR_FPA[6];
228  float32 BB_a[NUM_BB_THERMISTORS][4];
230 
231  /* ENGINEERING COEFFICIENTS FOR TERRA (PFM)
232  *
233  * -------------------------------------------------------
234  * DN to Eng Units equation coefficients
235  * Reference: SBRS Doc. 151840 REV C, T20-5A and T20-6A
236  * -------------------------------------------------------
237  */
238 
240  2.0000E+07, /* Rp */
241  -3.216341, /* V0_CPA */
242  0.000332142, /* I_CPA */
243  -3.215385, /* V0_CPB */
244  0.000332376, /* I_CPB */
245 
246  /*
247  * T_fp1 --> TA_AO_VIS_FPA
248  * T_fp2 --> TA_AO_NIR_FPA
249  * unit = ^oC
250  * Ref. T20-5A SBRS Doc. 151840 REV C
251  */
252  { /* TERRA (PFM) C_FP1[6] */
253  -5.8957e+01, 3.5611e-02, 2.7192e-06, -1.2548e-09, 1.4924e-13, 0. },
254  { /* TERRA (PFM) C_FP2[6]*/
255  -5.7755e+01, 3.5526e-02, 2.8295e-06, -1.2865e-09, 1.5373e-13, 0. },
256 
257  /*
258  * T_fp3 --> TA_RC_SMIR_CFPA
259  * T_fp4 --> TA_RC_LWIR_CFPA
260  * unit = K
261  * Ref. T20-5A SBRS Doc. 151840 REV C
262  */
263  { /*[FP_SPSs][6]*/ /*TA_RC_SMIR_CFPA*/ /* TERRA (PFM) C_FP3[3][6] */
264  {4.9970e+01, 1.8360e-02, -9.1174e-07, 1.7673e-10, -1.3356e-14, 0.},
265  {4.9912e+01, 1.8426e-02, -9.6036e-07, 1.9249e-10, -1.5208e-14, 0.},
266  {4.9846e+01, 1.8413e-02, -9.4652e-07, 1.8741e-10, -1.4575e-14, 0.}
267  },
268 
269  { /*[FP_SPSs][6]*/ /*TA_RC_LWIR_CFPA*/ /* TERRA (PFM) C_FP4[3][6] */
270  {8.0062e+01, 1.4493e-03, -6.8684e-09, 1.9367e-12, -2.5410e-16, 0.},
271  {8.2050e+01, 1.4442e-03, -5.6085e-09, 1.0498e-12, -1.0151e-16, 0.},
272  {8.5048e+01, 1.4388e-03, -8.8412e-09, 2.5727e-12, -2.9433e-16, 0.}
273  },
274 
275  /*
276  * T_mir --> TP_SA_RCT1_MIR & TP_SA_RCT2_MIR,
277  * they use the same coefficients
278  * unit = ^oC
279  * Ref. T20-6A SBRS Doc. 151840 REV C
280  */
281 
282  /* Common A/B side for Terra (PFM), Separate A/B sides for Aqua (FM1). */
283  { /* TERRA (PFM) C_MIR_A[6] */
284  8.6953e+01, -7.0286e-02, 4.1191e-05, -1.6989e-08,
285  3.6372e-12, -3.2037e-16 },
286  { /* TERRA (PFM) C_MIR_B[6] */
287  8.6953e+01, -7.0286e-02, 4.1191e-05, -1.6989e-08,
288  3.6372e-12, -3.2037e-16 },
289 
290  /*
291  * T_cav --> TP_MF_CALBKHD_SR, TP_SA_A_MTR
292  * unit = ^oC
293  * Ref. T20-6
294  */
295 
296  /* Common A/B side for Terra (PFM), Separate A/B sides for Aqua (FM1). */
297  { /* TERRA (PFM) C_CAV_A[6] */
298  8.6954e+01, -5.6241e-01, 2.6375e-03, -8.7030e-06,
299  1.4904e-08, -1.0501e-11 },
300  { /* TERRA (PFM) C_CAV_B[6] */
301  8.6954e+01, -5.6241e-01, 2.6375e-03, -8.7030e-06,
302  1.4904e-08, -1.0501e-11 },
303 
304  /*
305  * T_ADC --> TA_PVLW_PWB4_10
306  * TA_PVSM_PWB6_12
307  * unit = ^oC
308  * Ref. T20-5A SBRS Doc. 151840 REV C
309  */
310  { /* TERRA (PFM) C_ADC[6] */
311  -1.8888e+01, 4.9724e-01, -2.3834e-03, 8.1515e-06,
312  -1.3848e-08, 9.2793e-12},
313  /*
314  * T_INS --> TP_AO_SMIR_OBJ, TP_AO_SMIR_LENS,
315  * TP_AO_LWIR_OBJ, TP_AO_LWIR_LENS
316  * unit = ^oC
317  * Ref. T20-6A SBRS Doc. 151840 REV C
318  */
319 
320  /* Common A/B side for Terra (PFM), Separate A/B sides for Aqua (FM1). */
321  { /* TERRA (PFM) C_INS_A[6] */
322  8.6953e+01, -7.0286e-02, 4.1191e-05, -1.6989e-08,
323  3.6372e-12, -3.2037e-16},
324  { /* TERRA (PFM) C_INS_B[6] */
325  8.6953e+01, -7.0286e-02, 4.1191e-05, -1.6989e-08,
326  3.6372e-12, -3.2037e-16},
327 
328  /* RC temperature conversion
329  * num bits = 12 (max DN value = 4095)
330  * units = Kelvin
331  * ref. T20-5A SBRS Doc. 151840 REV C
332  */
333  { /* TERRA (PFM) C_RC[NUM_T_RC_VALUES][6] */
334  {-2.6607e+00, 2.9239e-02, -1.2789e-06, 1.4882e-10, 0., 0.}, /* TA_RC_CS */
335  {-1.3726e+02, 7.5134e-02, -2.7944e-06, 3.5353e-09, 0., 0.}, /* TA_RC_CS_OG */
336  { 3.1238e+01, 2.6812e-02, 1.8002e-06, 2.8576e-11, 0., 0.}, /* TA_RC_IS */
337  {-1.4316e+02, 8.0885e-02, -4.5854e-06, 3.7057e-09, 0., 0.}, /* TA_RC_IS_OG */
338  {-1.4102e+02, 7.9490e-02, -4.3164e-06, 3.6498e-09, 0., 0.} /* TA_RC_OS_OG */
339  },
340 
341  /* RC FPA voltage heater conversion (LWIR or SMIR)
342  * num bits = 10 (max DN value = 1023)
343  * units = volts DC
344  * VR_RC_LW_FPA_HTR
345  * VR_RC_SM_FPA_HTR
346  * ref T20-5 SBRS Doc. 151840 REV C
347  */
348  { /* TERRA (PFM) C_RC_VR_FPA[6] */
349  -1.4970e+01, 2.9238e-02, 0., 0., 0., 0. },
350 
351  /*
352  * All engineering coefficients for Terra OBC BB are described in
353  * "Preliminary Investigation of the On-Board Calibrator (OBC) Blackbody
354  * Temperature Calibration Algorithm" by J. Xiong and T. Dorman,
355  * 03/24/1998.
356  */
357  { /* TERRA (PFM) BB_a[NUM_BB_THERMISTORS][4] */
358  {9.298819E-04, 3.028024E-04, -4.973001E-06, 3.284554E-07},
359  {9.521969E-04, 2.972846E-04, -4.348669E-06, 3.039369E-07},
360  {9.614388E-04, 2.905839E-04, -3.482982E-06, 2.769668E-07},
361  {9.533260E-04, 2.949576E-04, -4.035258E-06, 2.947707E-07},
362  {9.946773E-04, 2.814390E-04, -2.494828E-06, 2.345659E-07},
363  {9.808668E-04, 2.872997E-04, -3.192201E-06, 2.592090E-07},
364  {9.699586E-04, 2.888108E-04, -3.350490E-06, 2.674701E-07},
365  {9.550755E-04, 2.944409E-04, -3.996653E-06, 2.917877E-07},
366  {9.491089E-04, 2.977076E-04, -4.445135E-06, 3.096761E-07},
367  {1.011649E-03, 2.766499E-04, -1.983597E-06, 2.138617E-07},
368  {1.028646E-03, 2.700306E-04, -1.171597E-06, 1.830096E-07},
369  {1.001408E-03, 2.788388E-04, -2.210990E-06, 2.223562E-07}
370  }
371  };
372 
373 
374  /* ENGINEERING COEFFICIENTS FOR AQUA (FM1)
375  *
376  * -------------------------------------------------------
377  * DN to Eng Units equation coefficients
378  * Reference: SBRS Doc. 151840 REV C, T20-5B and T20-6B
379  * -------------------------------------------------------
380  */
381 
383  2.0000E+07 , /* Rp */
384  -3.225313 , /* V0_CPA */
385  0.000333193, /* I_CPA */
386  -3.228853 , /* V0_CPB */
387  0.000334205, /* I_CPB */
388 
389  /*
390  * T_fp1 --> TA_AO_VIS_FPA
391  * T_fp2 --> TA_AO_NIR_FPA
392  * unit = ^oC
393  * Ref. T20-5B SBRS Doc. 151840 REV C
394  */
395  { /* AQUA (FM1) C_FP1[6] */
396  -5.8639e+01, 3.6188e-02, 2.6495e-06, -1.3749e-09, 1.7933e-13, 0. },
397  { /* AQUA (FM1) C_FP2[6] */
398  -5.8907e+01, 3.5310e-02, 2.8666e-06, -1.3021e-09, 1.5744e-13, 0. },
399 
400  /*
401  * T_fp3 --> TA_RC_SMIR_CFPA
402  * T_fp4 --> TA_RC_LWIR_CFPA
403  * unit = K
404  * Ref. T20-5B SBRS Doc. 151840 REV C
405  */
406  { /*[FP_SPSs][6]*/ /*TA_RC_SMIR_CFPA*/ /* AQUA (FM1) C_FP3[3][6] */
407  {4.9904e+01, 1.8157e-02, -6.8273e-07, 1.0882e-10, -7.0948e-15, 0.},
408  {4.9832e+01, 1.8200e-02, -7.0521e-07, 1.1395e-10, -7.5264e-15, 0.},
409  {4.9762e+01, 1.8208e-02, -7.0835e-07, 1.1460e-10, -7.5779e-15, 0 }
410  },
411 
412  { /*[FP_SPSs][6]*/ /*TA_RC_LWIR_CFPA*/ /* AQUA (FM1) C_FP4[3][6] */
413  {8.0049e+01, 1.4429e-03, -2.0639e-09, 2.0749e-14, 0., 0.},
414  {8.2079e+01, 1.4374e-03, -2.0972e-09, 3.9308e-14, 0., 0.},
415  {8.5062e+01, 1.4287e-03, -1.8224e-09, 9.6394e-14, 0., 0 }
416  },
417 
418  /*
419  * T_mir --> TP_SA_RCT1_MIR & TP_SA_RCT2_MIR,
420  * they use the same coefficients
421  * unit = ^oC
422  * Ref. T20-6B SBRS Doc. 151840 REV C
423  */
424 
425  /* Common A/B side for Terra (PFM), Separate A/B sides for Aqua (FM1). */
426  { /* AQUA (FM1) C_MIR_A[6] */
427  8.6330e+01, -6.9256e-02, 4.0275e-05, -1.6550e-08,
428  3.5331e-12, -3.1087e-16 },
429  { /* AQUA (FM1) C_MIR_B[6] */
430  8.7354E+01, -7.0526E-02, 4.1313E-05, -1.6883E-08,
431  3.5664E-12, -3.0902E-16 },
432  /*
433  * T_cav --> TP_MF_CALBKHD_SR, TP_SA_A_MTR
434  * unit = ^oC
435  * Ref. T20-6
436  */
437 
438  /* Common A/B side for Terra (PFM), Separate A/B sides for Aqua (FM1). */
439  { /* AQUA (FM1) C_CAV_A[6] */
440  8.6334e+01, -5.5420e-01, 2.5791e-03, -8.4794e-06,
441  1.4482e-08, -1.0193e-11 },
442  { /* AQUA (FM1) C_CAV_B[6] */
443  8.7352e+01, -5.6419e-01, 2.6441e-03, -8.6454e-06,
444  1.4614e-08, -1.0132e-11 },
445 
446  /*
447  * T_ADC --> TA_PVLW_PWB4_10
448  * TA_PVSM_PWB6_12
449  * unit = ^oC
450  * Ref. T20-5B SBRS Doc. 151840 REV C
451  */
452 
453  { /* AQUA (FM1) C_ADC[6] */
454  -1.8888e+01, 4.9724e-01, -2.3834e-03, 8.1515e-06,
455  -1.3848e-08, 9.2793e-12},
456  /*
457  * T_INS --> TP_AO_SMIR_OBJ, TP_AO_SMIR_LENS,
458  * TP_AO_LWIR_OBJ, TP_AO_LWIR_LENS
459  * unit = ^oC
460  * Ref. T20-6B SBRS Doc. 151840 REV C
461  */
462 
463  /* Common A/B side for Terra (PFM), Separate A/B sides for Aqua (FM1). */
464  { /* AQUA (FM1) C_INS_A[6] */
465  8.6330e+01, -6.9256e-02, 4.0275e-05, -1.6550e-08,
466  3.5331e-12, -3.1087e-16},
467  { /* AQUA (FM1) C_INS_B[6] */
468  8.7354e+01, -7.0526e-02, 4.1313e-05, -1.6883e-08,
469  3.5664e-12, -3.0902e-16},
470 
471  /* RC temperature conversion
472  * num bits = 12 (max DN value = 4095)
473  * units = Kelvin
474  * VR_RC_LW_FPA_HTR
475  * VR_RC_SM_FPA_HTR
476  * ref. T20-5B SBRS Doc. 151840 REV C
477  */
478 
479  { /* AQUA (FM1) C_RC[NUM_T_RC_VALUES][6] */
480  {-2.6607e+00, 2.9239e-02, -1.2789e-06, 1.4882e-10, 0., 0.}, /* TA_RC_CS */
481  {-2.0315e+02, 1.3710e-01, -2.1847e-05, 5.4693e-09, 0., 0.}, /* TA_RC_CS_OG */
482  { 3.1238e+01, 2.6812e-02, 1.8002e-06, 2.8576e-11, 0., 0.}, /* TA_RC_IS */
483  {-2.0199e+02, 1.3610e-01, -2.1620e-05, 5.4342e-09, 0., 0.}, /* TA_RC_IS_OG */
484  {-2.0916e+02, 1.4514e-01, -2.5230e-05, 5.8560e-09, 0., 0.} /* TA_RC_OS_OG */
485  },
486 
487  /* RC FPA voltage heater conversion (LWIR or SMIR)
488  * num bits = 10 (max DN value = 1023)
489  * units = volts DC
490  * ref T20-5B SBRS Doc. 151840 REV C
491  */
492  { /* AQUA (FM1) C_RC_VR_FPA[6] */
493  -1.4970e+01, 2.9238e-02, 0., 0., 0., 0. },
494 
495  { /* AQUA (FM1) BB_a[NUM_BB_THERMISTORS][4] */
496  {1.056236E-03, 2.599020E-04, -5.425454E-08, 1.415182E-07},
497  {1.044243E-03, 2.644832E-04, -5.928912E-07, 1.628909E-07},
498  {1.047991E-03, 2.626818E-04, -3.507229E-07, 1.533612E-07},
499  {1.023606E-03, 2.710050E-04, -1.348365E-06, 1.935789E-07},
500  {9.557013E-04, 2.970908E-04, -4.471715E-06, 3.073990E-07},
501  {9.921567E-04, 2.816634E-04, -2.570464E-06, 2.376100E-07},
502  {9.778825E-04, 2.874839E-04, -3.200168E-06, 2.605131E-07},
503  {9.724649E-04, 2.883692E-04, -3.300496E-06, 2.659593E-07},
504  {1.061567E-03, 2.579380E-04, 1.435982E-07, 1.358619E-07},
505  {1.048034E-03, 2.628100E-04, -3.993544E-07, 1.539620E-07},
506  {1.103644E-03, 2.444421E-04, 1.686106E-06, 7.536176E-08},
507  {1.083254E-03, 2.507835E-04, 9.546836E-07, 1.038510E-07}
508  }
509  };
510 
511  typedef struct {
512  float32 moon_vector[MAX_NUM_SCANS][VEC_DIM];
513  int8 moon_in_SV_KOB[MAX_NUM_SCANS][NUM_BANDS];
514  } Moon_arrays_t;
515 
516  typedef struct
517  {
518  float32 fp [NUM_FOCAL_PLANES][MAX_NUM_SCANS];
519  float32 mir1 [MAX_NUM_SCANS];
520  float32 mir2 [MAX_NUM_SCANS];
521  float32 mir_avg [MAX_NUM_SCANS];
522  float32 scn_mtr [MAX_NUM_SCANS];
523  float32 cav [MAX_NUM_SCANS];
524  float32 ins [MAX_NUM_SCANS];
525  float32 bb [NUM_BB_THERMISTORS][MAX_NUM_SCANS];
526  float32 bb_avg [MAX_NUM_SCANS];
527  int8 fp_set_point_state [MAX_NUM_SCANS];
528  uint16 lwir_adc_index [MAX_NUM_SCANS];
529  uint16 mwir_adc_index [MAX_NUM_SCANS];
530  uint16 nir_adc_index [MAX_NUM_SCANS];
531  uint16 vis_adc_index [MAX_NUM_SCANS];
532  uint16 pclw_adc_index [MAX_NUM_SCANS];
533  uint8 num_thermistor_outliers [MAX_NUM_SCANS]; /* range [0-12] */
534  float32 ins_temp[NUM_T_INS_THERMISTORS][MAX_NUM_SCANS];
535  float32 cav_temp[NUM_T_CAV_THERMISTORS][MAX_NUM_SCANS];
536  float32 rc_temp [NUM_T_RC_VALUES][MAX_NUM_SCANS];
537  float32 vr_lwir [MAX_NUM_SCANS];
538  } Temperatures_t;
539 
540  typedef struct
541  {
542  int32 num_scans;
543  int16 BB_1km_night[MAX_1KM_TRACK_DIM]
545  [BB_1km_FRAMES];
546  int16 SV_1km_night[MAX_1KM_TRACK_DIM]
548  [SV_1km_FRAMES];
549  int16 MirrorSide[MAX_NUM_SCANS];
550  boolean Ecal_On[MAX_NUM_SCANS][NUM_BANDS];
551  boolean Sector_Rotated[MAX_NUM_SCANS];
552  Temperatures_t temps;
554 
555  typedef struct
556  {
557  int32 num_scans;
558  int16 BB_1km_night[MAX_OVERLAP_TRACK_DIM]
560  [BB_1km_FRAMES];
561  int16 SV_1km_night[MAX_OVERLAP_TRACK_DIM]
563  [SV_1km_FRAMES];
564  int16 MirrorSide[MAX_NUM_SCANS];
565  boolean Ecal_On[MAX_NUM_SCANS][NUM_BANDS];
566  boolean Sector_Rotated[MAX_NUM_SCANS];
567  Temperatures_t temps;
569 
572 
573  PGSt_SMF_status Calculate_Temp_QA
574  (int32 num_scans,
575  Temperatures_t *temps,
577  QA_Data_t *QA);
578 
579  PGSt_SMF_status Process_OBCEng_Refl
580  (int32 sd_id,
581  int32 num_scans,
582  float32 *T_ins,
583  int16 *MirrorSide,
584  refl_tables_t *refl_tables,
585  Moon_arrays_t *moon_arrays,
586  L1A_granule_OBCEng_t *L1A_OBCEng,
587  DN_OBC_Avg_t *DN_OBC_Avg,
588  QA_Refl_t *QA_refl,
589  Preprocess_Refl_t *PP_Refl);
590 
591  PGSt_SMF_status Process_OBCEng_Emiss
592  (L1A_granule_t *L1A_Gran,
593  L1A_granule_OBCEng_t *L1A_OBCEng,
594  Emiss_Cal_Coeff_t *RVS_Coeff,
596  QA_tables_t *QA_tables,
597  Moon_arrays_t *moon_arrays,
598  QA_Data_t *QA,
599  Preprocess_Emiss_t *PP,
600  DN_OBC_Avg_t *DN_OBC_Avg);
601 
602  PGSt_SMF_status Get_Emiss_Coeff_Per_Scan
603  (int8 moon_in_SV_KOB,
604  int16 *BB,
605  int16 *SV,
606  int16 B,
607  int16 D,
608  int16 D_emiss,
609  int16 MS,
610  Emiss_Cal_Coeff_t *RVS_Coeff,
612  float32 T_bb,
613  float32 T_mir,
614  float32 T_cav,
615  float32 T_ins,
616  float32 *Xdn_bb_31,
617  float32 Xdn_bb_pvlw_xt[][DETECTORS_PER_1KM_BAND],
618  float32 *Xb1,
619  float32 *xdLbb,
620  float32 *xdnbb,
621  float32 *xLbb,
622  float32 *xLcav,
623  float32 *xdnsv,
624  float32 *xdnsv_var,
625  uint32 *sv_omask,
626  float32 *SNR);
627 
628  PGSt_SMF_status Calculate_Planck
629  (float32 *RSR,
630  float32 *wl,
631  int16 size,
632  float32 T,
633  float32 *planck);
634 
635  PGSt_SMF_status Read_L1A_OBCEng
636  (emiss_tables_t *emiss_tables,
637  L1A_granule_t *L1A_Gran,
638  L1A_granule_OBCEng_t *L1A_OBCEng);
639 
640  PGSt_SMF_status Read_Overlap_OBCEng
641  (L1A_granule_t *L1A_Gran,
642  emiss_tables_t *emiss_tables,
643  PGSt_PC_Logical lun,
644  Overlap_OBCEng_t *Overlap_OBCEng,
645  boolean *scan_gap);
646 
647 
648  PGSt_SMF_status Write_L1B_OBCEng
649  (L1A_granule_t *L1A_Gran,
651  Moon_arrays_t *moon_arrays,
652  DN_OBC_Avg_t *DN_OBC_Avg);
653 
654  PGSt_SMF_status Copy_EngMemData
655  (int32 in_sd_id,
656  int32 out_sd_id,
657  int32 num_scans);
658 
659  PGSt_SMF_status Copy_ScanMetadata
660  (int32 in_sd_id,
661  int32 out_sd_id,
662  int32 num_scans);
663 
664  PGSt_SMF_status Copy_PixelQualityData
665  (int32 in_sd_id,
666  int32 out_sd_id,
667  int32 num_scans);
668 
669  PGSt_SMF_status Copy_EngVdata
670  (int32 in_v_id,
671  int32 out_v_id);
672 
673  PGSt_SMF_status Read_Convert_Temperatures
675  int32 v_id,
676  int32 start_scan,
677  int32 num_scans,
678  int32 satellite_ID,
679  Temperatures_t *temps);
680 
681  PGSt_SMF_status Calculate_PP_Planck_Mir
682  (int32 num_scans,
684  Preprocess_Emiss_t *PP);
685 
686  PGSt_SMF_status Get_Leading_Gran_Emiss_Coeff
687  (Overlap_OBCEng_t *Leading_OBCEng,
688  int16 B,
689  int16 D,
690  int16 D_emiss,
691  Emiss_Cal_Coeff_t *RVS_Coeff,
693  Moon_arrays_t *moon_arrays,
694  float32 Xdn_bb_31[]
696  float32 Xdn_bb_pvlw_xt[]
698  float32 *Xb1,
699  int16 *XMS);
700 
701  PGSt_SMF_status Get_Middle_Gran_Emiss_Coeff
702  (L1A_granule_OBCEng_t *L1A_OBCEng,
703  int16 B,
704  int16 D,
705  int16 D_emiss,
706  Emiss_Cal_Coeff_t *RVS_Coeff,
708  emiss_QA_tables_t *QA_tables,
709  Moon_arrays_t *moon_arrays,
710  float32 Xdn_bb_31[]
712  float32 Xdn_bb_pvlw_xt[]
714  float32 *Xb1,
715  int16 *XMS,
716  QA_Emiss_t *QA,
717  Preprocess_Emiss_t *PP,
718  DN_OBC_Avg_t *DN_OBC_Avg);
719 
720  PGSt_SMF_status Get_Trailing_Gran_Emiss_Coeff
721  (int32 num_scans_middle,
722  Overlap_OBCEng_t *Trailing_OBCEng,
723  int16 B,
724  int16 D,
725  int16 D_emiss,
726  Emiss_Cal_Coeff_t *RVS_Coeff,
728  Moon_arrays_t *moon_arrays,
729  float32 Xdn_bb_31[]
731  float32 Xdn_bb_pvlw_xt[]
733  float32 *Xb1,
734  int16 *XMS);
735 
736  PGSt_SMF_status Get_All_Emiss_Coeff
737  (L1A_granule_OBCEng_t *L1A_OBCEng,
738  int16 B,
739  int16 D_emiss,
740  float32 *Xb1,
741  int16 *Xmir,
743  emiss_QA_tables_t *QA_tables,
744  QA_Emiss_t *QA,
745  Preprocess_Emiss_t *PP);
746 
747  PGSt_SMF_status Compute_BB_Temperature
749  int32 start_scan,
750  int32 num_scans,
751  uint16 *CP_index,
752  uint16 **raw_BB_temp,
753  int32 satellite_ID,
754  Temperatures_t *temps);
755 
756  PGSt_SMF_status Get_Electronics_index
757  (int32 num_scans,
758  uint16 *Electronics_pri,
759  uint16 *Electronics_red,
760  uint16 *Electronics_index);
761 
762  PGSt_SMF_status Write_Geo_OBC_SDS
763  (int32 obc_sd_id,
764  int32 num_scans);
765 
766  PGSt_SMF_status Fill_250m_DN_OBC_Avg
767  (int32 sd_id,
768  int32 num_scans,
769  int16 *MirrorSide,
770  refl_tables_t *refl_tables,
771  Moon_arrays_t *moon_arrays,
772  boolean Ecal_On[][NUM_BANDS],
773  DN_OBC_Avg_t *DN_OBC_Avg,
774  QA_Refl_t *QA_refl);
775 
776  PGSt_SMF_status Fill_500m_DN_OBC_Avg
777  (int32 sd_id,
778  int32 num_scans,
779  int16 *MirrorSide,
780  refl_tables_t *refl_tables,
781  Moon_arrays_t *moon_arrays,
782  boolean Ecal_On[][NUM_BANDS],
783  DN_OBC_Avg_t *DN_OBC_Avg,
784  QA_Refl_t *QA_refl);
785 
786  PGSt_SMF_status Fill_1km_day_DN_OBC_Avg
787  (int32 sd_id,
788  int32 num_scans,
789  int16 *MirrorSide,
790  refl_tables_t *refl_tables,
791  Moon_arrays_t *moon_arrays,
792  boolean Ecal_On[][NUM_BANDS],
793  DN_OBC_Avg_t *DN_OBC_Avg,
794  QA_Refl_t *QA_refl);
795 
796  PGSt_SMF_status Fill_Band_26_DN_OBC_Avg
797  (int32 sd_id,
798  int32 num_scans,
799  int16 *MirrorSide,
800  refl_tables_t *refl_tables,
801  Moon_arrays_t *moon_arrays,
802  boolean Ecal_On[][NUM_BANDS],
803  DN_OBC_Avg_t *DN_OBC_Avg,
804  QA_Refl_t *QA_refl);
805 
806  PGSt_SMF_status Check_For_Moon_in_SV_KOB
807  (int32 num_scans,
808  common_QA_tables_t *common_QA_tables,
809  QA_Data_t *QA,
810  Moon_arrays_t *moon_arrays);
811 
812  PGSt_SMF_status Get_DN_Avg_SDev_Rejects
813  (int32 start_index,
814  int32 N,
815  int32 index_increment,
816  int16 *DN_array,
817  int16 DN_upper_valid_limit,
818  int16 DN_lower_valid_limit,
819  float32 *mean_DN,
820  float32 *sdev_DN,
821  int16 *rejects);
822 
823  PGSt_SMF_status Pack_Rejects_In_Outlier_Mask
824  (int32 N,
825  int16 *rejects,
826  uint32 *packed_rejects);
827 
828  PGSt_SMF_status Cross_Granule_Sliding_Average
829  (int32 num_overlapScans,
830  int32 num_scans_middle,
831  float32 *Xarray,
832  int16 *Xmir,
833  float32 *avg);
834 
835  PGSt_SMF_status Granule_Average_Temperature
836  (int32 num_values,
837  float32 *array,
838  float32 *avg);
839 
840  PGSt_SMF_status Get_Temp_Avg_And_Variance
841  (int32 N,
842  float32 *T,
843  float32 *avg,
844  float32 *var);
845 
846  PGSt_SMF_status Fill_Invalid_Temp_DNs
847  (int32 num_scans,
848  uint16 miss_DN,
849  uint16 sat_DN,
850  uint16 *DN);
851 
852  PGSt_SMF_status Adjust_dn_star_Min
853  (float32 *dn_star_Min,
854  int32 L1A_v_id,
855  int32 num_scans);
856 
857  PGSt_SMF_status Check_For_Ecal_On
858  (int32 lun,
859  int32 num_scans,
860  int32 v_id,
861  boolean Ecal_On[][NUM_BANDS]);
862 
863  PGSt_SMF_status Check_If_Sector_Rotated
864  (int32 lun,
865  int32 num_scans,
866  int32 v_id,
867  boolean Sector_Rotated[]);
868 
869  PGSt_SMF_status sort_int16_array
870  (int32 n,
871  int16 *a,
872  int32 *indx);
873 
874  PGSt_SMF_status Get_DN_Avg_SDev_Rejects_LowN
875  (int32 N_include,
876  int32 start_index,
877  int32 N,
878  int32 index_increment,
879  int16 *DN_array,
880  int16 DN_upper_valid_limit,
881  int16 DN_lower_valid_limit,
882  float32 *mean_DN,
883  float32 *sdev_DN,
884  int16 *rejects);
885 
886  PGSt_SMF_status Calculate_RVS_Correction
888  L1B_granule_t *L1B_Gran);
889 
890 
892  (int8 moon_in_SV_KOB,
893  int16 *BB,
894  int16 *SV,
896  float32 *xdnbb);
897 
899  (Overlap_OBCEng_t *Leading_OBCEng,
900  L1A_granule_OBCEng_t *L1A_OBCEng,
901  Overlap_OBCEng_t *Trailing_OBCEng,
903  Moon_arrays_t *moon_arrays,
904  float32 Xdn_bb_pvlw_xt[][NUM_PVLW_XT_BANDS][DETECTORS_PER_1KM_BAND]);
905 
906 
907 #endif
908 
909 
910 
integer, parameter int16
Definition: cubeio.f90:3
PGSt_SMF_status Write_Geo_OBC_SDS(int32 obc_sd_id, int32 num_scans)
Definition: Preprocess.c:5461
Engineering_Coefficients_t Engineering_Coefficients_PFM
Definition: PreprocessP.h:245
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of tables
Definition: HISTORY.txt:695
PGSt_SMF_status Check_For_Moon_in_SV_KOB(int32 num_scans, common_QA_tables_t *common_QA_tables, QA_Data_t *QA, Moon_arrays_t *moon_arrays)
Definition: Preprocess.c:6796
PGSt_SMF_status Get_Leading_Gran_Emiss_Coeff(Overlap_OBCEng_t *Leading_OBCEng, int16 B, int16 D, int16 D_emiss, Emiss_Cal_Coeff_t *RVS_Coeff, emiss_tables_t *tables, Moon_arrays_t *moon_arrays, float32 Xdn_bb_31[][DETECTORS_PER_1KM_BAND], float32 *Xb1, int16 *XMS, int32 satellite_ID)
Definition: Preprocess.c:1607
PGSt_SMF_status Calculate_Temp_QA(int32 num_scans, Temperatures_t *temps, QA_tables_t *tables, QA_Data_t *QA)
Definition: Preprocess.c:68
#define NUM_T_INS_THERMISTORS
Definition: L1B_Tables.h:415
PGSt_SMF_status Get_Temp_Avg_And_Variance(int32 N, float32 *T, float32 *avg, float32 *var)
Definition: Preprocess.c:3038
PGSt_SMF_status Calculate_Planck(float32 *RSR, float32 *wl, int16 size, float32 T, float32 *planck)
Definition: Preprocess.c:305
#define MAX_1KM_TRACK_DIM
Definition: Granule.h:456
PGSt_SMF_status Fill_Invalid_Temp_DNs(int32 num_scans, uint16 miss_DN, uint16 sat_DN, uint16 *DN)
Definition: Preprocess.c:3119
#define NUM_T_RC_VALUES
Definition: Granule.h:713
int N
Definition: Usds.c:60
PGSt_SMF_status Adjust_dn_star_Min(float32 *dn_star_Min, int32 L1A_v_id, int32 num_scans)
Definition: Preprocess.c:8102
PGSt_SMF_status Cross_Granule_Sliding_Average(int32 num_overlapScans, int32 num_scans_middle, float32 *Xarray, int16 *Xmir, float32 *avg)
Definition: Preprocess.c:2867
PGSt_SMF_status Copy_ScanMetadata(int32 in_sd_id, int32 out_sd_id, int32 num_scans)
Definition: Preprocess.c:6345
void Prepare_dn_bb_for_PVLW_XT_cor(Overlap_OBCEng_t *Leading_OBCEng, L1A_granule_OBCEng_t *L1A_OBCEng, Overlap_OBCEng_t *Trailing_OBCEng, emiss_tables_t *tables, Moon_arrays_t *moon_arrays, float32 Xdn_bb_pvlw_xt[][NUM_PVLW_XT_BANDS][DETECTORS_PER_1KM_BAND])
Definition: Preprocess.c:398
PGSt_SMF_status Get_Emiss_Coeff_Per_Scan(int8 moon_in_SV_KOB, int16 *BB, int16 *SV, int16 B, int16 D, int16 D_emiss, int16 MS, Emiss_Cal_Coeff_t *RVS_Coeff, emiss_tables_t *tables, float32 T_bb, float32 T_mir, float32 T_cav, float32 T_ins, float32 T_fp_lwir, float32 *Xdn_bb_31, float32 *Xb1, float32 *xdLbb, float32 *xdnbb, float32 *xLbb, float32 *xLcav, float32 *xdnsv, float32 *xdnsv_var, uint32 *sv_omask, float32 *SNR, int32 satellite_ID)
Definition: Preprocess.c:389
PGSt_SMF_status Fill_Band_26_DN_OBC_Avg(int32 sd_id, int32 num_scans, int16 *MirrorSide, refl_tables_t *refl_tables, Moon_arrays_t *moon_arrays, boolean Ecal_On[][NUM_BANDS], DN_OBC_Avg_t *DN_OBC_Avg, QA_Refl_t *QA_refl)
Definition: Preprocess.c:7864
void Compute_dn_bb_for_PVLW_XT_cor_Per_Scan(int8 moon_in_SV_KOB, int16 *BB, int16 *SV, emiss_tables_t *tables, float32 *xdnbb)
Definition: Preprocess.c:567
PGSt_SMF_status sort_int16_array(int32 n, int16 *a, int32 *indx)
Definition: Preprocess.c:8569
PGSt_SMF_status Read_L1A_OBCEng(emiss_tables_t *emiss_tables, L1A_granule_t *L1A_Gran, L1A_granule_OBCEng_t *L1A_OBCEng)
Definition: Preprocess.c:3426
#define DETECTORS_PER_1KM_BAND
Definition: Granule.h:438
#define NUM_PVLW_XT_BANDS
Definition: L1B_Tables.h:400
PGSt_SMF_status Get_Trailing_Gran_Emiss_Coeff(int32 num_scans_middle, Overlap_OBCEng_t *Trailing_OBCEng, int16 B, int16 D, int16 D_emiss, Emiss_Cal_Coeff_t *RVS_Coeff, emiss_tables_t *tables, Moon_arrays_t *moon_arrays, float32 Xdn_bb_31[][DETECTORS_PER_1KM_BAND], float32 *Xb1, int16 *XMS, int32 satellite_ID)
Definition: Preprocess.c:2098
const int NUM_BANDS
PGSt_SMF_status Fill_500m_DN_OBC_Avg(int32 sd_id, int32 num_scans, int16 *MirrorSide, refl_tables_t *refl_tables, Moon_arrays_t *moon_arrays, boolean Ecal_On[][NUM_BANDS], DN_OBC_Avg_t *DN_OBC_Avg, QA_Refl_t *QA_refl)
Definition: Preprocess.c:7279
#define MAX_OVERLAP_TRACK_DIM
Definition: PreprocessP.h:143
PGSt_SMF_status Get_Middle_Gran_Emiss_Coeff(L1A_granule_OBCEng_t *L1A_OBCEng, int16 B, int16 D, int16 D_emiss, Emiss_Cal_Coeff_t *RVS_Coeff, emiss_tables_t *tables, emiss_QA_tables_t *QA_tables, Moon_arrays_t *moon_arrays, float32 Xdn_bb_31[][DETECTORS_PER_1KM_BAND], float32 *Xb1, int16 *XMS, QA_Emiss_t *QA, Preprocess_Emiss_t *PP, DN_OBC_Avg_t *DN_OBC_Avg, int32 satellite_ID)
Definition: Preprocess.c:1839
PGSt_SMF_status Copy_EngMemData(int32 in_sd_id, int32 out_sd_id, int32 num_scans)
Definition: Preprocess.c:6006
PGSt_SMF_status Check_If_Sector_Rotated(int32 lun, int32 num_scans, int32 v_id, boolean Sector_Rotated[])
Definition: Preprocess.c:8416
#define VEC_DIM
Definition: PreprocessP.h:155
PGSt_SMF_status Granule_Average_Temperature(int32 num_values, float32 *array, float32 *avg)
Definition: Preprocess.c:2973
PGSt_SMF_status Read_Overlap_OBCEng(L1A_granule_t *L1A_Gran, emiss_tables_t *emiss_tables, PGSt_PC_Logical lun, Overlap_OBCEng_t *Overlap_OBCEng, boolean *scan_gap)
Definition: Preprocess.c:3660
PGSt_SMF_status Compute_BB_Temperature(emiss_tables_t *tables, int32 start_scan, int32 num_scans, uint16 *CP_index, uint16 **raw_BB_temp, int32 satellite_ID, Temperatures_t *temps)
Definition: Preprocess.c:5223
PGSt_SMF_status Process_OBCEng_Refl(int32 sd_id, int32 num_scans, float32 *T_ins, int16 *MirrorSide, refl_tables_t *refl_tables, Moon_arrays_t *moon_arrays, L1A_granule_OBCEng_t *L1A_OBCEng, DN_OBC_Avg_t *DN_OBC_Avg, QA_Refl_t *QA_refl, Preprocess_Refl_t *PP_Refl)
Definition: Preprocess.c:2713
PGSt_SMF_status Get_DN_Avg_SDev_Rejects(int32 start_index, int32 N, int32 index_increment, int16 *DN_array, int16 DN_upper_valid_limit, int16 DN_lower_valid_limit, float32 *mean_DN, float32 *sdev_DN, int16 *rejects)
Definition: Preprocess.c:2480
PGSt_SMF_status Calculate_RVS_Correction(lookup_tables_t *tables, L1B_granule_t *L1B_Gran)
Definition: Preprocess.c:8804
Engineering_Coefficients_t Engineering_Coefficients_FM1
Definition: PreprocessP.h:388
PGSt_SMF_status Copy_EngVdata(int32 in_v_id, int32 out_v_id)
Definition: Preprocess.c:6529
#define MAX_NUM_SCANS
Definition: Granule.h:422
PGSt_SMF_status Get_All_Emiss_Coeff(L1A_granule_OBCEng_t *L1A_OBCEng, int16 B, int16 D_emiss, float32 *Xb1, int16 *Xmir, emiss_tables_t *tables, emiss_QA_tables_t *QA_tables, QA_Emiss_t *QA, Preprocess_Emiss_t *PP)
Definition: Preprocess.c:2305
PGSt_SMF_status Copy_PixelQualityData(int32 in_sd_id, int32 out_sd_id, int32 num_scans)
Definition: Preprocess.c:6195
PGSt_SMF_status Fill_1km_day_DN_OBC_Avg(int32 sd_id, int32 num_scans, int16 *MirrorSide, refl_tables_t *refl_tables, Moon_arrays_t *moon_arrays, boolean Ecal_On[][NUM_BANDS], DN_OBC_Avg_t *DN_OBC_Avg, QA_Refl_t *QA_refl)
Definition: Preprocess.c:7576
PGSt_SMF_status Get_Electronics_index(int32 num_scans, uint16 *Electronics_pri, uint16 *Electronics_red, uint16 *Electronics_index)
Definition: Preprocess.c:3224
#define BB_1km_FRAMES
Definition: Granule.h:467
PGSt_SMF_status Process_OBCEng_Emiss(L1A_granule_t *L1A_Gran, L1A_granule_OBCEng_t *L1A_OBCEng, Emiss_Cal_Coeff_t *RVS_Coeff, emiss_tables_t *tables, QA_tables_t *QA_tables, Moon_arrays_t *moon_arrays, QA_Data_t *QA, Preprocess_Emiss_t *PP, DN_OBC_Avg_t *DN_OBC_Avg)
Definition: Preprocess.c:1094
#define SV_1km_FRAMES
Definition: Granule.h:468
PGSt_SMF_status Get_DN_Avg_SDev_Rejects_LowN(int32 N_include, int32 start_index, int32 N, int32 index_increment, int16 *DN_array, int16 DN_upper_valid_limit, int16 DN_lower_valid_limit, float32 *mean_DN, float32 *sdev_DN, int16 *rejects)
Definition: Preprocess.c:8631
#define NUM_1000M_NIGHT_BANDS
Definition: Granule.h:437
#define NUM_T_CAV_THERMISTORS
Definition: L1B_Tables.h:421
const int NUM_FOCAL_PLANES
PGSt_SMF_status Fill_250m_DN_OBC_Avg(int32 sd_id, int32 num_scans, int16 *MirrorSide, refl_tables_t *refl_tables, Moon_arrays_t *moon_arrays, boolean Ecal_On[][NUM_BANDS], DN_OBC_Avg_t *DN_OBC_Avg, QA_Refl_t *QA_refl)
Definition: Preprocess.c:6993
PGSt_SMF_status Write_L1B_OBCEng(L1A_granule_t *L1A_Gran, lookup_tables_t *tables, Moon_arrays_t *moon_arrays, DN_OBC_Avg_t *DN_OBC_Avg)
Definition: Preprocess.c:5608
PGSt_SMF_status Calculate_PP_Planck_Mir(int32 num_scans, emiss_tables_t *tables, Preprocess_Emiss_t *PP)
Definition: Preprocess.c:1539
PGSt_SMF_status Pack_Rejects_In_Outlier_Mask(int32 N, int16 *rejects, uint32 *packed_rejects)
Definition: Preprocess.c:2641
const int NUM_BB_THERMISTORS
PGE01 indicating that PGE02 PGE01 V6 for and PGE01 V2 for MOD03 were used to produce the granule By convention adopted in all MODIS Terra PGE02 code versions are The fourth digit of the PGE02 version denotes the LUT version used to produce the granule The source of the metadata environment variable ProcessingCenter was changed from a QA LUT value to the Process Configuration A sign used in error in the second order term was changed to a
Definition: HISTORY.txt:424
PGSt_SMF_status Check_For_Ecal_On(int32 lun, int32 num_scans, int32 v_id, boolean Ecal_On[][NUM_BANDS])
Definition: Preprocess.c:8207
int MS[]
Definition: Usds.c:106
void init_L1A_granule_OBCEng(L1A_granule_OBCEng_t *)
PGSt_SMF_status Read_Convert_Temperatures(emiss_tables_t *tables, int32 v_id, int32 start_scan, int32 num_scans, int32 satellite_ID, Temperatures_t *temps)
Definition: Preprocess.c:4610