OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l3binmerge.cpp
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <unistd.h>
3 #include <math.h>
4 #include <time.h>
5 #include <libgen.h>
6 #include <sys/types.h>
7 
8 #include "netcdf.h"
9 
10 #include "l3bin_input.h"
11 #include <timeutils.h>
12 #include <genutils.h>
13 
14 #include "hdf_bin.h"
15 
16 #include <hdf.h>
17 #include <mfhdf.h>
18 
19 #define MAXNFILES 128
20 
21 #define BYTE unsigned char
22 
23 #define BINCHECK -1
24 
25 #define VERSION "2.1"
26 
27 static instr input;
28 
29 extern "C" int l3bin_input(int argc, char **argv, instr *input, const char* prog, const char* version);
30 
31 /*
32 
33  Revision 2.1 12/5/2016
34  Updated with the CLO library
35  R. Healy
36 
37  Revision 2.0 08/29/2016
38  Converted to 64 bit integer version
39  R. Healy
40 
41  Revision 1.03 06/19/2014
42  Added support for netCDF4 files
43  S. Bailey
44 
45  Revision 1.02 08/16/12
46  Add "-u" switch (Union of input bins)
47  J. Gales
48 
49  Revision 1.01 03/21/12
50  Replace last_prod with prod_offset[]
51  J. Gales
52 
53  Revision 1.00 03/18/12
54  Initial Version
55  J. Gales
56  */
57 
58 
59 int main(int argc, char **argv) {
60  intn i;
61 
62  int32_t irow;
63  int32_t kbin;
64  int32_t iprod;
65 
66  int32_t ifile, nfiles;
67 
68  int32_t nread;
69  int32_t offset;
70  int32_t offset_out;
71  int32_t offmin;
72  int32_t offmax;
73  int64_t bin_num;
74  int64_t bin_num_out;
75  int32_t row_write;
76  int32_t n_write_total = 0;
77  int32_t n_write = 0;
78  int32_t nprod[MAXNFILES];
79  int32_t ncols;
80  int32_t ncols_out;
81 
82  int32_t nrows;
83 
84  float wgt;
85  float *sort_array[MAXNVDATA];
86 
87  char buf[FILENAME_MAX];
88 
89  float *in_sum_buf[MAXNVDATA - 2];
90  float *out_sum_buf[MAXNVDATA - 2];
91 
92  int status;
93 
94  char *ptime = ydhmsf(now(), 'G');
95  char proc_con[2048];
96 
97  char prodname[MAXNVDATA - 2][FILENAME_MAX];
98 
99  float f32;
100 
101  float minlon;
102  float maxlon;
103  float minlat;
104  float maxlat;
105 
106  float lat;
107 
108  time_t tnow;
109  struct tm *tmnow;
110 
111  FILE *fp;
112 
113  uint8 *nfiles_contribute;
114 
116 
117  printf("%s %s (%s %s)\n", "L3BINMERGE", VERSION, __DATE__, __TIME__);
118 
119  if (l3bin_input(argc, argv, &input, "l3binmerge", VERSION) != 0) {
120  exit(EXIT_FAILURE);
121  }
122 
123  // get_time(ptime);
124 
125  input.unit_wgt = 1;
126  bool case_u = input.union_bins;
127 
128  strcpy(proc_con, argv[0]);
129  for (i = 1; i < argc; i++) {
130  strcat(proc_con, " ");
131  strcat(proc_con, argv[i]);
132  }
133 
134  if (input.loneast <= input.lonwest) {
135  printf("loneast: %f must be greater than lonwest: %f.\n", input.loneast,
136  input.lonwest);
137  exit(EXIT_FAILURE);
138  }
139 
140  if (input.latnorth <= input.latsouth) {
141  printf("latnorth: %f must be greater than latsouth: %f.\n",
142  input.latnorth, input.latsouth);
143  exit(EXIT_FAILURE);
144  }
145 
146  /* Get lon/lat limits */
147  minlon = input.lonwest;
148  maxlon = input.loneast;
149  minlat = input.latsouth;
150  maxlat = input.latnorth;
151 
152  /* Determine number of input files */
153  /* ------------------------------- */
154  nfiles = 0;
155 
156  bool isHDF4 = false;
157  bool isHDF5 = false;
158  bool isCDF4 = false;
159 
160  Hdf::hdf_bin * input_binfile[MAXNFILES];
161 
162  fp = fopen(input.infile, "r");
163  if (fp == NULL) {
164  printf("Input listing file: \"%s\" not found.\n", input.infile);
165  return -1;
166  }
167  while (fgets(buf, 256, fp) != NULL)
168  nfiles++;
169  fclose(fp);
170  printf("%d input files\n", nfiles);
171 
172  /* Open L3 input files */
173  /* ------------------- */
174  uint32_t tot_nprod = 0;
175  uint32_t prod_offset[256];
176  fp = fopen(input.infile, "r");
177  for (ifile = 0; ifile < nfiles; ifile++) {
178  fgets(buf, 256, fp);
179  buf[strlen(buf) - 1] = 0;
180 
181  if (ifile == 0) {
182  if (Hishdf(buf) == TRUE)
183  isHDF4 = true;
184  if (H5Fis_hdf5(buf) == TRUE) {
185  int ncid;
186  char nam_buf[256];
187  status = nc_open(buf, NC_NOWRITE, &ncid);
188  if (status != NC_NOERR) {
189  isHDF5 = true;
190  } else {
191  status = nc_get_att(ncid, NC_GLOBAL, "Mission", nam_buf);
192  if (strcmp(nam_buf, "SAC-D Aquarius") == 0) {
193  isHDF5 = true;
194  } else {
195  isCDF4 = true;
196  }
197  nc_close(ncid);
198  }
199  }
200  }
201 
202  if (isHDF4)
203  input_binfile[ifile] = new Hdf::hdf4_bin;
204  if (isHDF5)
205  input_binfile[ifile] = new Hdf::hdf5_bin;
206  if (isCDF4)
207  input_binfile[ifile] = new Hdf::cdf4_bin;
208 
209  if (ifile == 0)
210  prod_offset[ifile] = 0;
211  else
212  prod_offset[ifile] = prod_offset[ifile - 1] + nprod[ifile - 1];
213 
214  printf("%d %s\n", ifile, buf);
215  input_binfile[ifile]->open(buf);
216  nprod[ifile] = input_binfile[ifile]->nprod();
217  for (iprod = 0; iprod < nprod[ifile]; iprod++) {
218  input_binfile[ifile]->get_prodname(iprod, prodname[tot_nprod]);
219  input_binfile[ifile]->active_data_prod[iprod] = true;
220  ;
221  tot_nprod++;
222  }
223  //printf("open status: %d\n", status);
224 
225  } /* ifile loop */
226 
227  fclose(fp);
228 
229  nrows = input_binfile[0]->nrows;
230 
231  /* Create output file */
232  /* ------------------ */
233  Hdf::hdf_bin *output_binfile;
234 
235  if (getFileFormatName(input.oformat) == NULL) {
236  if (isHDF4)
237  strcpy(input.oformat, "HDF4");
238  if (isHDF5)
239  strcpy(input.oformat, "HDF5");
240  if (isCDF4)
241  strcpy(input.oformat, "netCDF4");
242  }
243 
244  strcpy(buf, input.ofile);
245 
246  if (strcmp(input.oformat, "HDF4") == 0) {
247  output_binfile = new Hdf::hdf4_bin;
248  output_binfile->hasNoext = false;
249  if (input.noext == 0)
250  strcat(buf, ".main");
251  else
252  output_binfile->hasNoext = true;
253  }
254  if (strcmp(input.oformat, "HDF5") == 0)
255  output_binfile = new Hdf::hdf5_bin;
256  if (strcmp(input.oformat, "netCDF4") == 0)
257  output_binfile = new Hdf::cdf4_bin;
258 
259  char* tmpProdNames[tot_nprod];
260  for (uint32_t i = 0; i < tot_nprod; i++) {
261  tmpProdNames[i] = prodname[i];
262  }
263  output_binfile->setProductList(tot_nprod, tmpProdNames);
264  output_binfile->create(buf, nrows);
265  if (isCDF4)
266  output_binfile->deflate = input.deflate;
267 
268  if (input.noext == 0)
269  strcat(buf, ".main");
270 
271  /* Allocate I/O buffers */
272  /* -------------------- */
273  ncols = 2 * nrows;
274  ncols_out = 2 * nrows;
275 
276  for (iprod = 0; iprod < (int) tot_nprod; iprod++) {
277  in_sum_buf[iprod] = (float *) calloc(ncols, 2 * sizeof (float));
278  out_sum_buf[iprod] = (float *) calloc(ncols_out, 2 * sizeof (float));
279  } /* iprod loop */
280 
281  nfiles_contribute = (uint8 *) calloc(ncols_out, sizeof (uint8));
282 
283  /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
284  /* For each scan ... (Main Loop) */
285  /* ----------------------------- */
286  for (irow = 0; irow < nrows; irow++) {
287 
288  if ((irow % 500) == 0) {
289  time(&tnow);
290  tmnow = localtime(&tnow);
291  printf("irow:%6d of %8d %s", irow, nrows, asctime(tmnow));
292  }
293 
294  // Get basebin and numbin for this input row
295  int64_t basebin = input_binfile[0]->get_basebin(irow);
296  int64_t numbin = input_binfile[0]->get_numbin(irow);
297 
298  /* Clear output binlist and sum buffers */
299  /* ------------------------------------ */
300  row_write = 0;
301 
302  output_binfile->clear_binlist();
303  for (iprod = 0; iprod < (int32_t) tot_nprod; iprod++) {
304  memset(&out_sum_buf[iprod][0], 0, ncols_out * 2 * sizeof (float));
305  } /* iprod loop */
306 
307  if (case_u) {
308  for (iprod = 0; iprod < (int32_t) tot_nprod; iprod++) {
309  for (i = 0; i < ncols_out * 2; i++) {
310  out_sum_buf[iprod][i] = -32767.0;
311  }
312  }
313  }
314 
315  memset(nfiles_contribute, 0, ncols_out * sizeof (uint8));
316 
317  /* Get bin info */
318  /* ------------ */
319  for (ifile = 0; ifile < nfiles; ifile++) {
320  input_binfile[ifile]->readBinIndex(irow);
321 
322  int ext = input_binfile[ifile]->get_ext();
323  if (ext == 0)
324  continue;
325 
326  /* Read BinList */
327  /* ------------ */
328  nread = input_binfile[ifile]->readBinList(ext);
329 
330  if (nread == -1) {
331  printf("Unable to read bin numbers...: %d\n", ext);
332  }
333  } /* ifile loop */
334 
335  /* For each file ... */
336  /* ----------------- */
337  for (ifile = 0; ifile < nfiles; ifile++) {
338 
339  int64_t beg = input_binfile[ifile]->get_beg();
340  int ext = input_binfile[ifile]->get_ext();
341 
342  /* ========== If row has data ... ========== */
343  /* ----------------------------------------- */
344  if (beg != 0) {
345  /* printf("row has data: %d\n", irow);*/
346 
347  /* Determine lon kbin limits */
348  /* ------------------------- */
349  offmin = (int32_t) ((minlon + 180) * (numbin / 360.0) + 0.5);
350  offmax = (int32_t) ((maxlon + 180) * (numbin / 360.0) + 0.5);
351 
352  /* Get data values (sum, sum_sq) for each filled bin in row */
353  /* -------------------------------------------------------- */
354  int nbins_to_read = ext;
355  for (iprod = 0; iprod < nprod[ifile]; iprod++) {
356  input_binfile[ifile]->readSums(&in_sum_buf[iprod][0],
357  nbins_to_read, iprod);
358  } /* iprod loop */
359 
360  if (isHDF5 || isCDF4)
361  input_binfile[ifile]->setDataPtr(nbins_to_read);
362  // row_write = 1;
363 
364  /* Skip row if not between minlat & maxlat */
365  lat = ((irow + 0.5) / nrows) * 180.0 - 90.0;
366  if (lat < minlat || lat > maxlat) {
367  // row_write = 0;
368  continue;
369  }
370 
371  /* Fill output buffers with input bin data */
372  /* --------------------------------------- */
373  for (kbin = 0; kbin < ext; kbin++) {
374 
375  /* Store bin number */
376  /* ---------------- */
377  bin_num = input_binfile[ifile]->get_bin_num(kbin);
378  offset = bin_num - basebin;
379 
380  /* If bin outside lon range then skip */
381  /* ---------------------------------- */
382  if (offset < offmin || offset > offmax)
383  continue;
384 
385  float weights = input_binfile[ifile]->get_weights(kbin);
386 
387  /* Skip if not good enough */
388  /* ----------------------- */
389  // Assign output offset & bin number
390  offset_out = offset;
391  bin_num_out = bin_num;
392 
393  if (offset_out >= ncols_out) {
394  printf("Bad write to BINLIST: %d %d %d %d\n", ifile,
395  irow, ncols_out, offset_out);
396  exit(EXIT_FAILURE);
397  }
398 
399  nfiles_contribute[offset_out]++;
400 
401  output_binfile->set_bin_num(offset_out, bin_num_out);
402  row_write = 1;
403 
404  /* Sum & store number of observations,nscenes */
405  /* ------------------------------------------ */
406  int nobs = input_binfile[ifile]->get_nobs(kbin);
407  output_binfile->inc_nobs(offset_out, nobs);
408  int nscenes = input_binfile[ifile]->get_nscenes(kbin);
409  output_binfile->inc_nscenes(offset_out, nscenes);
410 
411  /* Sum & store weights */
412  /* ------------------- */
413  if (input.unit_wgt || input.median) {
414  output_binfile->set_weights(offset_out, 1);
415  } else {
416  output_binfile->inc_weights(offset_out, weights);
417  }
418 
419  /* Product loop */
420  /* ------------ */
421  for (iprod = 0; iprod < nprod[ifile]; iprod++) {
422  if (input.unit_wgt) {
423  wgt = weights;
424  f32 = in_sum_buf[iprod][2 * kbin];
425  if (out_sum_buf[prod_offset[ifile] + iprod][2
426  * offset_out] == -32767.0) {
427  out_sum_buf[prod_offset[ifile] + iprod][2
428  * offset_out] = f32 / wgt;
429  out_sum_buf[prod_offset[ifile] + iprod][2
430  * offset_out + 1] = (f32 / wgt)
431  * (f32 / wgt);
432  } else {
433  out_sum_buf[prod_offset[ifile] + iprod][2
434  * offset_out] += f32 / wgt;
435  out_sum_buf[prod_offset[ifile] + iprod][2
436  * offset_out + 1] += (f32 / wgt)
437  * (f32 / wgt);
438  }
439  } else {
440  /* Add new sum to accumulated sum & sum2 */
441  /* ------------------------------------- */
442  f32 = in_sum_buf[iprod][2 * kbin];
443  if (out_sum_buf[prod_offset[ifile] + iprod][2
444  * offset_out] == -32767.0) {
445  out_sum_buf[prod_offset[ifile] + iprod][2
446  * offset_out] = f32;
447  } else {
448  out_sum_buf[prod_offset[ifile] + iprod][2
449  * offset_out] += f32;
450  }
451 
452  f32 = in_sum_buf[iprod][2 * kbin + 1];
453  if (out_sum_buf[prod_offset[ifile] + iprod][2
454  * offset_out + 1] == -32767.0) {
455  out_sum_buf[prod_offset[ifile] + iprod][2
456  * offset_out + 1] = f32;
457  } else {
458  out_sum_buf[prod_offset[ifile] + iprod][2
459  * offset_out + 1] += f32;
460  }
461  } /* input.unit_wgt */
462  } /* product loop */
463 
464  } /* kbin loop */
465 
466  } /* ========== if row has data ========== */
467 
468  } /* ifile loop */
469 
470  /* Write output vdatas */
471  /* ------------------- */
472  if (row_write) {
473 
474  n_write = 0;
475  for (kbin = 0; kbin < output_binfile->get_numbin(irow); kbin++) {
476 
477  bin_num = output_binfile->get_bin_num(kbin);
478 
479  if (bin_num != 0) {
480 
481  // Skip rows where not all files contribute
482  if ((nfiles_contribute[bin_num - basebin] != nfiles)
483  and !case_u)
484  continue;
485 
486  /* Loop over data products */
487  /* ----------------------- */
488  for (iprod = 0; iprod < (int32_t) tot_nprod; iprod++) {
489 
490  /* Remove "blank" bin records */
491  /* -------------------------- */
492  if (n_write != kbin)
493  memcpy(&out_sum_buf[iprod][2 * n_write],
494  &out_sum_buf[iprod][2 * kbin], 8);
495  } /* iprod loop */
496 
497  /* Remove "blank" bin records */
498  /* -------------------------- */
499  if (n_write != kbin)
500  output_binfile->copy_binlist(kbin, n_write);
501 
502  n_write++;
503  n_write_total++;
504 
505  } /* bin_num != 0 */
506  } /* kbin loop */
507 
508  /* Write BinList & Data Products */
509  /* ----------------------------- */
510  if (n_write > 0) {
511  output_binfile->writeBinList(n_write);
512 
513  for (iprod = 0; iprod < (int32_t) tot_nprod; iprod++) {
514  strcpy(buf, prodname[iprod]);
515  output_binfile->writeSums(&out_sum_buf[iprod][0], n_write,
516  buf);
517  }
518  if (isHDF5 || isCDF4)
519  output_binfile->incNumRec(n_write);
520  }
521  }
522  // if median free storage arrays
523  if (input.median) {
524  for (iprod = 0; iprod < (int32_t) tot_nprod; iprod++) {
525  free(sort_array[iprod]);
526  }
527  }
528 
529  } /* irow loop */
530  /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
531 
532  for (iprod = 0; iprod < (int32_t) tot_nprod; iprod++) {
533  free(in_sum_buf[iprod]);
534  free(out_sum_buf[iprod]);
535  } /* iprod loop */
536 
537  free(nfiles_contribute);
538 
539  // Copy metadata from input to output binfile
540  strcpy(buf, input.ofile);
541  strcpy(output_binfile->meta_l3b.product_name, buf);
542 
543  input.tflag = toupper(input.tflag);
544  if (input.tflag == 'D') {
545  strcpy(output_binfile->meta_l3b.prod_type, "day");
546  } else if (input.tflag == 'W') {
547  strcpy(output_binfile->meta_l3b.prod_type, "8-day");
548  } else if (input.tflag == 'M') {
549  strcpy(output_binfile->meta_l3b.prod_type, "month");
550  } else if (input.tflag == 'Y') {
551  strcpy(output_binfile->meta_l3b.prod_type, "year");
552  } else if (input.tflag == 'O') {
553  strcpy(output_binfile->meta_l3b.prod_type, "other");
554  }
555  strcpy(output_binfile->meta_l3b.pversion, input.pversion);
556  strcpy(output_binfile->meta_l3b.soft_name, "L3BINMERGE");
557  strcpy(output_binfile->meta_l3b.soft_ver, VERSION);
558  strcpy(output_binfile->meta_l3b.proc_con, proc_con);
559  strcpy(output_binfile->meta_l3b.input_parms, input.parms);
560 
561  char buf2[5000];
562  if (Hishdf(input.infile) == TRUE || H5Fis_hdf5(input.infile) == TRUE) {
563  strcpy(buf2, input.infile);
564  } else {
565  fp = fopen(input.infile, "r");
566  buf2[0] = 0;
567  for (ifile = 0; ifile < nfiles; ifile++) {
568  fgets(buf, 256, fp);
569  buf[strlen(buf) - 1] = 0;
570 
571  strcat(buf2, buf);
572  strcat(buf2, ",");
573  } /* ifile loop */
574  fclose(fp);
575  buf2[strlen(buf2) - 1] = 0;
576  }
577  strcpy(output_binfile->meta_l3b.infiles, buf2);
578 
579  output_binfile->copymeta(nfiles, &input_binfile[0]);
580 
581  if (strcmp(input.oformat, "netCDF4") == 0) {
582  ptime = unix2isodate(now(), 'G');
583  strcpy(output_binfile->meta_l3b.ptime, ptime);
584  // if (!input_binfile[0]->isCDF4){
585  // int stimez = zulu2unix(output_binfile->meta_l3b.stime);
586  // strcpy( output_binfile->meta_l3b.stime,unix2isodate(stimez,'G'));
587  // int etimez = zulu2unix(output_binfile->meta_l3b.etime);
588  // strcpy( output_binfile->meta_l3b.etime, unix2isodate(etimez,'G'));
589  // }
590  } else {
591  strcpy(output_binfile->meta_l3b.ptime, ptime);
592  }
593 
594  for (ifile = 0; ifile < nfiles; ifile++)
595  input_binfile[ifile]->close();
596  output_binfile->close();
597 
598  return 0;
599 }
600 
char * ydhmsf(double dtime, char zone)
Definition: ydhmsf.c:12
virtual int64_t get_bin_num(int kbin)=0
virtual int get_nobs(int kbin)=0
char product_name[SM_ATTRSZ]
Definition: meta_l3b.h:16
uint8_t isHDF5
Definition: get_l3m.c:8
int status
Definition: l1_czcs_hdf.c:32
virtual int readSums(float *sums, int32_t nbins_to_read, int iprod)=0
virtual void setProductList(int numProducts, char *prodNames[])
Definition: bin_io.cpp:2807
char infiles[LG_ATTRSZ]
Definition: meta_l3b.h:38
virtual int inc_weights(int offset, float weights)=0
#define NULL
Definition: decode_rs.h:63
virtual int create(const char *l3b_filename, int32_t nrows)=0
char input_parms[LG_ATTRSZ]
Definition: meta_l3b.h:36
#define TRUE
Definition: rice.h:165
float * lat
float tm[MODELMAX]
virtual int close()=0
virtual int64_t get_numbin(int irow)
Definition: hdf_bin.h:72
bool active_data_prod[MAXNVDATA]
Definition: hdf_bin.h:121
virtual int64_t get_beg()=0
virtual int copy_binlist(int src, int dest)=0
virtual int get_nscenes(int kbin)=0
int32_t nobs
Definition: atrem_cor.h:93
instr * input
int setlinebuf(FILE *stream)
virtual int get_ext()=0
bool hasNoext
Definition: hdf_bin.h:127
virtual int set_weights(int offset, float weights)=0
virtual int copymeta(int32_t nfiles, Hdf::hdf_bin *input_binfile[])
Definition: bin_io.cpp:2874
const char * getFileFormatName(const char *str)
int l3bin_input(int argc, char **argv, instr *input, const char *prog, const char *version)
Definition: l3bin_input.c:336
virtual int64_t get_basebin(int irow)
Definition: hdf_bin.h:76
char prod_type[SM_ATTRSZ]
Definition: meta_l3b.h:29
int32_t nrows
Definition: hdf_bin.h:119
virtual int32_t nprod()
Definition: hdf_bin.h:108
meta_l3bType meta_l3b
Definition: hdf_bin.h:131
int32 nrows
===========================================================================V5.0.48(Terra) 03/20/2015 Changes shown below are differences from MOD_PR02 V5.0.46(Terra)============================================================================Changes noted for V6.1.20(Terra) below were also instituted for this version.============================================================================V6.1.20(Terra) 03/12/2015 Changes shown below are differences from MOD_PR02 V6.1.18(Terra)============================================================================Changes from v6.1.18 which may affect scientific output:A situation can occur in which a scan which contains sector rotated data has a telemetry value indicating the completeness of the sector rotation. This issue is caused by the timing of the instrument command to perform the sector rotation and the recording of the telemetry point that reports the status of sector rotation. In this case a scan is considered valid by L1B and pass through the calibration - reporting extremely high radiances. Operationally the TEB calibration uses a 40 scan average coefficient, so the 20 scans(one mirror side) after the sector rotation are contaminated with anomalously high radiance values. A similar timing issue appeared before the sector rotation was fixed in V6.1.2. Our analysis indicates the ‘SET_FR_ENC_DELTA’ telemetry correlates well with the sector rotation encoder position. The use of this telemetry point to determine scans that are sector rotated should fix the anomaly occured before and after the sector rotation(usually due to the lunar roll maneuver). The fix related to the sector rotation in V6.1.2 is removed in this version.============================================================================V6.1.18(Terra) 10/01/2014 Changes shown below are differences from MOD_PR02 V6.1.16(Terra)============================================================================Added doi attributes to NRT(Near-Real-Time) product.============================================================================V6.1.16(Terra) 01/27/2014 Changes shown below are differences from MOD_PR02 V6.1.14(Terra)============================================================================Migrate to SDP Toolkit 5.2.17============================================================================V6.1.14(Terra) 06/26/2012 Changes shown below are differences from MOD_PR02 V6.1.12(Terra)============================================================================Added the doi metadata to L1B product============================================================================V6.1.12(Terra) 04/25/2011 Changes shown below are differences from MOD_PR02 V6.1.8(Terra)============================================================================1. The algorithm to calculate uncertainties for reflective solar bands(RSB) is updated. The current uncertainty in L1B code includes 9 terms from prelaunch analysis. The new algorithm regroups them with the new added contributions into 5 terms:u1:the common term(AOI and time independent) and
Definition: HISTORY.txt:126
virtual int open(const char *l3b_filename)=0
int main(int argc, char **argv)
Definition: l3binmerge.cpp:59
virtual int incNumRec(int n_write)=0
virtual int writeSums(float *sums, int32_t nbins_to_write, const char *prodname)=0
virtual int setDataPtr(int nbins_to_read)=0
virtual int get_prodname(int iprod, char *prodname)
Definition: bin_io.cpp:2802
char proc_con[MD_ATTRSZ]
Definition: meta_l3b.h:35
int16 ncols[121]
virtual int inc_nobs(int offset, int nobs)=0
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 offsets between the high resolution geolocation and a bi linear interpolation extrapolation of the positions This can be used to reconstruct the high resolution geolocation Resolved Bug by delaying cumulation of gflags until after validation of derived products Resolved Bug by setting Latitude and Longitude to the correct fill resolving to support Near Real Time because they may be unnecessary if use of entrained ephemeris and attitude data is turned resolving bug report Corrected to filter out Aqua attitude records with missing status helping resolve bug MOD_PR03 will still correctly write scan and pixel data that does not depend upon the start time
Definition: HISTORY.txt:248
char soft_ver[SM_ATTRSZ]
Definition: meta_l3b.h:33
u5 which has been done in the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT production Changes from v6 which may affect scientific the sector rotation may actually occur during one of the scans earlier than the one where it is first reported As a the b1 values are about the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT to fill pixels affected by dead subframes with a special value Output the metadata of noisy and dead subframe Dead Subframe EV and Detector Quality Flag2 Removed the function call of Fill_Dead_Detector_SI to stop interpolating SI values for dead but also for all downstream products for science test only Changes from v5 which will affect scientific to conform to MODIS requirements Removed the Mixed option from the ScanType in the code because the L1A Scan Type is never Mixed Changed for ANSI C compliance and comments to better document the fact that when the HDF_EOS metadata is stricly the and products are off by and in the track respectively Corrected some misspelling of RCS swir_oob_sending_detector to the Reflective LUTs to enable the SWIR OOB correction detector so that if any of the sending detectors becomes noisy or non near by good detectors from the same sending band can be specified as the substitute in the new look up table Code change for adding an additional dimension of mirror side to the Band_21_b1 LUT to separate the coefficient of the two mirror sides for just like other thermal emissive so that the L1B code can calibrate Band scan to scan with mirror side dependency which leads better calibration result Changes which do not affect scientific when the EV data are not provided in this Crosstalk Correction will not be performed to the Band calibration data Changes which do not affect scientific and BB_500m in L1A Logic was added to turn off the or to spatial aggregation processes and the EV_250m_Aggr1km_RefSB and EV_500m_Aggr1km_RefSB fields were set to fill values when SDSs EV_250m and EV_500m are absent in L1A file Logic was added to skip the processing and turn off the output of the L1B QKM and HKM EV data when EV_250m and EV_500m are absent from L1A In this the new process avoids accessing and reading the and L1A EV skips and writing to the L1B and EV omits reading and subsampling SDSs from geolocation file and writing them to the L1B and omits writing metadata to L1B and EV and skips closing the L1A and L1B EV and SDSs Logic was added to turn off the L1B OBC output when the high resolution OBC SDSs are absent from L1A This is accomplished by skipping the openning the writing of metadata and the closing of the L1B OBC hdf which is Bit in the scan by scan bit QA has been changed Until now
Definition: HISTORY.txt:361
char * unix2isodate(double dtime, char zone)
Definition: unix2isodate.c:10
int16_t * nscenes
Definition: l2bin.cpp:86
#define MAXNVDATA
#define VERSION
Definition: l3binmerge.cpp:25
#define MAXNFILES
Definition: l3binmerge.cpp:19
virtual int set_bin_num(int offset, int64_t bin_num)=0
char ptime[SM_ATTRSZ]
Definition: meta_l3b.h:34
virtual int clear_binlist()=0
char pversion[SM_ATTRSZ]
Definition: meta_l3b.h:30
virtual int readBinIndex(int row_num_to_read)=0
l2prod offset
virtual int readBinList(int nbins_to_read)=0
int i
Definition: decode_rs.h:71
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
virtual int inc_nscenes(int offset, int nscenes)=0
char soft_name[SM_ATTRSZ]
Definition: meta_l3b.h:32
uint32_t deflate
Definition: hdf_bin.h:129
float32 f32
Definition: l2bin.cpp:104
version
Definition: setup.py:15
virtual float get_weights(int kbin)=0
virtual int writeBinList(int32_t nbins_to_write)=0