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