OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_cal_misc.c
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2  File : get_cal_misc.c
3 
4  Contents:
5  get_ref_time - reads reference time
6  get_tindex - reads time vdata and returns appropriate index to
7  access data
8  read_parm_data - reads parameter data
9  calc_knees - calculates knee1,2,3 and 4 counts and radiances
10  setup_scanmod - sets up the scan-modulation correction factor array
11  for GAC data
12  attach_vdata - attaches to the requested vdata
13  rdvdata - reads requested data from the given vdata
14  sort_srad - sorts saturated radiances and returns ordered
15  indices
16  read_SDS - reads the requested SDS
17 
18  Other relevant files:
19  cal.h - various #defined constants, TDI table, and also
20  includes hdf.h
21  getcal_proto.h - prototypes for get_cal functions
22  get_cal.c - a higher layer of calibration input functions
23 
24  Notes:
25 
26  Modification history:
27  Programmer Organization Date Description of change
28  -------------- ------------ -------- ---------------------
29  Lakshmi Kumar Hughes STX 03/11/94 Original development
30  Lakshmi Kumar Hughes STX 06/07/94 Updated to reflect v3.1
31  interface spcifications
32  Lakshmi Kumar Hughes STX 03/21/96 Corrected non-prototype
33  declarations
34  Lakshmi Kumard Hughes STX 03/17/97 Removed non-ANSI proto
35  declarations. In-detector
36  offsets are redefined as
37  idoffs[8][16].
38 ------------------------------------------------------------------------------*/
39 
40 #include "get_cal.h"
41 #include "getcal_proto.h"
42 #include "hdf4utils.h"
43 
44 #include <hdf.h>
45 #include <mfhdf.h>
46 
47 
48 /*-----------------------------------------------------------------------------
49  Function: get_tindex
50 
51  Returns: int32 (status)
52  Returns status
53 
54  Description:
55  The function get_ref_time reads reference date and time from the
56  input calibration table.
57 
58  Arguments: (in calling order)
59  Type Name I/O Description
60  ---- ---- --- -----------
61  int32 sdfid I SD file ID
62  int16 ref_year I Reference Year
63  int16 ref_day I Reference Day
64  int16 ref_min I Reference Minute
65 
66  Notes:
67 
68  Modification history:
69  Programmer Organization Date Description of change
70  -------------- ------------ -------- ---------------------
71  Lakshmi Kumar Hughes STX 05/22/96 Original development
72 ------------------------------------------------------------------------------*/
73 int32_t get_ref_time(int32_t sdfid, int16_t *ref_year, int16_t *ref_day, int16_t *ref_min) {
74  int32_t attrnum;
75 
76  attrnum = SDfindattr(sdfid, REFYEAR);
77  if ((SDreadattr(sdfid, attrnum, ref_year)) < 0)
78  return FAIL;
79 
80  attrnum = SDfindattr(sdfid, REFDAY);
81  if ((SDreadattr(sdfid, attrnum, ref_day)) < 0)
82  return FAIL;
83 
84  attrnum = SDfindattr(sdfid, REFMIN);
85  if ((SDreadattr(sdfid, attrnum, ref_min)) < 0)
86  return FAIL;
87 
88  return SUCCEED;
89 }
90 
91 /*-----------------------------------------------------------------------------
92  Function: get_tindex
93 
94  Returns: int32 (index)
95  On successful it returns the index of the given time entry and if
96  time entry not found, returns -3.
97 
98  Description:
99  The function get_tindex reads time vdata and searches for the
100  given time entry. If the given time found, it rerurns the entry
101  number to access related information from slopes and parameter vdatas.
102 
103  Arguments: (in calling order)
104  Type Name I/O Description
105  ---- ---- --- -----------
106  int32 fid I file ID
107  int16 syear I year of data start time
108  int16 sday I day-of-year for data start time
109  int16 eday I day-of-year for data end time
110  int32 smsec I milliseconds-of-day for data start time
111  int16 *cal_year O year the cal entry was made
112  int16 *cal_day O day of the year the cal entry was made
113 
114  Notes:
115 
116  Modification history:
117  Programmer Organization Date Description of change
118  -------------- ------------ -------- ---------------------
119  Lakshmi Kumar Hughes STX 03/11/94 Original development
120  Lakshmi Kumar Hughes STX 06/07/94 Updated to reflect v3.1
121  interface spcifications
122  Lakshmi Kumar Hughes STX 02/07/94 Added code to return
123  cal entry year and day
124  (ref to I/O specs v4.2)
125  Gene Eplee SAIC GSC 05/11/98 Fix for eyear-syear = 1
126  W. Robinson, SAIC 10/16/03 re-cast the index computation
127  to fix a time problem
128 ------------------------------------------------------------------------------*/
129 
130 int32_t get_tindex(int32_t fid, int16_t syear, int16_t sday, int16_t eday, int32_t msec,
131  int16_t *cal_year, int16_t *cal_day) {
132 
133  int16 dyear, dday, *cal_syear, *cal_sday, *cal_eyear, *cal_eday;
134  int16 *entry_year, *entry_day, ahead;
135  int32_t i, *cal_smsec, *cal_emsec, vsid, elts;
136 
137  if ((vsid = attach_vdata(fid, TIME)) < 0)
138  return RDERR;
139 
140  if ((elts = VSelts(vsid)) < 0)
141  return RDERR;
142 
143  if ((cal_syear = (int16 *) malloc(elts * sizeof (int16))) == NULL)
144  return BUFERR;
145 
146  if ((cal_eyear = (int16 *) malloc(elts * sizeof (int16))) == NULL)
147  return BUFERR;
148 
149  if ((cal_sday = (int16 *) malloc(elts * sizeof (int16))) == NULL)
150  return BUFERR;
151 
152  if ((cal_eday = (int16 *) malloc(elts * sizeof (int16))) == NULL)
153  return BUFERR;
154 
155  if ((cal_smsec = (int32_t *) malloc(elts * sizeof (int32_t))) == NULL)
156  return BUFERR;
157 
158  if ((cal_emsec = (int32_t *) malloc(elts * sizeof (int32_t))) == NULL)
159  return BUFERR;
160 
161  if ((entry_year = (int16 *) malloc(elts * sizeof (int16))) == NULL)
162  return BUFERR;
163 
164  if ((entry_day = (int16 *) malloc(elts * sizeof (int16))) == NULL)
165  return BUFERR;
166 
167  rdvdata(vsid, SYEAR, 0, elts, (unsigned char *) cal_syear);
168  rdvdata(vsid, SDAY, 0, elts, (unsigned char *) cal_sday);
169  rdvdata(vsid, SMSEC, 0, elts, (unsigned char *) cal_smsec);
170 
171  rdvdata(vsid, EYEAR, 0, elts, (unsigned char *) cal_eyear);
172  rdvdata(vsid, EDAY, 0, elts, (unsigned char *) cal_eday);
173  rdvdata(vsid, EMSEC, 0, elts, (unsigned char *) cal_emsec);
174 
175  rdvdata(vsid, ENTRY_YEAR, 0, elts, (unsigned char *) entry_year);
176  rdvdata(vsid, ENTRY_DAY, 0, elts, (unsigned char *) entry_day);
177 
178  dyear = syear;
179  dday = sday;
180  if (sday != eday && msec < 43200000)
181  dday = eday;
182  if (dday < sday)
183  dyear += 1;
184 
185  for (i = elts - 1; i > 0; i--) {
186  if (cal_eyear[i] == 0) /* onwards rec */ {
187  if (dyear > cal_syear[i])
188  break;
189  if (dyear == cal_syear[i] && dday > cal_sday[i])
190  break;
191  if (dyear == cal_syear[i] && dday == cal_sday[i] &&
192  msec >= cal_smsec[i])
193  break;
194  } else /* not an onwards rec */ {
195  ahead = 0;
196  if (dyear > cal_syear[i])
197  ahead = 1;
198  else if ((dyear == cal_syear[i]) && (dday > cal_sday[i]))
199  ahead = 1;
200  else if ((dyear == cal_syear[i]) && (dday == cal_sday[i]) &&
201  (msec >= cal_smsec[i]))
202  ahead = 1;
203 
204  if (ahead == 1) {
205  if (dyear < cal_eyear[i])
206  break;
207  else if ((dyear == cal_eyear[i]) && (dday < cal_eday[i]))
208  break;
209  else if ((dyear == cal_eyear[i]) && (dday == cal_eday[i]) &&
210  (msec <= cal_emsec[i]))
211  break;
212  }
213  }
214  } /* end for loop */
215  *cal_year = entry_year[i];
216  *cal_day = entry_day[i];
217 
218  VSdetach(vsid);
219  free(cal_syear);
220  free(cal_sday);
221  free(cal_smsec);
222  free(cal_eyear);
223  free(cal_eday);
224  free(cal_emsec);
225  free(entry_year);
226  free(entry_day);
227 
228  if (i <= 0)
229  return TMERR;
230  else
231  return i;
232 }
233 
234 /*-----------------------------------------------------------------------------
235  Function: read_parm_data
236 
237  Returns: int32 (Status)
238  On success returns 0, otherwise returns -2 indicating read error.
239  Description:
240  The function attaches to the requested vdata
241 
242  Arguments: (in calling order)
243  Type Name I/O Description
244  ---- ---- --- -----------
245  int32 fid I HDF file ID
246  int32 sdfid I HDF SD file ID
247  int32 index I element number
248  int32 idoffs[8][16] O detector zero offset counts
249  float32 gains[8][16] O slopes (band*detector*gains)
250  float32 fp_temps[256][8] O fp temperatures
251  float32 scan_mod[2][1285] O scan-modulation buffer
252  float64 tfactor_const[8] O time correction constant term
253  float64 tfactor_linear[8] O time correction linear term
254  float64 tfactor_exponential[8] O time correction exponential term
255  float64 cal_offset[8] O offset term
256  float64 inst_tcorr[8] O instrument temp correction term
257  float64 fp_tcorr[8] O fp temp correction term
258  float64 mside1_const[8] O mirror side1 constant term
259  float64 mside2_const[8] O mirror side2 constant term
260  float64 mside1_linear[8] O mirror side1 linear term
261  float64 mside2_linear[8] O mirror side2 linear term
262  int16 tdi_list[256][4] O TDI values for all 8 bands
263 
264  Notes:
265 
266  Modification history:
267  Programmer Organization Date Description of change
268  -------------- ------------ -------- ---------------------
269  Lakshmi Kumar Hughes STX 03/11/94 Original development
270  Lakshmi Kumar Hughes STX 06/07/94 Updated to reflect v3.1
271  interface spcifications
272  Gene Eplee SAIC GSC 12/07/00 Update time correction and
273  mirror correction terms
274  Gene Eplee SAIC 03/09/04 Convert time correction and
275  mirror correction terms
276  to simultaneous exponentials.
277  Gene Eplee SAIC 07/26/06 Add focal plane
278  temperatures and
279  instrument electronics
280  temperature corrections.
281  Gene Eplee SAIC 06/27/2007 Added focal plane and
282  instrument electronics
283  reference temperatures
284 -----------------------------------------------------------------------------*/
285 int32_t read_parm_data(int32_t fid, int32_t sdfid, int32_t index, int32_t idoffs[8][16],
286  float gains[8][16], float fp_temps[256][8],
287  float scan_mod[2][1285], double *tfactor_const,
288  double *tfactor_linear_1, double *tfactor_exponential_1,
289  double *tfactor_linear_2, double *tfactor_exponential_2,
290  double *cal_offset, double *inst_tcorr, double *inst_tref,
291  double *fp_tcorr, double *fp_tref, double *mside1_const,
292  double *mside1_linear_1, double *mside1_exponential_1,
293  double *mside1_linear_2, double *mside1_exponential_2,
294  double *mside2_const, double *mside2_linear_1,
295  double *mside2_exponential_1, double *mside2_linear_2,
296  double *mside2_exponential_2, int16_t tdi_list[256][4]) {
297 
298  int32_t i, slpid, parmid;
299  float64 mirror_buf[8][10], tfactor_buf[8][10];
300 
301  for (i = 0; i < BANDS; i++) {
302  if ((slpid = attach_vdata(fid, slp_names[i])) < 0)
303  return RDERR;
304  if ((rdvdata(slpid, slp_flds, index, 1, (unsigned char *) gains[i])) < 0)
305  return RDERR;
306  VSdetach(slpid);
307 
308  if ((parmid = attach_vdata(fid, parm_names[i])) < 0)
309  return RDERR;
310 
311  if ((rdvdata(parmid, OFFSET_FLDS, index, 1,
312  (unsigned char *) idoffs[i])) < 0) return RDERR;
313 
314  if ((rdvdata(parmid, TFACTOR_FLDS_NEW, index, 1,
315  (unsigned char *) tfactor_buf[i])) < 0) return RDERR;
316 
317  if ((rdvdata(parmid, MIRROR_FLDS, index, 1,
318  (unsigned char *) mirror_buf[i])) < 0) return RDERR;
319 
320  VSdetach(parmid);
321  }
322 
323  for (i = 0; i < BANDS; i++) {
324  tfactor_const[i] = tfactor_buf[i][0];
325  tfactor_linear_1[i] = tfactor_buf[i][1];
326  tfactor_exponential_1[i] = tfactor_buf[i][2];
327  tfactor_linear_2[i] = tfactor_buf[i][3];
328  tfactor_exponential_2[i] = tfactor_buf[i][4];
329  cal_offset[i] = tfactor_buf[i][5];
330  inst_tcorr[i] = tfactor_buf[i][6];
331  inst_tref[i] = tfactor_buf[i][7];
332  fp_tcorr[i] = tfactor_buf[i][8];
333  fp_tref[i] = tfactor_buf[i][9];
334  mside1_const[i] = mirror_buf[i][0];
335  mside1_linear_1[i] = mirror_buf[i][1];
336  mside1_exponential_1[i] = mirror_buf[i][2];
337  mside1_linear_2[i] = mirror_buf[i][3];
338  mside1_exponential_2[i] = mirror_buf[i][4];
339  mside2_const[i] = mirror_buf[i][5];
340  mside2_linear_1[i] = mirror_buf[i][6];
341  mside2_exponential_1[i] = mirror_buf[i][7];
342  mside2_linear_2[i] = mirror_buf[i][8];
343  mside2_exponential_2[i] = mirror_buf[i][9];
344  }
345 
346  if ((read_SDS(sdfid, TDILIST, (void *) tdi_list)) < 0)
347  return RDERR;
348 
349  if ((read_SDS(sdfid, FPTEMPS, (void *) fp_temps)) < 0)
350  return RDERR;
351 
352  if ((read_SDS(sdfid, SCANMOD, (void *) scan_mod)) < 0)
353  return RDERR;
354 
355  return SUCCEED;
356 }
357 
358 /*-----------------------------------------------------------------------------
359  Function: calc_knees
360 
361  Returns: void
362 
363  Description:
364  The function calc_knees calculates knee1,2,3 and 4 counts and
365  radiances. It also calculates zero offset counts.
366 
367  Arguments: (in calling order)
368  Type Name I/O Description
369  ---- ---- --- -----------
370  int16 * tdi I input TDI values for all 8 bands
371  int16 tdi_list[256][4] I TDI Detector combination table
372  int32 idoffs[8][16] I input detector offsets
373  float32 gains[8][16] I input gains
374  float32 counts[8][4][5] O Digital counts corresponding to each knee
375  float32 rads[8][4][5] O Radiances corrsponding to each knee
376 
377  Notes:
378 
379  Modification history:
380  Programmer Organization Date Description of change
381  -------------- ------------ -------- ---------------------
382  Lakshmi Kumar Hughes STX 03/11/94 Original development
383  Lakshmi Kumar Hughes STX 06/07/94 Updated to reflect v3.1
384  interface spcifications
385  W. Robinson, GSC, 13 May 97 remove double incriment of l in
386  slopes, cnts calculation
387 
388 ------------------------------------------------------------------------------*/
389 void calc_knees(int16_t *tdi, int16_t tdi_list[256][4], int32_t idoffs[8][16],
390  float gains[8][16], float counts[8][4][5],
391  float rads[8][4][5]) {
392 
393  int16 dets[4];
394  int32_t i, j, k, l;
395  int32_t scnts[4]; /* saturation counts */
396  float32 srads[4]; /* saturation radiance */
397  float32 loc_slopes[4];
398  float32 slopes[BANDS][4][4];
399  int32_t cnts[BANDS][4][4];
400  int32_t oindex[DETS];
401 
402 
403  for (i = 0; i < BANDS; i++)
404  for (j = 0, l = 0; j < 4; j++)
405  for (k = 0; k < 4; k++) {
406  /* slopes[i][j][k] = gains[i][l++]; */
407  slopes[i][j][k] = gains[i][l];
408  cnts[i][j][k] = idoffs[i][l++];
409  }
410 
411  for (i = 0; i < BANDS; i++) {
412  for (j = 0; j < 4; j++)
413  dets[j] = tdi_list[tdi[i]][j] - 1;
414  for (j = 0; j < GAINS; j++) {
415  for (k = 0; k < DETS; k++) {
416  scnts[k] = 1023 - cnts[i][j][dets[k]];
417  srads[k] = scnts[k] * slopes[i][j][dets[k]];
418  loc_slopes[k] = slopes[i][j][dets[k]];
419  }
420 
421  sort_srads(srads, oindex);
422 
423  rads[i][j][0] = 0;
424  for (k = 1; k < 5; k++)
425  rads[i][j][k] = srads[oindex[k - 1]];
426 
427  counts[i][j][0] = 0;
428  counts[i][j][1] = (scnts[oindex[0]] +
429  srads[oindex[0]] / loc_slopes[oindex[1]] +
430  srads[oindex[0]] / loc_slopes[oindex[2]] +
431  srads[oindex[0]] / loc_slopes[oindex[3]]) / 4.0;
432 
433  counts[i][j][2] = (scnts[oindex[0]] + scnts[oindex[1]] +
434  srads[oindex[1]] / loc_slopes[oindex[2]] +
435  srads[oindex[1]] / loc_slopes[oindex[3]]) / 4.0;
436 
437  counts[i][j][3] = (scnts[oindex[0]] + scnts[oindex[1]] +
438  scnts[oindex[2]] +
439  srads[oindex[2]] / loc_slopes[oindex[3]]) / 4.0;
440 
441  counts[i][j][4] = (scnts[oindex[0]] + scnts[oindex[1]] +
442  scnts[oindex[2]] + scnts[oindex[3]]) / 4.0;
443 
444  }
445  }
446 }
447 
448 /*-----------------------------------------------------------------------------
449  Function: setup_scanmod
450 
451  Returns: void
452 
453  Description:
454  Set up the scan-modulation correction factor array for GAC data.
455  These factors are stored in the calibration table for an entire LAC
456  scan line.
457 
458  Arguments: (in calling order)
459  Type Name I/O Description
460  ---- ---- --- -----------
461  char * dtype I data type (GAC, LAC, ...)
462  float32 * scan_mod I/O scan modulation correction factors
463 
464  Notes:
465 
466  Modification history:
467  Programmer Organization Date Description of change
468  -------------- ------------ -------- ---------------------
469  Lakshmi Kumar Hughes STX 06/07/94 Original development
470  Lakshmi Kumar Hughes STX 03/21/96 Made it compatible for
471  non ANSI compilation
472  Joel Gales Futuretech 10/02/00 Use npix, nsta (start),
473  and ninc (stride) to
474  perform subsetting and
475  subsampling of scan_mod
476 ------------------------------------------------------------------------------*/
477 
478 void setup_scanmod(int32_t npix, int32_t nsta, int32_t ninc,
479  float scan_mod[2][1285]) {
480  int32_t pixel;
481 
482  for (pixel = 0; pixel < npix; pixel++) {
483  scan_mod[0][pixel] = scan_mod[0][(nsta - 1) + ninc * pixel];
484  scan_mod[1][pixel] = scan_mod[1][(nsta - 1) + ninc * pixel];
485  }
486 
487 #ifdef DEBUG
488  printf("\n\n--------- GAC scan_mod values --------------\n");
489  for (pixel = 0; pixel <= 247; pixel++) {
490  printf("%4d\t%f\t%f\n", pixel, scan_mod[0][pixel], scan_mod[1][pixel]);
491 #endif
492  }
493 
494  /*-----------------------------------------------------------------------------
495  Function: sort_srad
496 
497  Returns: void
498 
499  Description:
500  The function sort_srad sorts the given saturation radiances and
501  returns the ordered indices.
502 
503  Arguments: (in calling order)
504  Type Name I/O Description
505  ---- ---- --- -----------
506  float32 * srads I saturation radiances
507  int32 * oindex O ordered indecies representing order
508  of saturation radiances
509  Notes:
510 
511  Modification history:
512  Programmer Organization Date Description of change
513  -------------- ------------ -------- ---------------------
514  Lakshmi Kumar Hughes STX 06/07/94 Original development
515 
516  ------------------------------------------------------------------------------*/
517  void sort_srads(float *srads, int32_t * oindex) {
518  int32_t i, done = 0, exchange = 0, loc_index[DETS], temp_index;
519  float32 loc_srads[DETS], temp;
520 
521  for (i = 0; i < DETS; i++) {
522  loc_index[i] = i;
523  loc_srads[i] = srads[i];
524  }
525 
526  while (!done) {
527  for (exchange = 0, i = 0; i < DETS - 1; i++)
528  if (loc_srads[i] > loc_srads[i + 1]) {
529  exchange = 1;
530  temp = loc_srads[i];
531  temp_index = loc_index[i];
532  loc_srads[i] = loc_srads[i + 1];
533  loc_index[i] = loc_index[i + 1];
534  loc_srads[i + 1] = temp;
535  loc_index[i + 1] = temp_index;
536  }
537  if (!exchange)
538  done = 1;
539  }
540 
541  for (i = 0; i < DETS; i++)
542  oindex[i] = loc_index[i];
543 
544  }
545 
546 
547 
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 it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
integer, parameter int16
Definition: cubeio.f90:3
float rads[BANDS_DIMS_1A][GAINS_DIMS_1A][KNEES_DIMS_1A]
Definition: l1a_seawifs.c:47
double fp_tcorr[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:57
int16 eday
Definition: l1_czcs_hdf.c:17
int j
Definition: decode_rs.h:73
#define SCANMOD
Definition: calib_get_cal.h:19
#define EYEAR
Definition: regen.h:37
#define GAINS
Definition: calib_get_cal.h:10
#define SYEAR
Definition: regen.h:34
#define FAIL
Definition: ObpgReadGrid.h:18
#define NULL
Definition: decode_rs.h:63
#define SDAY
Definition: regen.h:35
int16_t entry_year
Definition: l1a_seawifs.c:39
int attach_vdata(int32_t fid, const char *sname)
#define DETS
Definition: calib_get_cal.h:9
int32 * msec
Definition: l1_czcs_hdf.c:31
uint8 * counts
Definition: l1_czcs_hdf.c:30
double fp_tref[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:58
int syear
Definition: l1_czcs_hdf.c:15
int32_t read_parm_data(int32_t fid, int32_t sdfid, int32_t index, int32_t idoffs[8][16], float gains[8][16], float fp_temps[256][8], float scan_mod[2][1285], double *tfactor_const, double *tfactor_linear_1, double *tfactor_exponential_1, double *tfactor_linear_2, double *tfactor_exponential_2, double *cal_offset, double *inst_tcorr, double *inst_tref, double *fp_tcorr, double *fp_tref, double *mside1_const, double *mside1_linear_1, double *mside1_exponential_1, double *mside1_linear_2, double *mside1_exponential_2, double *mside2_const, double *mside2_linear_1, double *mside2_exponential_1, double *mside2_linear_2, double *mside2_exponential_2, int16_t tdi_list[256][4])
Definition: get_cal_misc.c:285
int16_t entry_day
Definition: l1a_seawifs.c:40
int sday
Definition: l1_czcs_hdf.c:15
int32 nsta
Definition: l1_czcs_hdf.c:27
void sort_srads(float *srads, int32_t *oindex)
Definition: get_cal_misc.c:517
void setup_scanmod(int32_t npix, int32_t nsta, int32_t ninc, float scan_mod[2][1285])
Definition: get_cal_misc.c:478
#define EMSEC
Definition: regen.h:39
#define FPTEMPS
Definition: get_cal.h:16
int32_t get_tindex(int32_t fid, int16_t syear, int16_t sday, int16_t eday, int32_t msec, int16_t *cal_year, int16_t *cal_day)
Definition: get_cal_misc.c:130
#define REFDAY
Definition: calib_get_cal.h:22
int32 ninc
Definition: l1_czcs_hdf.c:28
#define SMSEC
Definition: regen.h:36
double inst_tcorr[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:55
int16_t tdi[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:37
int32_t get_ref_time(int32_t sdfid, int16_t *ref_year, int16_t *ref_day, int16_t *ref_min)
Definition: get_cal_misc.c:73
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution pixel
Definition: HISTORY.txt:192
int16_t ref_day
Definition: l1a_seawifs.c:42
float fp_temps[256][BANDS_DIMS_1A]
Definition: l1a_seawifs.c:44
#define REFMIN
Definition: calib_get_cal.h:23
double inst_tref[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:56
int rdvdata(int32_t vskey, const char *fields, int32_t start, int32_t nelt, unsigned char *databuf)
int32_t read_SDS(int32_t sdfid, const char *sds_name, void *buffer)
#define EDAY
Definition: regen.h:38
#define ENTRY_YEAR
Definition: calib_get_cal.h:24
#define ENTRY_DAY
Definition: calib_get_cal.h:25
int16_t ref_year
Definition: l1a_seawifs.c:41
float scan_mod[2][1285]
Definition: l1a_seawifs.c:45
#define TIME
Definition: calib_get_cal.h:12
#define TMERR
Definition: calib_get_cal.h:14
#define REFYEAR
Definition: calib_get_cal.h:21
void calc_knees(int16_t *tdi, int16_t tdi_list[256][4], int32_t idoffs[8][16], float gains[8][16], float counts[8][4][5], float rads[8][4][5])
Definition: get_cal_misc.c:389
int i
Definition: decode_rs.h:71
#define TDILIST
Definition: calib_get_cal.h:18
#define BUFERR
Definition: calib_get_cal.h:15
#define RDERR
Definition: l2brsgen.h:22
int k
Definition: decode_rs.h:73
int npix
Definition: get_cmp.c:27
#define BANDS