Go to the documentation of this file.
10 static char mainProgramName[50];
12 static char *l3bin_optionKeys[] = {
17 "dump_options_paramfile",
18 "dump_options_xmlfile",
46 static char *l3binmerge_optionKeys[] = {
51 "dump_options_paramfile",
52 "dump_options_xmlfile",
69 input_str->infile[0] =
'\0';
70 input_str->ofile[0] =
'\0';
71 input_str->pfile[0] =
'\0';
73 strcpy(input_str->out_parm,
"DEFAULT");
74 strcpy(input_str->pversion,
"Unspecified");
76 input_str->syear = 9999;
77 input_str->sday = 999;
79 input_str->eyear = 9999;
80 input_str->eday = 999;
82 input_str->sorbit = -1;
83 input_str->eorbit = -1;
85 input_str->reduce_fac = 1;
86 input_str->resolve[0] =
'\0';
90 input_str->merged[0] =
'\0';
92 input_str->loneast = +180;
93 input_str->lonwest = -180;
94 input_str->latnorth = +90;
95 input_str->latsouth = -90;
97 input_str->verbose = 0;
98 input_str->unit_wgt = 0;
99 input_str->median = 0;
100 input_str->union_bins = 0;
102 input_str->deflate = 0;
103 input_str->oformat[0] =
'\0';
105 input_str->composite_prod[0] =
'\0';
106 input_str->composite_scheme[0] =
'\0';
107 input_str->doi[0] =
'\0';
117 strcpy(mainProgramName, prog);
119 if (!strcmp(prog,
"l3bin")) {
121 }
else if (!strcmp(prog,
"l3binmerge")) {
124 sprintf(tmpStr,
"%s ifile=input-file ofile=output-file prod=prodlist\n\n", prog);
125 strcat(tmpStr,
" The input file is a list of L3 binned files.\n");
126 strcat(tmpStr,
" The argument-list is a set of keyword=value pairs. The arguments can\n");
127 strcat(tmpStr,
" be specified on the commandline, or put into a parameter file, or the\n");
128 strcat(tmpStr,
" two methods can be used together, with commandline over-riding.\n\n");
129 strcat(tmpStr,
" return value: 0=OK, 1=error, 110=no pixels binned. \n\n");
130 strcat(tmpStr,
"The list of valid keywords follows:\n");
136 strcpy(tmpStr,
"input file name with list of L3 files");
145 strcpy(tmpStr,
"output file format\n");
146 strcat(tmpStr,
" hdf4: output a HDF4 file\n");
147 strcat(tmpStr,
" netCDF4: output a netCDF4 file\n");
148 strcat(tmpStr,
" hdf5: output a HDF5 file\n");
151 strcpy(tmpStr,
"set to 1 to suppress generation of\n external files");
160 strcpy(tmpStr,
"bin resolution, overrides reduce_frac if defined\n");
161 strcat(tmpStr,
" H: 0.5km\n");
162 strcat(tmpStr,
" Q: 250m\n");
163 strcat(tmpStr,
" HQ: 100m\n");
164 strcat(tmpStr,
" HH: 50m\n");
165 strcat(tmpStr,
" 1: 1.1km\n");
166 strcat(tmpStr,
" 2: 2.3km\n");
167 strcat(tmpStr,
" 4: 4.6km\n");
168 strcat(tmpStr,
" 9: 9.2km\n");
169 strcat(tmpStr,
" 18: 18.5km\n");
170 strcat(tmpStr,
" 36: 36km\n");
171 strcat(tmpStr,
" 1D: 1 degree\n");
172 strcat(tmpStr,
" HD: 0.5 degree\n");
173 strcat(tmpStr,
" QD: 0.25 degree");
187 strcpy(tmpStr,
"bin products\n [default=all products in L3 file]\n");
203 char tmp_file[FILENAME_MAX];
204 int numOptions, optionId;
208 for (optionId = 0; optionId < numOptions; optionId++) {
219 while (*tmp_str !=
'\0') {
220 if (isupper(*tmp_str)) *tmp_str = tolower(*tmp_str);
223 if (strcmp(keyword,
"help") == 0)
225 else if (strcmp(keyword,
"version") == 0)
227 else if (strncmp(keyword,
"dump_options", 12) == 0)
229 else if (strncmp(keyword,
"par", 3) == 0)
231 else if (strcmp(keyword,
"ifile") == 0) {
236 }
else if (strcmp(keyword,
"ofile") == 0) {
241 }
else if (strcmp(keyword,
"pfile") == 0) {
246 }
else if (strcmp(keyword,
"pversion") == 0) {
249 }
else if (strcmp(keyword,
"syear") == 0) {
252 }
else if (strcmp(keyword,
"eyear") == 0) {
255 }
else if (strcmp(keyword,
"sday") == 0) {
258 }
else if (strcmp(keyword,
"eday") == 0) {
261 }
else if (strcmp(keyword,
"orbit1") == 0) {
264 }
else if (strcmp(keyword,
"orbit2") == 0) {
267 }
else if (strcmp(keyword,
"prod") == 0) {
270 strcat(
input->out_parm,
":");
272 }
else if (strcmp(keyword,
"reduce_fac") == 0) {
275 }
else if (strcmp(keyword,
"resolve") == 0) {
280 }
else if (strcmp(keyword,
"noext") == 0) {
283 }
else if (strcmp(keyword,
"merged") == 0) {
288 }
else if (strcmp(keyword,
"loneast") == 0) {
291 }
else if (strcmp(keyword,
"lonwest") == 0) {
294 }
else if (strcmp(keyword,
"latnorth") == 0) {
297 }
else if (strcmp(keyword,
"latsouth") == 0) {
300 }
else if (strcmp(keyword,
"verbose") == 0) {
303 }
else if (strcmp(keyword,
"unit_wgt") == 0) {
306 }
else if (strcmp(keyword,
"union_bins") == 0) {
309 }
else if (strcmp(keyword,
"median") == 0) {
312 }
else if (strcmp(keyword,
"deflate") == 0) {
315 }
else if (strcmp(keyword,
"oformat") == 0) {
319 }
else if (strcmp(keyword,
"composite_prod") == 0) {
324 }
else if (strcmp(keyword,
"composite_scheme") == 0) {
329 }
else if (strcmp(keyword,
"doi") == 0) {
343 printf(
"Invalid argument \"%s\"\n", keyword);
374 printf(
"-E- %s: Error initializing input structure.\n", __FILE__);
397 printf(
"-E- %s: Error loading options into input structure.\n", __FILE__);
409 sprintf(str_buf,
"infile = %s\n",
input->infile);
410 strcat(
input->parms, str_buf);
411 sprintf(str_buf,
"ofile = %s\n",
input->ofile);
412 strcat(
input->parms, str_buf);
413 sprintf(str_buf,
"pfile = %s\n",
input->ofile);
414 strcat(
input->parms, str_buf);
415 sprintf(str_buf,
"oformat = %s\n",
input->oformat);
416 strcat(
input->parms, str_buf);
418 sprintf(str_buf,
"syear = %d\n",
input->syear);
419 strcat(
input->parms, str_buf);
420 sprintf(str_buf,
"eyear = %d\n",
input->eyear);
421 strcat(
input->parms, str_buf);
423 sprintf(str_buf,
"sday = %d\n",
input->sday);
424 strcat(
input->parms, str_buf);
425 sprintf(str_buf,
"eday = %d\n",
input->eday);
426 strcat(
input->parms, str_buf);
428 sprintf(str_buf,
"sorbit = %d\n",
input->sorbit);
429 strcat(
input->parms, str_buf);
430 sprintf(str_buf,
"eorbit = %d\n",
input->eorbit);
431 strcat(
input->parms, str_buf);
433 sprintf(str_buf,
"out_parm = %s\n",
input->out_parm);
434 strcat(
input->parms, str_buf);
436 sprintf(str_buf,
"processing_version = %s\n",
input->pversion);
437 strcat(
input->parms, str_buf);
439 sprintf(str_buf,
"reduce_fac = %d\n",
input->reduce_fac);
440 strcat(
input->parms, str_buf);
442 sprintf(str_buf,
"resolve = %s\n",
input->resolve);
443 strcat(
input->parms, str_buf);
445 sprintf(str_buf,
"merged = %s\n",
input->merged);
446 strcat(
input->parms, str_buf);
448 sprintf(str_buf,
"loneast = %f\n",
input->loneast);
449 strcat(
input->parms, str_buf);
451 sprintf(str_buf,
"lonwest = %f\n",
input->lonwest);
452 strcat(
input->parms, str_buf);
454 sprintf(str_buf,
"latnorth = %f\n",
input->latnorth);
455 strcat(
input->parms, str_buf);
457 sprintf(str_buf,
"latsouth = %f\n",
input->latsouth);
458 strcat(
input->parms, str_buf);
460 sprintf(str_buf,
"verbose = %d\n",
input->verbose);
461 strcat(
input->parms, str_buf);
463 sprintf(str_buf,
"unit_wgt = %d\n",
input->unit_wgt);
464 strcat(
input->parms, str_buf);
466 sprintf(str_buf,
"median = %d\n",
input->median);
467 strcat(
input->parms, str_buf);
469 sprintf(str_buf,
"deflate = %d\n",
input->deflate);
470 strcat(
input->parms, str_buf);
472 sprintf(str_buf,
"composite_prod = %s\n",
input->composite_prod);
473 strcat(
input->parms, str_buf);
475 sprintf(str_buf,
"composite_scheme = %s\n",
input->composite_scheme);
476 strcat(
input->parms, str_buf);
478 sprintf(str_buf,
"doi = %s\n",
input->doi);
479 strcat(
input->parms, str_buf);
clo_option_t * clo_addOption(clo_optionList_t *list, const char *key, enum clo_dataType_t dataType, const char *defaultVal, const char *desc)
float clo_getOptionFloat(clo_option_t *option)
void clo_readArgs(clo_optionList_t *list, int argc, char *argv[])
void clo_addAlias(clo_optionList_t *list, const char *key, const char *alias)
char * clo_getOptionRawString(clo_option_t *option)
int clo_getOptionInt(clo_option_t *option)
int clo_isOptionSet(clo_option_t *option)
void clo_setSelectOptionKeys(char **keys)
void clo_setEnableDumpOptions(int val)
clo_optionList_t * clo_createList()
list(APPEND LIBS ${NETCDF_LIBRARIES}) find_package(GSL REQUIRED) include_directories($
void clo_setHelpStr(const char *str)
char * clo_getOptionString(clo_option_t *option)
void clo_printUsage(clo_optionList_t *list)
clo_option_t * clo_getOption(clo_optionList_t *list, int i)
void clo_addOptionAlias(clo_option_t *option, const char *alias)
int clo_getNumOptions(clo_optionList_t *list)
void parse_file_name(const char *inpath, char *outpath)
std::vector< std::string > readFileList(std::string fileName)
void clo_setVersion(const char *str)
void clo_deleteList(clo_optionList_t *list)
enum clo_dataType_t dataType
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)