Go to the documentation of this file.
15 static char default_flaguse[1024];
23 strcpy(default_flaguse,
"ATMFAIL,LAND,HIGLINT,HILT,HISATZEN,STRAYLIGHT,CLDICE,COCCOLITH,LOWLW,CHLFAIL,NAVWARN,ABSAER,MAXAERITER,ATMWARN,HISOLZEN,NAVFAIL");
28 input->vcal_depth = -1000;
29 input->vcal_min_nbin = 4;
30 input->vcal_min_nscene = 3;
32 input->band_shift_opt = 0;
34 input->demfile[0] =
'\0';
50 sprintf(tmpStr,
"Usage: l2binmatch argument-list\n\n");
52 strcat(tmpStr,
" This program matches pixels from a L2 file with bins from a L3 file\n");
54 strcat(tmpStr,
" The argument-list is a set of keyword=value pairs. The arguments can\n");
55 strcat(tmpStr,
" be specified on the commandline, or put into a parameter file, or the\n");
56 strcat(tmpStr,
" two methods can be used together, with commandline over-riding.\n\n");
57 strcat(tmpStr,
"The list of valid keywords follows:\n");
65 strcpy(tmpStr,
"output file format\n");
66 strcat(tmpStr,
" netcdf4: output a netCDF version 4 file\n");
67 strcat(tmpStr,
" hdf4: output a HDF version 4 file");
80 strcpy(tmpStr,
"bandshifting option \n");
81 strcat(tmpStr,
" 1: apply bio-optical bandshift\n");
82 strcat(tmpStr,
" 0: linear interpolation");
85 strcpy(tmpStr,
"depth to use to exclude data from target file\n");
86 strcat(tmpStr,
" e.g. -1000 excludes depths less than 1000m\n");
89 strcpy(tmpStr,
"minimum # of samples in a bin for acceptance");
92 strcpy(tmpStr,
"minimum # of scenes in a bin for acceptance");
114 char tmpStr[FILENAME_MAX];
118 if ((dataRoot = getenv(
"OCDATAROOT")) ==
NULL) {
119 fprintf(
stderr,
"-E- OCDATAROOT environment variable is not defined.\n");
124 sprintf(tmpStr,
"%s/common/l2binmatch_defaults.par", dataRoot);
126 fprintf(
stderr,
"Loading default parameters from %s\n", tmpStr);
143 char tmp_file[FILENAME_MAX];
149 char keyword[FILENAME_MAX];
155 if (default_l2prod[0]) {
160 for (optionId = 0; optionId < numOptions; optionId++) {
166 while (*strVal !=
'\0') {
167 *strVal = tolower(*strVal);
171 if (strcmp(keyword,
"help") == 0)
173 else if (strcmp(keyword,
"version") == 0)
175 else if (strcmp(keyword,
"dump_options") == 0)
177 else if (strcmp(keyword,
"dump_options_paramfile") == 0)
179 else if (strcmp(keyword,
"dump_options_xmlfile") == 0)
181 else if (strcmp(keyword,
"par") == 0)
183 else if (strcmp(keyword,
"ifile") == 0) {
188 }
else if (strcmp(keyword,
"ofile") == 0) {
195 }
else if (strcmp(keyword,
"oformat") == 0) {
198 if (tmpStr ==
NULL) {
199 printf(
"-E- l2binmatch_load_input: oformat=%s is not a recognized file format\n",
205 }
else if (strcmp(keyword,
"flaguse") == 0) {
207 input->flaguse[0] =
'\0';
210 strcat(
input->flaguse,
",");
211 strcat(
input->flaguse, strArray[
i]);
214 }
else if (strcmp(keyword,
"l2prod") == 0) {
216 input->l2prod[0][0] =
'\0';
219 strcat(
input->l2prod[0],
" ");
220 strcat(
input->l2prod[0], strArray[
i]);
223 }
else if (strcmp(keyword,
"deflate") == 0) {
226 }
else if (strcmp(keyword,
"spixl") == 0) {
229 }
else if (strcmp(keyword,
"epixl") == 0) {
232 }
else if (strcmp(keyword,
"dpixl") == 0) {
235 }
else if (strcmp(keyword,
"sline") == 0) {
238 }
else if (strcmp(keyword,
"eline") == 0) {
241 }
else if (strcmp(keyword,
"dline") == 0) {
244 }
else if (strcmp(keyword,
"subsamp") == 0) {
247 }
else if (strcmp(keyword,
"band_shift_opt") == 0) {
250 }
else if (strcmp(keyword,
"tgtfile") == 0) {
257 }
else if (strcmp(keyword,
"vcal_depth") == 0) {
260 }
else if (strcmp(keyword,
"vcal_min_nbin") == 0) {
263 }
else if (strcmp(keyword,
"vcal_min_nscene") == 0) {
266 }
else if (strcmp(keyword,
"demfile") == 0) {
272 fprintf(
stderr,
"Invalid argument \"%s\"\n", keyword);
311 fprintf(
stderr,
"-E- %s: Error initializing input structure.\n", __FILE__);
317 fprintf(
stderr,
"-E- %s: Error reading program options.\n", __FILE__);
323 fprintf(
stderr,
"-E- %s: Error loading options into input structure.\n", __FILE__);
331 strcat(
l1_input->input_parms,
"\n");
332 sprintf(str_buf,
"ifile = %s ",
input->ifile[0]);
333 strcat(
l1_input->input_parms, str_buf);
334 strcat(
l1_input->input_parms,
"\n");
336 sprintf(str_buf,
"ofile = %s",
input->ofile[0]);
337 strcat(
l1_input->input_parms, str_buf);
338 strcat(
l1_input->input_parms,
"\n");
340 sprintf(str_buf,
"l2prod = %s",
input->l2prod[0]);
341 strcat(
l1_input->input_parms, str_buf);
342 strcat(
l1_input->input_parms,
"\n");
344 sprintf(str_buf,
"oformat = %s",
input->oformat);
345 strcat(
l1_input->input_parms, str_buf);
346 strcat(
l1_input->input_parms,
"\n");
348 sprintf(str_buf,
"deflate = %5d",
input->deflate);
349 strcat(
l1_input->input_parms, str_buf);
350 strcat(
l1_input->input_parms,
"\n");
352 sprintf(str_buf,
"spixl = %5d",
l1_input->spixl);
353 strcat(
l1_input->input_parms, str_buf);
354 strcat(
l1_input->input_parms,
"\n");
356 sprintf(str_buf,
"epixl = %5d",
l1_input->epixl);
357 strcat(
l1_input->input_parms, str_buf);
358 strcat(
l1_input->input_parms,
"\n");
360 sprintf(str_buf,
"dpixl = %5d",
l1_input->dpixl);
361 strcat(
l1_input->input_parms, str_buf);
362 strcat(
l1_input->input_parms,
"\n");
364 sprintf(str_buf,
"sline = %5d",
l1_input->sline);
365 strcat(
l1_input->input_parms, str_buf);
366 strcat(
l1_input->input_parms,
"\n");
368 sprintf(str_buf,
"eline = %5d",
l1_input->eline);
369 strcat(
l1_input->input_parms, str_buf);
370 strcat(
l1_input->input_parms,
"\n");
372 sprintf(str_buf,
"dline = %5d",
l1_input->dline);
373 strcat(
l1_input->input_parms, str_buf);
374 strcat(
l1_input->input_parms,
"\n");
376 sprintf(str_buf,
"subsamp = %5d",
input->subsamp);
377 strcat(
l1_input->input_parms, str_buf);
378 strcat(
l1_input->input_parms,
"\n");
380 sprintf(str_buf,
"band_shift_opt = %3d",
input->band_shift_opt);
381 strcat(
l1_input->input_parms, str_buf);
382 strcat(
l1_input->input_parms,
"\n");
384 sprintf(str_buf,
"vcal_depth = %8.4f",
input->vcal_depth);
385 strcat(
l1_input->input_parms, str_buf);
386 strcat(
l1_input->input_parms,
"\n");
388 sprintf(str_buf,
"vcal_min_nbin = %d",
input->vcal_min_nbin);
389 strcat(
l1_input->input_parms, str_buf);
390 strcat(
l1_input->input_parms,
"\n");
392 sprintf(str_buf,
"vcal_min_nscene = %d",
input->vcal_min_nscene);
393 strcat(
l1_input->input_parms, str_buf);
394 strcat(
l1_input->input_parms,
"\n");
396 sprintf(str_buf,
"demfile = %s",
input->demfile);
397 strcat(
l1_input->input_parms, str_buf);
398 strcat(
l1_input->input_parms,
"\n");
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 * allocateMemory(size_t numBytes, const char *name)
char ** clo_getOptionStrings(clo_option_t *option, int *count)
clo_option_t * clo_findOption(clo_optionList_t *list, const char *key)
int clo_getOptionInt(clo_option_t *option)
int clo_isOptionSet(clo_option_t *option)
void clo_setHelpStr(const char *str)
char * clo_getOptionString(clo_option_t *option)
clo_option_t * clo_getOption(clo_optionList_t *list, int i)
void clo_readFile(clo_optionList_t *list, const char *fileName)
int clo_getNumOptions(clo_optionList_t *list)
void parse_file_name(const char *inpath, char *outpath)
void clo_setVersion(const char *str)
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")