OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l3stat_chk.c
Go to the documentation of this file.
1 #include <time.h>
2 #include <math.h>
3 #include <hdf4utils.h>
4 #include "l3stat.h"
5 #include "l3lists.h"
6 #include "l3stat_proto.h"
7 #include "hist_proto.h"
8 
9 #include <hdf.h>
10 #include <mfhdf.h>
11 
12 static int32_t stat_status = 0; /* status of statistical checking: 0 all good,
13  1 program problem, 2 statistical problem,
14  3 both problems */
15 
16 #define NEG_FLAG -9.1E6
17 
18 int main(int argc, char *argv[])
19 /*******************************************************************
20 
21  l3stat_chk
22 
23  purpose: open the SeaWiFS level 3 dataset and checks the data values
24  against given thresholds
25 
26  Returns type: none
27 
28  Parameters: (in calling order)
29  Type Name I/O Description
30  ---- ---- --- -----------
31  int argc I count of input args
32  char * argv[] I args: [1] hdf file
33  [2] controls file
34 
35  Modification history:
36  Programmer Date Description of change
37  ---------- ---- ---------------------
38  L. Kumar 07/19/1996 Original development
39  W. Robinson 24 Nov 1997 Make the climatology optional
40 
41  *******************************************************************/ {
42  char ptype[MAXVAL];
43  int32_t fid, sdfid, c_fid, c_sdfid;
44  int32_t nbins, c_nbins, wtchk;
45  cntl_str databinchk[1], grschk[NPARAMS], statchk[NPARAMS];
46  clim_str climchk[NFLAGS];
47 
48  clock_t val = 0, val3 = 0;
49 
50  val = (float) clock() / CLOCKS_PER_SEC;
51  c_fid = 0;
52  c_sdfid = 0;
53  c_nbins = 0;
54  nbins = 0;
55 
56  /*
57  * Check input arguments
58  */
59 
60  if (argc != 4 && argc != 3) {
61  printf("\n***** Usage: l3stat_chk <l3 bin file> <control file> ");
62  printf("[<climatology bin file>]\n\n");
63  printf(" <l3 bin file> is level 3 bin data file\n");
64  printf(" <control file> is the file specifying thresholds\n");
65  printf(" [<climatology bin file>] full name of optional clim bin file ");
66  printf("\n\nOn exit, $status will be set to: \n\n 0 - no problems,"
67  "\n 1 - program error, ");
68  printf("\n 2 - data problem, \n 3 - both program and data problem\n");
71  }
72 
73  printf("\n\n# Statistical Check of Dataset '%s'\n\n", argv[1]);
74 
75  /*
76  * hopen will open the file and read data descriptor blocks
77  * to memory
78  */
79 
80  if ((fid = Hopen(argv[1], DFACC_RDONLY, 0)) < 0) {
81  printf("****** l3stat_chk: Failed on the Hopen of \n '%s'\n", argv[1]);
82  stat_status = 1;
84  }
85 
86  if (argc == 4) {
87  if ((c_fid = Hopen(argv[3], DFACC_RDONLY, 0)) < 0) {
88  printf("****** l3stat_chk: Failed on the Hopen of \n '%s'\n", argv[3]);
89  stat_status = 1;
91  }
92  }
93 
94  /*
95  * Vstart initializes vgroup interface
96  */
97 
98  Vstart(fid);
99  if (c_fid != 0) Vstart(c_fid);
100 
101  /*
102  * SDstart opens the hdf interface and initiates SD interface
103  */
104 
105  if ((sdfid = SDstart(argv[1], DFACC_RDONLY)) < 0) {
106  printf("******* l3stat_chk: Failure at SDstart of \n'%s'\n", argv[1]);
107  Hclose(fid);
108  stat_status = 1;
110  }
111 
112  if (c_fid != 0) {
113  if ((c_sdfid = SDstart(argv[3], DFACC_RDONLY)) < 0) {
114  printf("******* l3stat_chk: Failure at SDstart of \n'%s'\n", argv[3]);
115  Hclose(fid);
116  Hclose(c_fid);
117  stat_status = 1;
119  }
120  }
121 
122  /*
123  * Read control file and save the information. If the return value
124  * is -1, it means, some prolblem with opening control data file or
125  * with some control format, close HDF file, and exit with status set
126  * to 1 indicating program error.
127  */
128 
129  if ((read_cntldata(argv[2], databinchk, grschk, statchk, &wtchk, climchk))
130  < 0) {
131  Hclose(fid);
133  }
134 
135  /*
136  * Verify if given input file is a level 3 file
137  */
138 
139  if (l3file(sdfid, c_sdfid, &nbins, &c_nbins, ptype) < 0) {
140  Hclose(fid);
142  }
143 
144  /*
145  * Check percent data bins against the given thresholds
146  */
147 
148  if (databinchk[0].param && (strcmp(ptype, "scene") != 0))
149  if ((chk_databin(sdfid, databinchk)) < 0) {
150  Hclose(fid);
151  if (c_fid != 0) Hclose(c_fid);
153  }
154 
155  /*
156  * Do a weight check
157  */
158 
159  if (wtchk)
160  if (chk_weight(fid, nbins) < 0) {
161  Hclose(fid);
162  if (c_fid != 0) Hclose(c_fid);
164  }
165 
166  /*
167  * initialize the histogram accumulation
168  */
169  h_init(argv[1]);
170 
171  /*
172  * Do a gross value, general statistics and climatology check
173  */
174 
175  if ((l3data_chk(argv[3], fid, c_fid, nbins, c_nbins, grschk, statchk,
176  climchk)) < 0)
178 
179  /*
180  * Free allocated resources and close files
181  */
182 
183  SDend(sdfid);
184  Vend(fid);
185  Hclose(fid);
186 
187  if (c_fid != 0) {
188  SDend(c_sdfid);
189  Vend(c_fid);
190  Hclose(c_fid);
191  }
192 
193  val3 = (float) clock() / CLOCKS_PER_SEC;
194  printf("\n\n# Time took for %s = %d secs\n", argv[0], (int) (val3 - val));
195 
197  return 0;
198 }
199 
200 /****************************************************************************
201  read_cntldata
202 
203  purpose: Opens given control file and reads in the mnemonics and thresholds
204  given. If any error occurs, prints out an error message,
205  sets stat_status field and returns a negative 1.
206 
207  Returns type: integer
208 
209  Parameters: (in calling order)
210  Type Name I/O Description
211  ---- ---- --- -----------
212  char * cntl_file I control file path/name
213  cntl_str * databinchk O structure to hold databin
214  check thresholds
215  cntl_str * grschk O structure to hold control
216  data related to gross checking
217  cntl_str * statchk O structure to hold control
218  data related to general stat
219  check
220  flag_str * climchk O structure to hold climatology
221  check thresholds
222 
223  Modification history:
224  Programmer Date Description of change
225  ---------- ---- ---------------------
226  L. Kumar 07/19/1996 Original development
227 
228  ****************************************************************************/
229 int32_t read_cntldata(char *cntl_file, cntl_str *databinchk, cntl_str *grschk,
230  cntl_str *statchk, int32_t *wtchk, clim_str *climchk) {
231  FILE *fid;
232  char line[501], str[25];
233  int32_t i, param, nflds = 0;
234 
235  printf("\n# Reading control file '%s'\n\n", cntl_file);
236 
237  /*
238  * Open the file
239  */
240  if ((fid = fopen(cntl_file, "r")) == NULL) {
241  printf("\n****read_cntldata: Unable to open control file:\n '%s'\n",
242  cntl_file);
243  stat_status = stat_status | 1;
244  return FAIL;
245  }
246 
247  /*
248  * Initialize all input structrues
249  */
250 
251  *wtchk = 0;
252  databinchk[0].param = databinchk[0].err_thresh = 0;
253  databinchk[0].low_thresh = databinchk[0].high_thresh = 0;
254  for (i = 0; i < NPARAMS; i++) {
255  grschk[i].param = statchk[i].param = 0;
256  grschk[i].err_thresh = statchk[i].err_thresh = 0;
257  grschk[i].low_thresh = statchk[i].low_thresh = 0;
258  grschk[i].high_thresh = statchk[i].high_thresh = 0;
259  climchk[i].param = 0;
260  climchk[i].thresh1H = climchk[i].thresh2H = climchk[i].thresh3H = 0;
261  climchk[i].thresh1L = climchk[i].thresh2L = climchk[i].thresh3L = 0;
262  }
263 
264  /*
265  * Read control file one line at a time
266  */
267  while (fgets(line, 500, fid) != NULL) {
268  /* Ignore beginning blanks and tabs */
269  for (i = 0; i < 500 && (line[i] == ' ' || line[i] == '\t'); i++);
270 
271  /* If first character is '#' sign, then treat the line as comment */
272  if (i < 500 && line[i] == '#') {
273  printf("%s", line);
274  continue;
275  }
276 
277  /* If not comment, check if it is Gross CHK info */
278  printf("#%s", line);
279  if (strncmp(&line[i], "L3DAT", 5) == 0) {
280  if ((nflds = sscanf(line, "%s %f %f", str, &databinchk[0].low_thresh,
281  &databinchk[0].high_thresh)) != 3)
282  return (pr_error(str, 2, nflds - 1));
283  databinchk[0].param = 1;
284  } else if (strncmp(&line[i], "L3WT", 4) == 0)
285  *wtchk = 1;
286  else if (strncmp(&line[i], "L3GCHK", 6) == 0) {
287  param = atoi(&line[6]);
288  if (param < 1 || param > NPARAMS) {
289  printf("********read_cntldata: Error in parameter number.");
290  printf(" Parameter # read = %d", param);
291  stat_status = stat_status | 1;
292  return FAIL;
293  }
294  if ((nflds = sscanf(line, "%s %f %f %f", str,
295  &grschk[param - 1].err_thresh, &grschk[param - 1].low_thresh,
296  &grschk[param - 1].high_thresh)) != 4)
297  return (pr_error(str, 3, nflds - 1));
298  grschk[param - 1].param = 1;
299  } else if (strncmp(&line[i], "L3STAT", 6) == 0) {
300  param = atoi(&line[6]);
301  if (param < 1 || param > NPARAMS) {
302  printf("********read_cntldata: Error in param number.");
303  printf(" Parameter # read = %d", param);
304  stat_status = stat_status | 1;
305  return FAIL;
306  }
307  statchk[param - 1].param = 1;
308  } else if (strncmp(&line[i], "L3CCHK", 6) == 0) {
309  param = atoi(&line[6]);
310  if (param < 1 || param > NPARAMS) {
311  printf("********read_cntldata: Error in param number.");
312  printf(" Parameter # read = %d", param);
313  stat_status = stat_status | 1;
314  return FAIL;
315  }
316  if ((nflds = sscanf(line, "%s %f %f %f %f %f %f", str,
317  &climchk[param - 1].thresh1L, &climchk[param - 1].thresh1H,
318  &climchk[param - 1].thresh2L, &climchk[param - 1].thresh2H,
319  &climchk[param - 1].thresh3L, &climchk[param - 1].thresh3H)) < 7)
320  return (pr_error(str, 6, nflds - 1));
321  climchk[param - 1].param = 1;
322  }
323  }
324  fclose(fid);
325  return SUCCEED;
326 }
327 
328 /****************************************************************************
329  l3file
330 
331  purpose: Verifies if the given input file is level 3 bin data file
332 
333  Returns type: integer
334 
335  Parameters: (in calling order)
336  Type Name I/O Description
337  ---- ---- --- -----------
338  int32 sdfid I SD interface ID
339  int32 * nbins I No. of bins containing data
340 
341  Modification history:
342  Programmer Date Description of change
343  ---------- ---- ---------------------
344  L. Kumar 07/19/1996 Original development
345 
346  ****************************************************************************/
347 int32_t l3file(int32_t sdfid, int32_t c_sdfid, int32_t *nbins, int32_t *c_nbins,
348  char *ptype) {
349  char title[1024];
350 
351  /*
352  * Read title to verify if the given input file is level 3 bin data file
353  */
354 
355  if ((rdattr(sdfid, TITLE, &title)) < 0)
356  return FAIL;
357 
358  if (strcmp(title, "SeaWiFS Level-3 Binned Data") != 0) {
359  printf("l3file: Data file is not level 3 bin file");
360  stat_status = stat_status | 1;
361  return FAIL;
362  }
363 
364  if ((rdattr(sdfid, "Data Bins", (VOIDP) nbins)) < 0)
365  return FAIL;
366 
367  if (c_sdfid != 0) {
368  if ((rdattr(c_sdfid, "Data Bins", (VOIDP) c_nbins)) < 0)
369  return FAIL;
370  }
371 
372  if ((rdattr(sdfid, "Product Type", ptype)) < 0)
373  return FAIL;
374 
375  printf("\n# Data containing bins = %d", *nbins);
376  printf("\n\n# Data containing bins in climatology file = %d", *c_nbins);
377 
378  return SUCCEED;
379 }
380 
381 /****************************************************************************
382  chk_databin
383 
384  purpose: Reads 'Percent Data Bins' global attribute value and verifies
385  it against the given low and high error thresholds and outputs
386  the results.
387 
388  Returns type: integer
389 
390  Parameters: (in calling order)
391  Type Name I/O Description
392  ---- ---- --- -----------
393  int32_t sdfid I SD interface ID
394  cntl_str * databinchk I structure containing bin
395  percentage thresholds
396  Modification history:
397  Programmer Date Description of change
398  ---------- ---- ---------------------
399  L. Kumar 07/19/1996 Original development
400 
401  ****************************************************************************/
402 int32_t chk_databin(int32_t sdfid, cntl_str *databinchk) {
403  int32_t flag = 0;
404  float32 pctbins = 0;
405 
406  if ((rdattr(sdfid, "Percent Data Bins", &pctbins)) < 0)
407  return FAIL;
408 
409  if (pctbins > databinchk[0].high_thresh)
410  flag = 1;
411  else if (pctbins < databinchk[0].low_thresh)
412  flag = -1;
413 
414  /*
415  * Print headers for Data bin percentage check results
416  */
417 
418  printf("\n\n#Mnemonic Flag %%data bins Err_low_thr Err_high_thr");
419  printf("\n#----------------------------------------------------\n");
420 
421  printf("\nL3DAT %8d %12.6f %12.6f %12.6f", flag, pctbins,
422  databinchk[0].low_thresh, databinchk[0].high_thresh);
423 
424  if (flag)
425  stat_status = stat_status | 2;
426 
427  return SUCCEED;
428 }
429 
430 /****************************************************************************
431  chk_weight
432 
433  purpose: Reads 'Percent Data Bins' global attribute value and verifies
434  it against the given low and high error thresholds and outputs
435  the results.
436 
437  Returns type: integer
438 
439  Parameters: (in calling order)
440  Type Name I/O Description
441  ---- ---- --- -----------
442  int32_t sdfid I SD interface ID
443  cntl_str * databinchk I structure containing bin
444  percentage thresholds
445  Modification history:
446  Programmer Date Description of change
447  ---------- ---- ---------------------
448  L. Kumar 07/19/1996 Original development
449 
450  ****************************************************************************/
451 int32_t chk_weight(int32_t fid, int32_t nbins) {
452  int32_t vsref, vsid, val = 0, flag = 0;
453  int32_t start = 0, elts = 0, ret;
454  float32 wt_buf[BUFSZ];
455 
456  /* Find Vdata with name "BinList" */
457  if ((vsref = VSfind(fid, "BinList")) < 0) {
458  printf("\nchk_weight: VSfind failed for vdata 'BinList'");
459  stat_status = stat_status | 1;
460  return FAIL;
461  }
462 
463  /* Attach to a vdata using the given vsid */
464  if ((vsid = VSattach(fid, vsref, "r")) < 0) {
465  printf("\nchk_weight: VSattach failed for vdata 'BinList'");
466  stat_status = stat_status | 1;
467  return FAIL;
468  }
469 
470  start = 0;
471  elts = BUFSZ; /* read in BUFSZ elements at a time */
472  if (nbins < elts)
473  elts = nbins;
474  else {
475  for (start = 0; start + elts < nbins; start += elts) {
476  if ((ret = get_wtcnt(vsid, "weights", start, elts, wt_buf)) < 0)
477  return FAIL;
478  else
479  val += ret;
480  }
481 
482  if ((elts = (nbins - start)) > 0) {
483  if ((ret = get_wtcnt(vsid, "weights", start, elts, wt_buf)) < 0)
484  return FAIL;
485  else
486  val += ret;
487  }
488  }
489 
490  VSdetach(vsid);
491 
492  if (val)
493  flag = 1;
494 
495  /*
496  * Print headers for weight check
497  */
498 
499  printf("\n\n#Mnemonic Flag Value ");
500  printf("\n#-----------------------\n");
501  printf("\nL3WT %d %d", flag, val);
502 
503  if (flag) {
504  printf("\n\n****Suspending further check..");
505  printf(" %d bins have been found with weight set to 0.", val);
506  stat_status = stat_status | 2;
507  return FAIL;
508  }
509  else
510  return SUCCEED;
511 }
512 
513 /****************************************************************************
514  l3data_chk
515 
516  purpose:
517 
518  Returns type: integer
519 
520  Parameters: (in calling order)
521  Type Name I/O Description
522  ---- ---- --- -----------
523  char * clim_file I Climatology file used
524  int32_t fid I SD interface ID
525  int32_t c_fid I SD interface ID for climatology
526  file
527  cntl_str * grschk I structure containing Gross
528  value control thresholds
529  cntl_str * statchk I struct containing statistical
530  value control thresholds
531  clim_str * climchk I structure containing thresholds
532  for climatology checks
533 
534  Modification history:
535  Programmer Date Description of change
536  ---------- ---- ---------------------
537  L. Kumar 07/19/1996 Original development
538 
539  ****************************************************************************/
540 
541 /*
542  ** data - float array of size 'BUFSZ'(1000) for reading parameter
543  ** data
544  ** wts - float array of size 'BUFSZ' for reading weights
545  ** elts - number of elements (records)
546  ** sumxbar - an array(NAPRAMS) of type double for accumulating individual
547  ** mean values
548  ** sumsd - an array(NPARAMS) of type double for accumulating individual
549  ** standard deviation values
550  */
551 
552 int32_t l3data_chk(char *clim_file, int32_t fid, int32_t c_fid, int32_t nbins,
553  int32_t c_nbins, cntl_str *grschk, cntl_str *statchk,
554  clim_str *climchk) {
555  int32_t i, ci, p, j, done, c_done, rd_flag, rd_c_flag;
556  int32_t st, c_st, elts, c_elts;
557  int32_t prev_c_st = -1;
558  int32_t binlist_id, c_binlist_id, proceed = 0;
559  int32_t param_vsid[NPARAMS], c_param_vsid[NPARAMS];
560  int32_t binno[BUFSZ], c_binno[BUFSZ];
561  float32 data[BUFSZ][2];
562  float32 c_data[NPARAMS][BUFSZ][2];
563  float32 wts[BUFSZ], c_wts[BUFSZ];
564  int16 scenes[BUFSZ], c_scenes[BUFSZ];
565  float64 xbar[NPARAMS][BUFSZ];
566  float64 c_xbar = 0, c_sd = 0;
567  float64 npts = 0;
568  float64 loparm[NPARAMS] = {1.e10, 1.e10, 1.e10, 1.e10, 1.e10, 1.e10,
569  1.e10, 1.e10, 1.e10, 1.e10, 1.e10};
570  float64 hiparm[NPARAMS] = {-1.e10, -1.e10, -1.e10, -1.e10, -1.e10,
571  -1.e10, -1.e10, -1.e10, -1.e10, -1.e10, -1.e10};
572  float64 negflag[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
573  float64 num1Lstd[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
574  float64 num1Hstd[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
575  float64 num2Lstd[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
576  float64 num2Hstd[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
577  float64 num3Lstd[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
578  float64 num3Hstd[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
579  float64 value1[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
580  float64 value2[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
581  float64 sumxbar[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
582  float64 sumsd[NPARAMS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
583 
584  printf("\n\n# Doing gross, statistical and climatology checks\n");
585 
586  /*
587  * return to calling routine, if there are no gross, statistical or
588  * climatological checks requested
589  */
590  for (p = 0; p < NPARAMS; p++)
591  if (grschk[p].param || statchk[p].param || climchk[p].param)
592  proceed = 1;
593 
594  if (!proceed)
595  return SUCCEED;
596 
597  /*
598  * get access id for accessing binlist and parameter vdatas of both
599  * input binfile and climatology bin file
600  */
601 
602  binlist_id = get_vsid(fid, "BinList");
603  if (c_fid != 0)c_binlist_id = get_vsid(c_fid, "BinList");
604 
605  for (p = 0; p < NPARAMS; p++) {
606  if ((param_vsid[p] = get_vsid(fid, param_name[p])) < 0)
607  return FAIL;
608 
609  if (c_fid != 0) {
610  if ((c_param_vsid[p] = get_vsid(c_fid, param_name[p])) < 0)
611  return FAIL;
612  }
613  }
614 
615  /*
616  * Set initial values for the following flags and variables,
617  * do the loop until all the bins of input file have been read
618  * and verified for gross and statistical checks
619  */
620  rd_flag = rd_c_flag = 1;
621 
622  st = c_st = 0; /* this tracks the index of the bin (out of total #
623  in the file) that is at the startof current buffer */
624  elts = c_elts = BUFSZ; /* # elements that were read to the buffer */
625 
626  if (nbins < BUFSZ)
627  elts = nbins;
628 
629  if (c_nbins < BUFSZ)
630  c_elts = c_nbins;
631 
632  done = c_done = 0;
633  while (!done) {
634  if (rd_flag) {
635  /* Read in next set of bin #s weights and # scenes from the file */
636  rd_flag = 0;
637  i = 0; /* index into binno buffer */
638  if ((rdvdata(binlist_id, "bin_num", st, elts,
639  (unsigned char *) binno)) < 0)
640  return FAIL;
641  if ((rdvdata(binlist_id, "weights", st, elts,
642  (unsigned char *) wts)) < 0)
643  return FAIL;
644  if ((rdvdata(binlist_id, "nscenes", st, elts,
645  (unsigned char *) scenes)) < 0)
646  return FAIL;
647 
648  for (p = 0; p < NPARAMS; p++) /* Also, read in each parameter */ {
649  if ((rdvdata(param_vsid[p], param_flds[p], st, elts,
650  (unsigned char *) data)) < 0)
651  return FAIL;
652 
653  /* For all the elements in the buffer, compute the mean */
654  for (j = 0; j < elts; j++) {
655  xbar[p][j] = data[j][0] / wts[j];
656  sumxbar[p] += xbar[p][j];
657  sumsd[p] += xbar[p][j] * xbar[p][j];
658  /*
659  * get the low and high
660  */
661  if (xbar[p][j] < loparm[p]) loparm[p] = xbar[p][j];
662  if (xbar[p][j] > hiparm[p]) hiparm[p] = xbar[p][j];
663  /*
664  * add to the histograms
665  */
666  h_accum(xbar[p][j], p);
667 
668  if (xbar[p][j] < grschk[p].low_thresh)
669  value1[p]++;
670  if (xbar[p][j] > grschk[p].high_thresh) {
671  value2[p]++;
672 #ifdef DEBUG
673  printf("\n#indx= %d,sum= %f,sumxx= %f,wts= %f,mean= %f",
674  j, data[j][0], data[j][1], wts[j], xbar[p][j]);
675 #endif
676  }
677  }
678  }
679  }
680  if (c_fid != 0) { /* WDR added climatology omission if */
681  /* read the bin #s for the climatology if necessary (if any of the
682  climatology data is needed for this buffer, it will be read
683  further below if required */
684  if (rd_c_flag) {
685  rd_c_flag = 0;
686  ci = 0; /* index into clim. binno buffer */
687  if ((rdvdata(c_binlist_id, "bin_num", c_st, c_elts,
688  (unsigned char *) c_binno)) < 0)
689  return FAIL;
690  }
691 
692  while (i < elts && ci < c_elts) {
693  if (binno[i] < c_binno[ci])
694  i++;
695  else if (binno[i] > c_binno[ci])
696  ci++;
697  else {
698  npts++;
699  if (prev_c_st != c_st) {
700  /* The rest of the climatology data is read for these
701  bins so that comparisons can be done */
702  if ((rdvdata(c_binlist_id, "weights", c_st, c_elts,
703  (unsigned char *) c_wts)) < 0)
704  return FAIL;
705  if ((rdvdata(c_binlist_id, "nscenes", c_st, c_elts,
706  (unsigned char *) c_scenes)) < 0)
707  return FAIL;
708  for (p = 0; p < NPARAMS; p++)
709  if ((rdvdata(c_param_vsid[p], param_flds[p], c_st, c_elts,
710  (unsigned char *) c_data[p])) < 0)
711  return FAIL;
712  prev_c_st = c_st;
713  }
714  for (p = 0; p < NPARAMS; p++) {
715  /* get the mean, std deviation for climatology and check the
716  file mean against it */
717  c_xbar = c_data[p][ci][0] / c_wts[ci];
718  c_sd = calc_sd(c_xbar, c_wts[ci], c_scenes[ci],
719  c_data[p][ci][1]);
720 
721  if (c_sd == NEG_FLAG)
722  negflag[p]++;
723  else {
724  if (xbar[p][i] < (c_xbar - 3 * c_sd)) {
725  num3Lstd[p]++;
726  num2Lstd[p]++;
727  num1Lstd[p]++;
728  } else if (xbar[p][i] < (c_xbar - 2 * c_sd)) {
729  num2Lstd[p]++;
730  num1Lstd[p]++;
731  } else if (xbar[p][i] < (c_xbar - c_sd))
732  num1Lstd[p]++;
733  if (xbar[p][i] > (c_xbar + 3 * c_sd)) {
734  num3Hstd[p]++;
735  num2Hstd[p]++;
736  num1Hstd[p]++;
737  } else if (xbar[p][i] > (c_xbar + 2 * c_sd)) {
738  num2Hstd[p]++;
739  num1Hstd[p]++;
740  } else if (xbar[p][i] > (c_xbar + c_sd))
741  num1Hstd[p]++;
742  }
743  }
744  i++;
745  ci++;
746  }
747  }
748 
749  /* if the end of the file data or climatology data buffer is hit,
750  set the proper flag so that the next stretch of data is read in */
751 
752  if (ci == c_elts && c_elts != 0) {
753  c_st += c_elts;
754  if (c_st + c_elts > c_nbins)
755  c_elts = c_nbins - c_st;
756  if (c_elts > 0)
757  rd_c_flag = 1;
758  else
759  c_done = 1;
760  }
761  }/* WDR added climatology omission if and add else condition below */
762  else {
763  i = elts;
764  }
765 
766  if ((i == elts && elts != 0) || c_done) {
767  st += elts;
768  if (st + elts > nbins)
769  elts = nbins - st;
770  if (elts > 0)
771  rd_flag = 1;
772  else
773  done = 1;
774  }
775  }
776  VSdetach(binlist_id);
777  if (c_fid != 0) VSdetach(c_binlist_id);
778 
779  pr_grs_results(grschk, nbins, value1, value2);
780  pr_stat_results(statchk, nbins, sumxbar, sumsd, loparm, hiparm);
781 
782  /*
783  * output the histograms
784  */
785  h_out(nbins, sumxbar, sumsd, loparm, hiparm);
786 
787  for (p = 0; p < NPARAMS; p++) {
788  VSdetach(param_vsid[p]);
789  if (c_fid != 0) VSdetach(c_param_vsid[p]);
790  }
791 
792  if (c_fid != 0) pr_clim_results(clim_file, climchk, npts, num1Lstd, num1Hstd,
793  num2Lstd, num2Hstd, num3Lstd, num3Hstd);
794 
795  return SUCCEED;
796 }
797 
798 void stat_exit(int status)
799 /*******************************************************************
800 
801  stat_exit
802 
803  purpose: provide a common exit from the stat_check program and
804  error summary info.
805 
806  Returns type: none
807 
808  Parameters: (in calling order)
809  Type Name I/O Description
810  ---- ---- --- -----------
811  int status I statistical check status
812 
813  Modification history:
814  Programmer Date Description of change
815  ---------- ---- ---------------------
816  W. Robinson 30-jun-1995 Original development
817 
818  *******************************************************************/ {
819  if (status == 0)
820  printf("\n\nSuccessful check, no statistical errors\n");
821  else {
822  if (status & 1)
823  printf("\n\nFailure of statistical check due to program error\n");
824  if (status & 2)
825  printf("\n\nFailure of statistical check due to data error\n");
826  }
827  exit(status);
828 }
829 
830 /*-----------------------------------------------------------------------------
831  Function: rdattr
832 
833  Returns: int32_t (status)
834  The return code is a negative value if any error occurs, otherwise,
835  returns 0.
836 
837  Description:
838  The function rdattr reads the requested global attribute
839 
840  Parameters: (in calling order)
841  Type Name I/O Description
842  ---- ---- --- -----------
843  int32_t sdfid I ID req to access HDF SDS interface
844  char * attr_name I attribute name
845  void * buf I/O pointer to data buffer
846 
847  Modification history:
848  Programmer Organization Date Description of change
849  -------------- ------------ -------- ---------------------
850  Lakshmi Kumar Hughes STX 11/07/94 original development
851 
852 ----------------------------------------------------------------------------*/
853 int32_t rdattr(int32_t sdfid, char *attr_name, void *buf) {
854  int32_t attrnum;
855 
856  if ((attrnum = SDfindattr(sdfid, attr_name)) < 0) {
857  printf("\n****rdattr: Failure in SDfindattr while trying to read %s",
858  attr_name);
859  stat_status = stat_status | 1;
860  return FAIL;
861  }
862 
863  if ((SDreadattr(sdfid, attrnum, buf)) < 0) {
864  printf("\n****rdattr: Failure in SDreadattr while trying to read %s",
865  attr_name);
866  stat_status = stat_status | 1;
867  return FAIL;
868  }
869 
870  return SUCCEED;
871 }
872 
873 /*----------------------------------------------------------------------------
874  Function: pr_error
875 
876  Description:
877  The function prints an error message and returns a negetive 1 to the
878  calling routine
879 -----------------------------------------------------------------------------*/
880 int32_t pr_error(char *label, int32_t nvals, int32_t nvals_read) {
881  printf("\n*****Expecting %d value(s) for - %s, but, read %d value(s). \n",
882  nvals, label, nvals_read);
883  stat_status = stat_status | 1;
884  return FAIL;
885 }
886 
887 /*-----------------------------------------------------------------------------
888  Function: get_wtcnt
889 
890  Returns: int32_t(no. of wts that are less than or equal to zero)
891 
892  Description:
893  The function get_wtcnt reads weights from BinIndex vdata starting
894  at position indicated by start, up to elements indicated by 'elts'
895  and returns a count of weights that are less than or equal to zero.
896 
897  Arguments: (in calling order)
898  Type Name I/O Description
899  ---- ---- --- -----------
900  int32_t vsid I access id for accessing BinIndex vdata
901  char * fld_name I field name (weights)
902  int32_t start I start element position
903  int32_t elts I number of elements to read
904  float32 * wt_buf O buffer to read the data
905 
906  Notes:
907 
908  Modification history:
909  Programmer Organization Date Description of change
910  -------------- ------------ -------- ---------------------
911  Lakshmi Kumar Hughes STX 07/19/1996 Original development
912 ------------------------------------------------------------------------------*/
913 int32_t get_wtcnt(int32_t vsid, char *fld_name, int32_t start, int32_t elts,
914  float32 *wt_buf) {
915  int32_t val = 0, i;
916 
917  if (rdvdata(vsid, fld_name, start, elts, (unsigned char *) wt_buf) < 0)
918  return FAIL;
919 
920  for (i = 0; i < elts; i++)
921  if (wt_buf[i] <= 0)
922  val++;
923 
924  return val;
925 }
926 
927 /*----------------------------------------------------------------------------
928  Function: get_vsid
929 
930  Returns: int32_t (vdata id)
931 
932  Description:
933  The function get_vsid locates the given named vdata, sets read
934  access to it and returns the access id to the calling routine.
935 
936  Arguments: (in calling order)
937  Type Name I/O Description
938  ---- ---- --- -----------
939  int32_t fid I File access ID
940  char * vs_name I vdata name
941 
942  Notes:
943 
944  Modification history:
945  Programmer Organization Date Description of change
946  -------------- ------------ -------- ---------------------
947  Lakshmi Kumar Hughes STX 07/19/1996 Original development
948 
949 -----------------------------------------------------------------------------*/
950 int32_t get_vsid(int32_t fid, char *vs_name) {
951 
952  int32_t vsid, vsref;
953 
954  /* Get vdata reference number for the given vdata name */
955  if ((vsref = VSfind(fid, vs_name)) < 0) {
956  printf("\nget_vsid: VSfind failed for vdata '%s'", vs_name);
957  stat_status = stat_status | 1;
958  return FAIL;
959  }
960 
961  /* Attach to a vdata using the given vdata reference number */
962  if ((vsid = VSattach(fid, vsref, "r")) < 0) {
963  printf("\nget_vsid: VSattach failed for vdata '%s'", vs_name);
964  stat_status = stat_status | 1;
965  return FAIL;
966  }
967 
968  return vsid;
969 }
970 
971 /*----------------------------------------------------------------------------
972  Function: calc_sd
973 
974  Returns: none
975 
976  Description:
977 
978  Arguments: (in calling order)
979  Type Name I/O Description
980  ---- ---- --- -----------
981 
982  Notes:
983 
984  Modification history:
985  Programmer Organization Date Description of change
986  -------------- ------------ -------- ---------------------
987  Lakshmi Kumar Hughes STX 07/19/1996 Original development
988 
989 -----------------------------------------------------------------------------*/
990 float64 calc_sd(float64 xmean, float32 wts, int16 nseg, float32 sumxx) {
991  float64 ww, sd;
992 
993  ww = wts * wts;
994  if (ww > nseg) {
995  sd = (sumxx / wts) - xmean * xmean;
996  if (sd < 0)
997  sd = 0;
998  else
999  sd = sqrt(sd * ww / (ww - nseg));
1000  } else
1001  sd = NEG_FLAG;
1002 
1003  return sd;
1004 }
1005 
1006 /*----------------------------------------------------------------------------
1007  Function: pr_grs_results
1008 
1009  Returns: none
1010 
1011  Description:
1012  The function pr_grs_results outputs the gross check results
1013 
1014  Arguments: (in calling order)
1015  Type Name I/O Description
1016  ---- ---- --- -----------
1017  cntl_str * grschk I strcutre containing gross check thresholds
1018  int32_t nbins I number of bins present in input file
1019  float64 * value1 I number of data pts (mean) < low thresh
1020  float64 * value2 I number of data pts (mean) > high thresh
1021 
1022  Notes:
1023 
1024  Modification history:
1025  Programmer Organization Date Description of change
1026  -------------- ------------ -------- ---------------------
1027  Lakshmi Kumar Hughes STX 07/19/1996 Original development
1028 
1029 -----------------------------------------------------------------------------*/
1030 void pr_grs_results(cntl_str *grschk, int32_t nbins, float64 *value1,
1031  float64 *value2) {
1032  int32_t p, flag, failcode = 0;
1033  float64 v1, v2;
1034 
1035  /*
1036  * Print headers for gross check output messages
1037  */
1038 
1039  printf("\n\n#Mnemonic Flag %%<Low %%>High Err_thr ");
1040  printf("low_thr high_thr");
1041  printf("\n#-----------------------------------------------------------");
1042  printf("-------------------\n");
1043 
1044  for (p = 0; p < NPARAMS; p++)
1045  if (grschk[p].param) {
1046  flag = 0;
1047  v1 = value1[p] / nbins * 100;
1048  v2 = value2[p] / nbins * 100;
1049  if (v1 > grschk[p].err_thresh)
1050  flag = 1;
1051  else if (v2 > grschk[p].err_thresh)
1052  flag = -1;
1053 
1054  printf("\nL3GCHK%d %5d %11.6f %12.6f %12.6f %12.6f %12.6f",
1055  p + 1, flag, v1, v2, grschk[p].err_thresh,
1056  grschk[p].low_thresh, grschk[p].high_thresh);
1057  if (flag != 0)
1058  failcode = 1;
1059  }
1060  if (failcode)
1061  stat_status = stat_status | 2;
1062 }
1063 
1064 /*----------------------------------------------------------------------------
1065  Function: pr_stat_results
1066 
1067  Returns: none
1068 
1069  Description:
1070  The function pr_stat_results calculates mean and std. deviation
1071  of the sumx's and sumsxx's and outputs the results
1072 
1073  Arguments: (in calling order)
1074  Type Name I/O Description
1075  ---- ---- --- -----------
1076  cntl_str * statchk I structure containing statistical check
1077  thresholds
1078  int32_t nbins I number of bins present
1079  float64 * sumx I array of sz 12, containing sum of sumx's
1080  float64 * sumxx I array of sz 12, containing sum of sumxx's
1081  float64 * loparm I lowest value encountered
1082  float64 * hiparm I highest value encountered
1083 
1084  Notes:
1085 
1086  Modification history:
1087  Programmer Organization Date Description of change
1088  -------------- ------------ -------- ---------------------
1089  Lakshmi Kumar Hughes STX 07/19/1996 Original development
1090 
1091 -----------------------------------------------------------------------------*/
1092 void pr_stat_results(cntl_str *statchk, int32_t nbins, float64 *sumxbar,
1093  float64 *sumsd, float64 *loparm, float64 *hiparm) {
1094  int32_t p, flag = 0;
1095  float64 sum, sumsq, xbar, sd;
1096 
1097  /*
1098  * Print headers for statistical check output messages
1099  */
1100 
1101  printf("\n\n");
1102  printf("#Mnemonic flag nbins xbar sd Low High ");
1103  printf("\n#----------------------------------------------------\n");
1104 
1105  for (p = 0; p < NPARAMS; p++)
1106  if (statchk[p].param) {
1107  sum = sumxbar[p] / nbins;
1108  sumsq = sumsd[p] / nbins;
1109  xbar = sum;
1110  sd = sqrt(sumsq - (sum * sum));
1111 
1112  printf("\nL3STAT%d %5d %7d %12.9f %12.9f %f %f", p + 1, flag, nbins,
1113  xbar, sd, loparm[p], hiparm[p]);
1114  }
1115 }
1116 
1117 /*----------------------------------------------------------------------------
1118  Function: pr_clim_results
1119 
1120  Returns: none
1121 
1122  Description:
1123  The function pr_clim_results calculates percentage outside 1, 2,
1124  and 3 standard deviation and outputs the results
1125 
1126  Arguments: (in calling order)
1127  Type Name I/O Description
1128  ---- ---- --- -----------
1129  char * clim_file I name of climatology file used
1130  clim_str * climchk I structure containing climatology check
1131  thresholds
1132  int32_t npts I number of input bins that matched clim.
1133  bins
1134  float64 * num1Hstd I number of bins outside 1 STD
1135  float64 * num1Lstd I number of bins outside 1 STD
1136  float64 * num2Hstd I number of bins outside 2 STD
1137  float64 * num2Lstd I number of bins outside 2 STD
1138  float64 * num3Hstd I number of bins outside 3 STD
1139  float64 * num3Lstd I number of bins outside 3 STD
1140 
1141  Notes:
1142 
1143  Modification history:
1144  Programmer Organization Date Description of change
1145  -------------- ------------ -------- ---------------------
1146  Lakshmi Kumar Hughes STX 07/19/1996 Original development
1147  Lakshmi Kumar Hughes STX 06/16/1997 Added clim_file argument
1148 -----------------------------------------------------------------------------*/
1149 void pr_clim_results(char *clim_file, clim_str *climchk, float64 npts,
1150  float64 *num1Hstd, float64 *num1Lstd, float64 *num2Hstd,
1151  float64 *num2Lstd, float64 *num3Hstd, float64 *num3Lstd) {
1152  int32_t p, failcode = 0;
1153  int32_t flag1_H, flag2_H, flag3_H;
1154  int32_t flag1_L, flag2_L, flag3_L;
1155  float64 pct1Hstd[NPARAMS], pct2Hstd[NPARAMS], pct3Hstd[NPARAMS];
1156  float64 pct1Lstd[NPARAMS], pct2Lstd[NPARAMS], pct3Lstd[NPARAMS];
1157 
1158  for (p = 0; p < NPARAMS; p++) {
1159  pct1Lstd[p] = pct2Lstd[p] = pct3Lstd[p] = 0;
1160  pct1Hstd[p] = pct2Hstd[p] = pct3Hstd[p] = 0;
1161  }
1162 
1163  /*
1164  * Print headers for statistical check output messages
1165  */
1166 
1167  printf("\n\nCLIM_FILE_USED: %s", clim_file);
1168  printf("\n\nCLIM_NPTS: %f\n", npts);
1169  printf("\n\n");
1170  printf("#Mnemonic flag #std dev %%outside %%thresh ");
1171  printf("\n#----------------------------------------------------\n");
1172 
1173  for (p = 0; p < NPARAMS; p++)
1174  if (climchk[p].param) {
1175  if (npts > 0) {
1176  pct1Hstd[p] = 100 * num1Hstd[p] / npts;
1177  pct1Lstd[p] = 100 * num1Lstd[p] / npts;
1178  pct2Hstd[p] = 100 * num2Hstd[p] / npts;
1179  pct2Lstd[p] = 100 * num2Lstd[p] / npts;
1180  pct3Hstd[p] = 100 * num3Hstd[p] / npts;
1181  pct3Lstd[p] = 100 * num3Lstd[p] / npts;
1182  }
1183 
1184  flag1_H = flag1_L = flag2_H = flag2_L = flag3_H = flag3_L = 0;
1185 
1186  if (pct3Lstd[p] > climchk[p].thresh3L)
1187  flag3_L = 1;
1188  if (pct2Lstd[p] > climchk[p].thresh2L)
1189  flag2_L = 1;
1190  if (pct1Lstd[p] > climchk[p].thresh1L)
1191  flag1_L = 1;
1192 
1193  if (pct3Hstd[p] > climchk[p].thresh3H)
1194  flag3_H = 1;
1195  if (pct2Hstd[p] > climchk[p].thresh2H)
1196  flag2_H = 1;
1197  if (pct1Hstd[p] > climchk[p].thresh1H)
1198  flag1_H = 1;
1199 
1200  if (flag1_H || flag1_L || flag2_H || flag2_L || flag3_H || flag3_L)
1201  failcode = 1;
1202 
1203  printf("\n\nL3CCHK%d %6d %10s %12.6lf %12.6f",
1204  p + 1, flag1_L, "LO_1", pct1Lstd[p], climchk[p].thresh1L);
1205  printf("\nL3CCHK%d %6d %10s %12.6lf %12.6f",
1206  p + 1, flag1_H, "HI_1", pct1Hstd[p], climchk[p].thresh1H);
1207  printf("\nL3CCHK%d %6d %10s %12.6f %12.6f",
1208  p + 1, flag2_L, "LO_2", pct2Lstd[p], climchk[p].thresh2L);
1209  printf("\nL3CCHK%d %6d %10s %12.6f %12.6f",
1210  p + 1, flag2_H, "HI_2", pct2Hstd[p], climchk[p].thresh2H);
1211  printf("\nL3CCHK%d %6d %10s %12.6f %12.6f",
1212  p + 1, flag3_L, "LO_3", pct3Lstd[p], climchk[p].thresh3L);
1213  printf("\nL3CCHK%d %6d %10s %12.6f %12.6f",
1214  p + 1, flag3_H, "HI_3", pct3Hstd[p], climchk[p].thresh3H);
1215  }
1216  if (failcode)
1217  stat_status = stat_status | 2;
1218 }
1219 
1220 
#define BUFSZ
integer, parameter int16
Definition: cubeio.f90:3
int32_t get_wtcnt(int32_t vsid, char *fld_name, int32_t start, int32_t elts, float32 *wt_buf)
Definition: l3stat_chk.c:913
int j
Definition: decode_rs.h:73
int status
Definition: l1_czcs_hdf.c:32
#define NEG_FLAG
Definition: l3stat_chk.c:16
int32_t l3data_chk(char *clim_file, int32_t fid, int32_t c_fid, int32_t nbins, int32_t c_nbins, cntl_str *grschk, cntl_str *statchk, clim_str *climchk)
Definition: l3stat_chk.c:552
char * param_name[]
Definition: l2lists.h:16
#define FAIL
Definition: ObpgReadGrid.h:18
int32_t pr_error(char *label, int32_t nvals, int32_t nvals_read)
Definition: l3stat_chk.c:880
#define MAXVAL
Definition: l3stat.h:13
#define NULL
Definition: decode_rs.h:63
void pr_clim_results(char *clim_file, clim_str *climchk, float64 npts, float64 *num1Hstd, float64 *num1Lstd, float64 *num2Hstd, float64 *num2Lstd, float64 *num3Hstd, float64 *num3Lstd)
Definition: l3stat_chk.c:1149
unsigned long long sumsq(signed short *in, int cnt)
int main(int argc, char *argv[])
Definition: l3stat_chk.c:18
void h_init(char *file)
Definition: hist.c:17
#define NPARAMS
Definition: l2stat.h:11
int32_t chk_weight(int32_t fid, int32_t nbins)
Definition: l3stat_chk.c:451
int32_t get_vsid(int32_t fid, char *vs_name)
Definition: l3stat_chk.c:950
void h_accum(float value, int parm_num)
Definition: hist.c:61
int32_t chk_databin(int32_t sdfid, cntl_str *databinchk)
Definition: l3stat_chk.c:402
int32 stat_status
Definition: l1stat_chk.c:8
void h_out(int nbins, double *sum, double *sumsq, double *loparm, double *hiparm)
Definition: hist.c:98
int32_t l3file(int32_t sdfid, int32_t c_sdfid, int32_t *nbins, int32_t *c_nbins, char *ptype)
Definition: l3stat_chk.c:347
#define TITLE
Definition: l1stat.h:25
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude data
Definition: HISTORY.txt:356
float64 calc_sd(float64 xmean, float32 wts, int16 nseg, float32 sumxx)
Definition: l3stat_chk.c:990
int32_t rdattr(int32_t sdfid, char *attr_name, void *buf)
Definition: l3stat_chk.c:853
int rdvdata(int32_t vskey, const char *fields, int32_t start, int32_t nelt, unsigned char *databuf)
const char * str
Definition: l1c_msi.cpp:35
#define NFLAGS
Definition: l2stat.h:12
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 the required RAM for each execution is MB on the DEC ALPHA and MB on the SGI Octane v2
Definition: HISTORY.txt:728
void pr_stat_results(cntl_str *statchk, int32_t nbins, float64 *sumxbar, float64 *sumsd, float64 *loparm, float64 *hiparm)
Definition: l3stat_chk.c:1092
int32_t read_cntldata(char *cntl_file, cntl_str *databinchk, cntl_str *grschk, cntl_str *statchk, int32_t *wtchk, clim_str *climchk)
Definition: l3stat_chk.c:229
int32_t nvals
int i
Definition: decode_rs.h:71
msiBandIdx val
Definition: l1c_msi.cpp:34
void stat_exit(int status)
Definition: l3stat_chk.c:798
float p[MODELMAX]
Definition: atrem_corl1.h:131
void pr_grs_results(cntl_str *grschk, int32_t nbins, float64 *value1, float64 *value2)
Definition: l3stat_chk.c:1030
char * param_flds[]
Definition: l3lists.h:36