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