NASA Logo
Ocean Color Science Software

ocssw V2022
l2bin_input.cpp
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <ctype.h>
5 #include <netcdf>
6 #include <unistd.h>
7 #include <string>
8 #include <vector>
9 #include <boost/algorithm/string.hpp>
10 
11 using namespace std;
12 using namespace netCDF;
13 using namespace netCDF::exceptions;
14 
15 #include "l2bin_input.h"
16 #include "genutils.h"
17 #include "passthebuck.h"
18 #include "sensorInfo.h"
19 
20 // store the name of program we are running.
21 static char mainProgramName[50];
22 
23 int l2bin_init_options(clo_optionList_t* list, const char* prog, const char* version) {
24  char tmpStr[2048];
25  clo_option_t* option;
26 
27  // set the min program name
28  strcpy(mainProgramName, prog);
29 
30  sprintf(tmpStr, "Usage: %s argument-list\n\n", prog);
31  strcat(tmpStr, " The argument-list is a set of keyword=value pairs. The arguments can\n");
32  strcat(tmpStr, " be specified on the commandline, or put into a parameter file, or the\n");
33  strcat(tmpStr, " two methods can be used together, with commandline over-riding.\n\n");
34  strcat(tmpStr, " return value: 0=OK, 1=error, 110=north,south,east,west does not intersect\n");
35  strcat(tmpStr, " file data.\n\n");
36  strcat(tmpStr, "The list of valid keywords follows:\n");
37  clo_setHelpStr(tmpStr);
38 
39  // add the parfile alias for backward compatibility
40  clo_addAlias(list, "par", "parfile");
41 
42  strcpy(tmpStr, "input L2 file name");
43  option = clo_addOption(list, "ifile", CLO_TYPE_IFILE, NULL, tmpStr);
44  clo_addOptionAlias(option, "infile");
45 
46  clo_addOption(list, "ofile", CLO_TYPE_OFILE, "output", "output file name");
47  clo_addOption(list, "fileuse", CLO_TYPE_OFILE, NULL, "write filenames of the input files used into this file");
48 
49  clo_addOption(list, "suite", CLO_TYPE_STRING, NULL, "suite for default parameters");
50  clo_addOption(list, "qual_prod", CLO_TYPE_STRING, NULL, "quality product field name");
51 
52  clo_addOption(list, "deflate", CLO_TYPE_INT, "5", "deflation level. 0=off or 1=low through 9=high");
53 
54  clo_addOption(list, "verbose", CLO_TYPE_BOOL, "off", "Allow more verbose screen messages");
55  clo_addOption(list, "night", CLO_TYPE_BOOL, "off", "set to 1 for SST night processing");
56  clo_addOption(list, "qual_max", CLO_TYPE_INT, "2", "maximum acceptable quality");
57  clo_addOption(list, "rowgroup", CLO_TYPE_INT, "-1", "# of bin rows to process at once.");
58  clo_addOption(list, "sday", CLO_TYPE_INT, "1970001", "start datadate (YYYYDDD) [ignored for \"regional\" prodtype]");
59  clo_addOption(list, "eday", CLO_TYPE_INT, "2038018", "end datadate (YYYYDDD) [ignored for \"regional\" prodtype]");
60  clo_addOption(list, "latnorth", CLO_TYPE_FLOAT, "90", "northern most latitude");
61  clo_addOption(list, "latsouth", CLO_TYPE_FLOAT, "-90", "southern most latitude");
62  clo_addOption(list, "loneast", CLO_TYPE_FLOAT, "0", "eastern most longitude");
63  clo_addOption(list, "lonwest", CLO_TYPE_FLOAT, "0", "western most longitude");
64  clo_addOption(list, "minobs", CLO_TYPE_INT, "0", "required minimum number of observations");
65 
66  strcpy(tmpStr, "equator crossing time delta in\n minutes\n");
67  strcat(tmpStr, " Caveat...if zero, the sensor default equator crossing time will be used\n");
68  strcat(tmpStr, " This is not necessarily noon");
69  clo_addOption(list, "delta_crossing_time", CLO_TYPE_FLOAT, "0.0", tmpStr);
70 
71  strcpy(tmpStr, "bin resolution\n");
72  strcat(tmpStr, " H: 0.5km\n");
73  strcat(tmpStr, " Q: 250m\n");
74  strcat(tmpStr, " HQ: 100m\n");
75  strcat(tmpStr, " HH: 50m\n");
76  strcat(tmpStr, " 1: 1.1km\n");
77  strcat(tmpStr, " 2: 2.3km\n");
78  strcat(tmpStr, " 4: 4.6km\n");
79  strcat(tmpStr, " 9: 9.2km\n");
80  strcat(tmpStr, " 18: 18.5km\n");
81  strcat(tmpStr, " 36: 36km\n");
82  strcat(tmpStr, " 1D: 1 degree\n");
83  strcat(tmpStr, " HD: 0.5 degree\n");
84  strcat(tmpStr, " QD: 0.25 degree");
85  option = clo_addOption(list, "resolution", CLO_TYPE_STRING, "H", tmpStr);
86  clo_addOptionAlias(option, "resolve");
87  clo_addOption(list, "prodtype", CLO_TYPE_STRING, "day", "product type (Set to \"regional\" to bin all scans.)");
88  clo_addOption(list, "pversion", CLO_TYPE_STRING, "unspecified", "production version");
89 
90  clo_addOption(list, "composite_scheme", CLO_TYPE_STRING, NULL, "composite scheme (min/max)");
91  clo_addOption(list, "composite_prod", CLO_TYPE_STRING, NULL, "composite product fieldname");
92  strcpy(tmpStr, "flags masked [see /SENSOR/l2bin_defaults.par]");
93  clo_addOption(list, "flaguse", CLO_TYPE_STRING, DEF_FLAG, tmpStr);
94 
95  strcpy(tmpStr, "l3bprod = bin products [default=all products]\n");
96  strcat(tmpStr, " Set to \"ALL\" or \"all\" for all L2 products in 1st input file.\n");
97  strcat(tmpStr, " Use ':' or ',' or ' ' as delimiters.\n");
98  strcat(tmpStr, " Use ';' or '=' to delineate minimum values.");
99  clo_addOption(list, "l3bprod", CLO_TYPE_STRING, "ALL", tmpStr);
100 
101  clo_addOption(list, "area_weighting", CLO_TYPE_INT, "0", "Enable area weighting\n 0: off\n 1: pixel box\n 2: pixel bounding box\n 3: pixel polygon");
102 
103  clo_addOption(list, "output_wavelengths", CLO_TYPE_STRING, "ALL", "comma separated list of\n wavelengths for multi-wavelength products");
104  clo_addOption(list, "doi", CLO_TYPE_STRING, NULL, "Digital Object Identifier (DOI) string");
105  strcpy(tmpStr,"comma separated list of output L3 product names.\n");
106  strcat(tmpStr, " This option allows the user to specify the output product names which differ from the original l2 product names.\n");
107  strcat(tmpStr, " Usage: original_l2_name:output_l3_name, i.e. oprodname=cloud_flag:cloud_fraction");
108  clo_addOption(list, "oprodname", CLO_TYPE_STRING, NULL, tmpStr);
110  return 0;
111 }
112 
114  char *tmp_str;
115  char keyword[50];
116  char *parm_str;
117  char tmp_file[FILENAME_MAX];
118  int numOptions, optionId;
119  clo_option_t *option;
120 
121  numOptions = clo_getNumOptions(list);
122  for (optionId = 0; optionId < numOptions; optionId++) {
123  option = clo_getOption(list, optionId);
124 
125  // ignore options of type CLO_TYPE_HELP
126  if (option->dataType == CLO_TYPE_HELP)
127  continue;
128 
129  strcpy(keyword, option->key);
130 
131  /* change keyword to lower case */
132  tmp_str = keyword;
133  while (*tmp_str != '\0') {
134  if (isupper(*tmp_str)) *tmp_str = tolower(*tmp_str);
135  tmp_str++;
136  }
137 
138  if (strcmp(keyword, "help") == 0) {
139  }
140  else if (strcmp(keyword, "version") == 0) {
141  }
142  else if (strncmp(keyword, "dump_options", 12) == 0) {
143  }
144  else if (strncmp(keyword, "par", 3) == 0) {
145  }
146  else if (strcmp(keyword, "ifile") == 0) {
147  if (clo_isOptionSet(option)) {
148  parm_str = clo_getOptionString(option);
149  parse_file_name(parm_str, tmp_file);
150  strcpy(input->infile, tmp_file);
151  }
152  } else if (strcmp(keyword, "ofile") == 0) {
153  if (clo_isOptionSet(option)) {
154  parm_str = clo_getOptionString(option);
155  parse_file_name(parm_str, tmp_file);
156  strcpy(input->ofile, tmp_file);
157  }
158  } else if (strcmp(keyword, "fileuse") == 0) {
159  if (clo_isOptionSet(option)) {
160  parm_str = clo_getOptionString(option);
161  parse_file_name(parm_str, tmp_file);
162  strcpy(input->fileuse, tmp_file);
163  }
164  } else if (strcmp(keyword, "sday") == 0) {
165  if (clo_isOptionSet(option))
166  input->sday = clo_getOptionInt(option);
167 
168  } else if (strcmp(keyword, "eday") == 0) {
169  if (clo_isOptionSet(option))
170  input->eday = clo_getOptionInt(option);
171 
172  } else if (strcmp(keyword, "resolution") == 0) {
173  parm_str = clo_getOptionString(option);
174  parse_file_name(parm_str, tmp_file);
175  strcpy(input->resolve, tmp_file);
176 
177  } else if (strcmp(keyword, "rowgroup") == 0) {
178  input->rowgroup = clo_getOptionInt(option);
179 
180  } else if (strcmp(keyword, "flaguse") == 0) {
181  string flags = clo_getOptionRawString(option);
182  boost::replace_all(flags, "default", DEF_FLAG);
183  strcpy(input->flaguse, flags.c_str());
184 
185  } else if (strcmp(keyword, "l3bprod") == 0) {
186  parm_str = clo_getOptionRawString(option);
187  strcpy(input->l3bprod, parm_str);
188 
189  } else if (strcmp(keyword, "prodtype") == 0) {
190  parm_str = clo_getOptionString(option);
191  strcpy(input->prodtype, parm_str);
192 
193  } else if (strcmp(keyword, "output_wavelengths") == 0) {
194  parm_str = clo_getOptionRawString(option);
195  strcpy(input->output_wavelengths, parm_str);
196 
197  } else if (strcmp(keyword, "pversion") == 0) {
198  parm_str = clo_getOptionString(option);
199  strcpy(input->pversion, parm_str);
200 
201  } else if (strcmp(keyword, "suite") == 0) {
202  if (clo_isOptionSet(option)) {
203  parm_str = clo_getOptionString(option);
204  strcpy(input->suite, parm_str);
205  }
206  } else if (strcmp(keyword, "latsouth") == 0) {
207  input->latsouth = clo_getOptionFloat(option);
208 
209  } else if (strcmp(keyword, "latnorth") == 0) {
210  input->latnorth = clo_getOptionFloat(option);
211 
212  } else if (strcmp(keyword, "lonwest") == 0) {
213  input->lonwest = clo_getOptionFloat(option);
214 
215  } else if (strcmp(keyword, "loneast") == 0) {
216  input->loneast = clo_getOptionFloat(option);
217 
218  } else if (strcmp(keyword, "meminfo") == 0) {
219  input->meminfo = clo_getOptionInt(option);
220 
221  } else if (strcmp(keyword, "dcinfo") == 0) {
222  input->dcinfo = clo_getOptionInt(option);
223 
224  } else if (strcmp(keyword, "night") == 0) {
225  input->night = clo_getOptionBool(option);
226 
227  } else if (strcmp(keyword, "verbose") == 0) {
228  input->verbose = clo_getOptionBool(option);
229 
230  } else if (strcmp(keyword, "minobs") == 0) {
231  input->minobs = clo_getOptionInt(option);
232 
233  } else if (strcmp(keyword, "delta_crossing_time") == 0) {
234  input->deltaeqcross = clo_getOptionFloat(option);
235 
236  } else if (strcmp(keyword, "deflate") == 0) {
237  input->deflate = clo_getOptionInt(option);
238 
239  } else if (strcmp(keyword, "qual_max") == 0) {
240  input->qual_max = (uint8_t) clo_getOptionInt(option);
241 
242  } else if (strcmp(keyword, "qual_prod") == 0) {
243  if (clo_isOptionSet(option)) {
244  parm_str = clo_getOptionString(option);
245  parse_file_name(parm_str, tmp_file);
246  strcpy(input->qual_prod, tmp_file);
247  }
248 
249  } else if(strcmp(keyword, "oprodname") == 0){
250  if (clo_isOptionSet(option)) {
251  parm_str = clo_getOptionRawString(option);
252  strcpy(input->output_product_names, parm_str);
253  }
254  } else if (strcmp(keyword, "composite_prod") == 0) {
255  if (clo_isOptionSet(option)) {
256  parm_str = clo_getOptionString(option);
257  parse_file_name(parm_str, tmp_file);
258  strcpy(input->composite_prod, tmp_file);
259  }
260  } else if (strcmp(keyword, "composite_scheme") == 0) {
261  if (clo_isOptionSet(option)) {
262  parm_str = clo_getOptionString(option);
263  parse_file_name(parm_str, tmp_file);
264  strcpy(input->composite_scheme, tmp_file);
265  }
266  } else if (strcmp(keyword, "area_weighting") == 0) {
267  if (clo_isOptionSet(option)) {
268  input->area_weighting = clo_getOptionInt(option);
269  } else {
270  input->area_weighting = 0;
271  }
272  } else if (strcmp(keyword, "doi") == 0) {
273  if (clo_isOptionSet(option)) {
274  strcpy(input->doi, clo_getOptionString(option));
275  }
276  } else {
277  printf("-E- Invalid argument \"%s\"\n", keyword);
278  exit(EXIT_FAILURE);
279  }
280 
281  }
282 
283  return 0;
284 }
285 
286 int input_init(instr *input_str) {
287  input_str->infile[0] = '\0';
288  input_str->ofile[0] = '\0';
289  input_str->pfile[0] = '\0';
290 
291  input_str->fileuse[0] = '\0';
292  input_str->qual_prod[0] = '\0';
293  input_str->composite_prod[0] = '\0';
294  input_str->composite_scheme[0] = '\0';
295  input_str->output_product_names[0] = '\0';
296  strcpy(input_str->pversion, "Unspecified");
297  strcpy(input_str->prodtype, "day");
298 
299  strcpy(input_str->l3bprod, "ALL");
300  strcpy(input_str->output_wavelengths, "ALL");
301 
302  input_str->sday = 1970001;
303  input_str->eday = 2038018;
304 
305  input_str->resolve[0] = '\0';
306 
307  input_str->rowgroup = -1;
308 
309  input_str->night = 0;
310  input_str->verbose = 0;
311  input_str->minobs = 0;
312  input_str->deltaeqcross = 0.0;
313 
314  input_str->meminfo = 0;
315  input_str->dcinfo = 0;
316 
317  input_str->latsouth = -90.0;
318  input_str->latnorth = +90.0;
319  input_str->lonwest = 0.0;
320  input_str->loneast = 0.0;
321 
322  input_str->qual_max = 255;
323 
324  input_str->deflate = 0;
325 
326  strcpy(input_str->suite, "");
327 
328  input_str->area_weighting = 0;
329  input_str->doi[0] = '\0';
330 
331  return 0;
332 }
333 
334 /*-----------------------------------------------------------------------------
335  Function: l2bin_input
336 
337  Returns: int (status)
338  The return code is a negative value if any error occurs, otherwise,
339  returns 0.
340 
341  Description:
342  Convert the arguments from the command line into a structure input
343  variable.
344 
345  Parameters: (in calling order)
346  Type Name I/O Description
347  ---- ---- --- -----------
348  int argc I number of arguments
349  char **argv I list of arguments
350  instr input O structure variable for inputs
351 
352 ----------------------------------------------------------------------------*/
353 
354 int l2bin_input(int argc, char **argv, instr *input, const char* prog, const char* version) {
355 
356  char str_buf[4096];
357 
358  char *dataRoot;
359  int sensorId;
360  int subsensorId = -1;
361  char localSuite[FILENAME_MAX];
362  char localIfile[FILENAME_MAX];
363 
364  /* */
365  /* Set input values to defaults */
366  /* */
367  if (input_init(input) != 0) {
368  printf("-E- %s: Error initializing input structure.\n", __FILE__);
369  exit(EXIT_FAILURE);
370  }
371 
372  /* hold all of the command line options */
374 
375  list = clo_createList();
376 
377  /* initialize the option list with descriptions and default values */
379 
380  if (argc == 1) {
382  exit(EXIT_SUCCESS);
383  }
384 
385  // disable the dump option until we have read all of the files
387  clo_readArgs(list, argc, argv);
388 
389  // get list of input files
390  strcpy(localIfile, clo_getString(list, "ifile"));
391  input->files = readFileList(localIfile);
392  if (input->files.size() == 0) {
393  printf("-E- No NetCDF input files found in %s.\n", localIfile);
394  exit(EXIT_FAILURE);
395  }
396 
397  // see if suite param was set
398  localSuite[0] = '\0';
399  if (clo_isSet(list, "suite")) {
400  strcpy(localSuite, clo_getString(list, "suite"));
401  } // suite option was set
402 
403  // find the sensor and sub-sensor ID for first input file
405  try {
406  NcFile nc_input(input->files[0], NcFile::read);
407  nc_input.getAtt("instrument").getValues(instrument);
408  nc_input.getAtt("platform").getValues(platform);
409  nc_input.close();
410  } catch (NcException const & e) {
411  printf("-E- L2 file %s does not have instrument/platform attributes.\n", input->files[0].c_str());
412  exit(EXIT_FAILURE);
413  }
414  sensorId = instrumentPlatform2SensorId(instrument.c_str(), platform.c_str());
415  subsensorId = sensorId2SubsensorId(sensorId);
416 
417  if (sensorId == -1) {
418  printf("-E- Can not look up sensor ID for %s.\n", localIfile);
419  exit(EXIT_FAILURE);
420  }
421 
422  if ((dataRoot = getenv("OCDATAROOT")) == NULL) {
423  printf("OCDATAROOT environment variable is not defined.\n");
424  exit(EXIT_FAILURE);
425  }
426 
427  // load l2bin program defaults
428  sprintf(str_buf, "%s/common/l2bin_defaults.par", dataRoot);
429  if (access(str_buf, R_OK) != -1) {
430  if (want_verbose)
431  printf("Loading default parameters from %s\n", str_buf);
432  clo_readFile(list, str_buf);
433  }
434 
435  // sensor defaults
436  sprintf(str_buf, "%s/%s/l2bin_defaults.par", dataRoot, sensorId2SensorDir(sensorId));
437  if (access(str_buf, R_OK) != -1) {
438  if (want_verbose)
439  printf("Loading default parameters from %s\n", str_buf);
440  clo_readFile(list, str_buf);
441  }
442 
443  // subsensor defaults
444  if (subsensorId != -1) {
445  sprintf(str_buf, "%s/%s/%s/l2bin_defaults.par", dataRoot,
446  sensorId2SensorDir(sensorId), subsensorId2SubsensorDir(subsensorId));
447  if (access(str_buf, R_OK) != -1) {
448  if (want_verbose)
449  printf("Loading default parameters from %s\n", str_buf);
450  clo_readFile(list, str_buf);
451  }
452  }
453 
454  // load suite default files
455  if (localSuite[0] == 0) {
456  if (clo_isSet(list, "suite"))
457  strcpy(localSuite, clo_getString(list, "suite"));
458  }
459 
460  // Check for suite entry
461  if (localSuite[0] != 0) {
462  int suiteLoaded = 0;
463 
464  // load common suite defaults
465  sprintf(str_buf, "%s/common/l2bin_defaults_%s.par", dataRoot, localSuite);
466  if (access(str_buf, R_OK) != -1) {
467  suiteLoaded = 1;
468  if (want_verbose)
469  printf("Loading default parameters from %s\n", str_buf);
470  clo_readFile(list, str_buf);
471  }
472 
473  // sensor suite defaults
474  sprintf(str_buf, "%s/%s/l2bin_defaults_%s.par", dataRoot,
475  sensorId2SensorDir(sensorId), localSuite);
476  if (access(str_buf, R_OK) != -1) {
477  suiteLoaded = 1;
478  if (want_verbose)
479  printf("Loading default parameters from %s\n", str_buf);
480  clo_readFile(list, str_buf);
481  }
482 
483  // subsensor suite defaults
484  if (subsensorId != -1) {
485  sprintf(str_buf, "%s/%s/%s/l2bin_defaults_%s.par", dataRoot,
486  sensorId2SensorDir(sensorId), subsensorId2SubsensorDir(subsensorId),
487  localSuite);
488  if (access(str_buf, R_OK) != -1) {
489  suiteLoaded = 1;
490  if (want_verbose)
491  printf("Loading default parameters from %s\n", str_buf);
492  clo_readFile(list, str_buf);
493  }
494  }
495 
496  if (!suiteLoaded) {
497  printf("-E- Failed to load parameters for suite %s for sensor %s\n", localSuite,
498  sensorId2SensorName(sensorId));
499  exit(EXIT_FAILURE);
500  }
501 
502  }
503 
504  // re-load the command line and par file
505  if (want_verbose)
506  printf("Loading command line parameters\n\n");
508  clo_readArgs(list, argc, argv);
509 
510  // load input struct with command line arguments
511  if (l2bin_load_input(list, input) != 0) {
512  printf("-E- %s: Error loading options into input structure.\n", __FILE__);
513  exit(EXIT_FAILURE);
514  }
515 
516  /* */
517  /* Build string of parameters for metadata */
518  /* */
519  sprintf(str_buf, "infile = %s\n", input->infile);
520  strcat(input->parms, str_buf);
521  sprintf(str_buf, "ofile = %s\n", input->ofile);
522  strcat(input->parms, str_buf);
523  sprintf(str_buf, "fileuse = %s\n", input->fileuse);
524  strcat(input->parms, str_buf);
525 
526  sprintf(str_buf, "sday = %d\n", input->sday);
527  strcat(input->parms, str_buf);
528  sprintf(str_buf, "eday = %d\n", input->eday);
529  strcat(input->parms, str_buf);
530 
531  sprintf(str_buf, "latnorth = %f\n", input->latnorth);
532  strcat(input->parms, str_buf);
533  sprintf(str_buf, "latsouth = %f\n", input->latsouth);
534  strcat(input->parms, str_buf);
535  sprintf(str_buf, "loneast = %f\n", input->loneast);
536  strcat(input->parms, str_buf);
537  sprintf(str_buf, "lonwest = %f\n", input->lonwest);
538  strcat(input->parms, str_buf);
539 
540  sprintf(str_buf, "resolve = %s\n", input->resolve);
541  strcat(input->parms, str_buf);
542 
543  sprintf(str_buf, "rowgroup = %d\n", input->rowgroup);
544  strcat(input->parms, str_buf);
545 
546  sprintf(str_buf, "flaguse = %s\n", input->flaguse);
547  strcat(input->parms, str_buf);
548 
549  sprintf(str_buf, "l3bprod = %s\n", input->l3bprod);
550  strcat(input->parms, str_buf);
551 
552  sprintf(str_buf, "output_wavelengths = %s\n", input->output_wavelengths);
553  strcat(input->parms, str_buf);
554 
555  sprintf(str_buf, "prodtype = %s\n", input->prodtype);
556  strcat(input->parms, str_buf);
557 
558  sprintf(str_buf, "pversion = %s\n", input->pversion);
559  strcat(input->parms, str_buf);
560 
561  sprintf(str_buf, "suite = %s\n", input->suite);
562  strcat(input->parms, str_buf);
563 
564  sprintf(str_buf, "night = %d\n", input->night);
565  strcat(input->parms, str_buf);
566 
567  sprintf(str_buf, "verbose = %d\n", input->verbose);
568  strcat(input->parms, str_buf);
569 
570  sprintf(str_buf, "minobs = %d\n", input->minobs);
571  strcat(input->parms, str_buf);
572 
573  sprintf(str_buf, "delta_crossing_time = %f\n", input->deltaeqcross);
574  strcat(input->parms, str_buf);
575 
576  sprintf(str_buf, "deflate = %d\n", input->deflate);
577  strcat(input->parms, str_buf);
578 
579  sprintf(str_buf, "qual_prod = %s\n", input->qual_prod);
580  strcat(input->parms, str_buf);
581 
582  sprintf(str_buf, "composite_prod = %s\n", input->composite_prod);
583  strcat(input->parms, str_buf);
584 
585  sprintf(str_buf, "composite_scheme = %s\n", input->composite_scheme);
586  strcat(input->parms, str_buf);
587 
588  sprintf(str_buf, "qual_max = %d\n", input->qual_max);
589  strcat(input->parms, str_buf);
590 
591  sprintf(str_buf, "area_weighting = %d\n", input->area_weighting);
592  strcat(input->parms, str_buf);
593 
594  sprintf(str_buf, "doi = %s\n", input->doi);
595  strcat(input->parms, str_buf);
596 
597  sprintf(str_buf, "oprodname = %s\n", input->output_product_names);
598  strcat(input->parms, str_buf);
599 
601 
602  return 0;
603 }
clo_option_t * clo_addOption(clo_optionList_t *list, const char *key, enum clo_dataType_t dataType, const char *defaultVal, const char *desc)
Definition: clo.c:684
const char * sensorId2SensorDir(int sensorId)
Definition: sensorInfo.c:315
float clo_getOptionFloat(clo_option_t *option)
Definition: clo.c:1167
#define EXIT_SUCCESS
Definition: GEO_basic.h:72
char * clo_getString(clo_optionList_t *list, const char *key)
Definition: clo.c:1357
void clo_readArgs(clo_optionList_t *list, int argc, char *argv[])
Definition: clo.c:2103
int instrumentPlatform2SensorId(const char *instrument, const char *platform)
Definition: sensorInfo.c:405
#define DEF_FLAG
Definition: l1c_input.h:14
#define NULL
Definition: decode_rs.h:63
char * key
Definition: clo.h:107
void clo_addAlias(clo_optionList_t *list, const char *key, const char *alias)
Definition: clo.c:646
int l2bin_input(int argc, char **argv, instr *input, const char *prog, const char *version)
char * clo_getOptionRawString(clo_option_t *option)
Definition: clo.c:1030
int clo_isSet(clo_optionList_t *list, const char *key)
Definition: clo.c:2270
int clo_getOptionInt(clo_option_t *option)
Definition: clo.c:1113
@ CLO_TYPE_FLOAT
Definition: clo.h:84
int l2bin_init_options(clo_optionList_t *list, const char *prog, const char *version)
Definition: l2bin_input.cpp:23
@ string
int sensorId2SubsensorId(int sensorId)
Definition: sensorInfo.c:438
int clo_isOptionSet(clo_option_t *option)
Definition: clo.c:2257
@ CLO_TYPE_BOOL
Definition: clo.h:81
instr * input
void clo_setEnableDumpOptions(int val)
Definition: clo.c:410
clo_optionList_t * clo_createList()
Definition: clo.c:532
int input_init(instr *input_str)
list(APPEND LIBS ${NETCDF_LIBRARIES}) find_package(GSL REQUIRED) include_directories($
Definition: CMakeLists.txt:8
void clo_setHelpStr(const char *str)
Definition: clo.c:487
@ CLO_TYPE_INT
Definition: clo.h:82
char * clo_getOptionString(clo_option_t *option)
Definition: clo.c:1050
void clo_printUsage(clo_optionList_t *list)
Definition: clo.c:1988
int want_verbose
@ CLO_TYPE_IFILE
Definition: clo.h:87
@ CLO_TYPE_OFILE
Definition: clo.h:88
clo_option_t * clo_getOption(clo_optionList_t *list, int i)
Definition: clo.c:908
void clo_addOptionAlias(clo_option_t *option, const char *alias)
Definition: clo.c:632
void clo_readFile(clo_optionList_t *list, const char *fileName)
Definition: clo.c:2210
int clo_getNumOptions(clo_optionList_t *list)
Definition: clo.c:1017
void parse_file_name(const char *inpath, char *outpath)
@ CLO_TYPE_HELP
Definition: clo.h:89
std::vector< std::string > readFileList(std::string fileName)
Definition: readFileList.cpp:9
flags
Definition: DDAlgorithm.h:22
const char * sensorId2SensorName(int sensorId)
Definition: sensorInfo.c:273
void clo_setVersion(const char *str)
Definition: clo.c:448
void clo_deleteList(clo_optionList_t *list)
Definition: clo.c:875
int l2bin_load_input(clo_optionList_t *list, instr *input)
const char * subsensorId2SubsensorDir(int subsensorId)
Definition: sensorInfo.c:329
enum clo_dataType_t dataType
Definition: clo.h:108
@ CLO_TYPE_STRING
Definition: clo.h:86
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
int clo_getOptionBool(clo_option_t *option)
Definition: clo.c:1087
version
Definition: setup.py:15