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",
44 static char *l3binmerge_optionKeys[] = {
49 "dump_options_paramfile",
50 "dump_options_xmlfile",
67 input_str->infile[0] =
'\0';
68 input_str->ofile[0] =
'\0';
69 input_str->pfile[0] =
'\0';
71 strcpy(input_str->out_parm,
"DEFAULT");
72 strcpy(input_str->pversion,
"Unspecified");
74 input_str->syear = 9999;
75 input_str->sday = 999;
77 input_str->eyear = 9999;
78 input_str->eday = 999;
80 input_str->sorbit = -1;
81 input_str->eorbit = -1;
83 input_str->reduce_fac = 1;
87 input_str->merged[0] =
'\0';
89 input_str->loneast = +180;
90 input_str->lonwest = -180;
91 input_str->latnorth = +90;
92 input_str->latsouth = -90;
94 input_str->verbose = 0;
95 input_str->unit_wgt = 0;
96 input_str->median = 0;
97 input_str->union_bins = 0;
99 input_str->deflate = 0;
100 input_str->oformat[0] =
'\0';
102 input_str->composite_prod[0] =
'\0';
103 input_str->composite_scheme[0] =
'\0';
113 strcpy(mainProgramName, prog);
115 if (!strcmp(prog,
"l3bin")) {
117 }
else if (!strcmp(prog,
"l3binmerge")) {
120 sprintf(tmpStr,
"%s ifile=input-file ofile=output-file prod=prodlist\n\n", prog);
121 strcat(tmpStr,
" The input file is a list of L3 binned files.\n");
122 strcat(tmpStr,
" The argument-list is a set of keyword=value pairs. The arguments can\n");
123 strcat(tmpStr,
" be specified on the commandline, or put into a parameter file, or the\n");
124 strcat(tmpStr,
" two methods can be used together, with commandline over-riding.\n\n");
125 strcat(tmpStr,
" return value: 0=OK, 1=error, 110=no pixels binned. \n\n");
126 strcat(tmpStr,
"The list of valid keywords follows:\n");
132 strcpy(tmpStr,
"input file name with list of L3 files");
141 strcpy(tmpStr,
"output file format\n");
142 strcat(tmpStr,
" hdf4: output a HDF4 file\n");
143 strcat(tmpStr,
" netCDF4: output a netCDF4 file\n");
144 strcat(tmpStr,
" hdf5: output a HDF5 file\n");
147 strcpy(tmpStr,
"set to 1 to suppress generation of\n external files");
168 strcpy(tmpStr,
"bin products\n [default=all products in L3 file]\n");
181 char tmp_file[FILENAME_MAX];
182 int numOptions, optionId;
186 for (optionId = 0; optionId < numOptions; optionId++) {
197 while (*tmp_str !=
'\0') {
198 if (isupper(*tmp_str)) *tmp_str = tolower(*tmp_str);
201 if (strcmp(keyword,
"help") == 0)
203 else if (strcmp(keyword,
"version") == 0)
205 else if (strncmp(keyword,
"dump_options", 12) == 0)
207 else if (strncmp(keyword,
"par", 3) == 0)
209 else if (strcmp(keyword,
"ifile") == 0) {
214 }
else if (strcmp(keyword,
"ofile") == 0) {
219 }
else if (strcmp(keyword,
"pfile") == 0) {
224 }
else if (strcmp(keyword,
"pversion") == 0) {
227 }
else if (strcmp(keyword,
"syear") == 0) {
230 }
else if (strcmp(keyword,
"eyear") == 0) {
233 }
else if (strcmp(keyword,
"sday") == 0) {
236 }
else if (strcmp(keyword,
"eday") == 0) {
239 }
else if (strcmp(keyword,
"orbit1") == 0) {
242 }
else if (strcmp(keyword,
"orbit2") == 0) {
245 }
else if (strcmp(keyword,
"prod") == 0) {
248 strcat(
input->out_parm,
":");
250 }
else if (strcmp(keyword,
"reduce_fac") == 0) {
253 }
else if (strcmp(keyword,
"noext") == 0) {
256 }
else if (strcmp(keyword,
"merged") == 0) {
261 }
else if (strcmp(keyword,
"loneast") == 0) {
264 }
else if (strcmp(keyword,
"lonwest") == 0) {
267 }
else if (strcmp(keyword,
"latnorth") == 0) {
270 }
else if (strcmp(keyword,
"latsouth") == 0) {
273 }
else if (strcmp(keyword,
"verbose") == 0) {
276 }
else if (strcmp(keyword,
"unit_wgt") == 0) {
279 }
else if (strcmp(keyword,
"union_bins") == 0) {
282 }
else if (strcmp(keyword,
"median") == 0) {
285 }
else if (strcmp(keyword,
"deflate") == 0) {
288 }
else if (strcmp(keyword,
"oformat") == 0) {
292 }
else if (strcmp(keyword,
"composite_prod") == 0) {
297 }
else if (strcmp(keyword,
"composite_scheme") == 0) {
312 printf(
"Invalid argument \"%s\"\n", keyword);
343 printf(
"-E- %s: Error initializing input structure.\n", __FILE__);
366 printf(
"-E- %s: Error loading options into input structure.\n", __FILE__);
376 sprintf(str_buf,
"infile = %s\n",
input->infile);
377 strcat(
input->parms, str_buf);
378 sprintf(str_buf,
"ofile = %s\n",
input->ofile);
379 strcat(
input->parms, str_buf);
380 sprintf(str_buf,
"pfile = %s\n",
input->ofile);
381 strcat(
input->parms, str_buf);
382 sprintf(str_buf,
"oformat = %s\n",
input->oformat);
383 strcat(
input->parms, str_buf);
385 sprintf(str_buf,
"syear = %d\n",
input->syear);
386 strcat(
input->parms, str_buf);
387 sprintf(str_buf,
"eyear = %d\n",
input->eyear);
388 strcat(
input->parms, str_buf);
390 sprintf(str_buf,
"sday = %d\n",
input->sday);
391 strcat(
input->parms, str_buf);
392 sprintf(str_buf,
"eday = %d\n",
input->eday);
393 strcat(
input->parms, str_buf);
395 sprintf(str_buf,
"sorbit = %d\n",
input->sorbit);
396 strcat(
input->parms, str_buf);
397 sprintf(str_buf,
"eorbit = %d\n",
input->eorbit);
398 strcat(
input->parms, str_buf);
400 sprintf(str_buf,
"out_parm = %s\n",
input->out_parm);
401 strcat(
input->parms, str_buf);
403 sprintf(str_buf,
"processing_version = %s\n",
input->pversion);
404 strcat(
input->parms, str_buf);
406 sprintf(str_buf,
"reduce_fac = %d\n",
input->reduce_fac);
407 strcat(
input->parms, str_buf);
409 sprintf(str_buf,
"merged = %s\n",
input->merged);
410 strcat(
input->parms, str_buf);
412 sprintf(str_buf,
"loneast = %f\n",
input->loneast);
413 strcat(
input->parms, str_buf);
415 sprintf(str_buf,
"lonwest = %f\n",
input->lonwest);
416 strcat(
input->parms, str_buf);
418 sprintf(str_buf,
"latnorth = %f\n",
input->latnorth);
419 strcat(
input->parms, str_buf);
421 sprintf(str_buf,
"latsouth = %f\n",
input->latsouth);
422 strcat(
input->parms, str_buf);
424 sprintf(str_buf,
"verbose = %d\n",
input->verbose);
425 strcat(
input->parms, str_buf);
427 sprintf(str_buf,
"unit_wgt = %d\n",
input->unit_wgt);
428 strcat(
input->parms, str_buf);
430 sprintf(str_buf,
"median = %d\n",
input->median);
431 strcat(
input->parms, str_buf);
433 sprintf(str_buf,
"deflate = %d\n",
input->deflate);
434 strcat(
input->parms, str_buf);
436 sprintf(str_buf,
"composite_prod = %s\n",
input->composite_prod);
437 strcat(
input->parms, str_buf);
439 sprintf(str_buf,
"composite_scheme = %s\n",
input->composite_scheme);
440 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[])
list(APPEND LIBS ${PGSTK_LIBRARIES}) add_executable(atteph_info_modis atteph_info_modis.c) target_link_libraries(atteph_info_modis $
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()
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)
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)