Go to the documentation of this file.
18 char softwareVersion[200];
25 sprintf(tmpStr,
"Usage: l3bindump argument-list\n\n");
26 strcat(tmpStr,
" The argument-list is a set of keyword=value pairs. The arguments can\n");
27 strcat(tmpStr,
" be specified on the command line, or put into a parameter file, or the\n");
28 strcat(tmpStr,
" two methods can be used together, with command line overriding.\n\n");
29 strcat(tmpStr,
" return value: 0=OK, 1=error, 110=requested bin(s) not found\n");
30 strcat(tmpStr,
" file data.\n\n");
31 strcat(tmpStr,
" There are 3 use cases:\n");
32 strcat(tmpStr,
" \t1) bin_number\n");
33 strcat(tmpStr,
" \t2) region defined by lat, lon, and radius (in km)\n");
34 strcat(tmpStr,
" \t3) region defined by north, south, west, east\n");
36 strcat(tmpStr,
"The list of valid keywords follows:\n");
42 strcpy(tmpStr,
"output file format\n");
43 strcat(tmpStr,
" txt: plain text columnar format\n");
44 strcat(tmpStr,
" seabass: SeaBASS format");
63 char tmp_file[FILENAME_MAX];
68 char keyword[FILENAME_MAX];
73 for (optionId = 0; optionId < numOptions; optionId++) {
84 while (*strVal !=
'\0') {
85 *strVal = tolower(*strVal);
89 if (strcmp(keyword,
"help") == 0)
91 else if (strcmp(keyword,
"version") == 0)
93 else if (strncmp(keyword,
"dump_options", 12) == 0)
95 else if (strcmp(keyword,
"par") == 0)
97 else if (strcmp(keyword,
"ifile") == 0) {
102 }
else if (strcmp(keyword,
"ofile") == 0) {
108 }
else if (strcmp(keyword,
"oformat") == 0) {
111 if (tmpStr ==
NULL) {
112 printf(
"-E- l2gen_load_input: oformat=%s is not a recognized file format\n",
118 }
else if (strcmp(keyword,
"l3bprod") == 0) {
120 input->l3bprod[0] =
'\0';
123 strcat(
input->l3bprod,
" ");
124 strcat(
input->l3bprod, strArray[
i]);
126 }
else if (strcmp(keyword,
"west") == 0) {
128 }
else if (strcmp(keyword,
"east") == 0) {
130 }
else if (strcmp(keyword,
"north") == 0) {
132 }
else if (strcmp(keyword,
"south") == 0) {
134 }
else if (strcmp(keyword,
"lat") == 0) {
136 }
else if (strcmp(keyword,
"lon") == 0) {
138 }
else if (strcmp(keyword,
"bin_number") == 0) {
140 }
else if (strcmp(keyword,
"radius") == 0) {
142 }
else if (strcmp(keyword,
"verbose") == 0) {
145 printf(
"-E- Invalid argument \"%s\"\n", keyword);
155 if (
input->bin_number >= 0 && (
input->radius != -999 ||
157 input->north != -999 ||
input->south != -999 ||
158 input->west != -999 ||
input->east != -999)) {
159 printf(
"-E- Invalid argument set: bin_number cannot be provided if lon/lat/radius or NSWE are provided \n");
163 if (
input->radius != -999 && (
input->lat == -999 ||
input->lon == -999)) {
164 printf(
"-E- Invalid argument set: radius reqiures lon/lat to be provided\n");
168 if (
input->lat != -999 &&
input->lon == -999) {
169 printf(
"-E- Invalid argument set: if lat is set, lon must be provided\n");
173 if (
input->lat == -999 &&
input->lon != -999) {
174 printf(
"-E- Invalid argument set: if lon is set, lat must be provided\n");
178 if ((
input->radius != -999 ||
input->lat != -999 ||
input->lon != -999) &&
179 (
input->north != -999 ||
input->south != -999 ||
180 input->west != -999 ||
input->east != -999)) {
181 printf(
"-E- Choose either lon/lat/radius or NSWE\n");
204 char tmpStr[FILENAME_MAX];
205 char progName[] =
"l3bindump";
209 if ((dataRoot = getenv(
"OCDATAROOT")) ==
NULL) {
210 printf(
"-E- OCDATAROOT environment variable is not defined.\n");
219 sprintf(tmpStr,
"%s/common/%s_defaults.par", dataRoot, progName);
221 printf(
"Loading default parameters from %s\n", tmpStr);
226 printf(
"Loading command line parameters\n\n");
239 input->ifile[0] =
'\0';
240 input->ofile [0] =
'\0';
241 input->oformat[0] =
'\0';
242 input->l3bprod[0] =
'\0';
250 input->bin_number = -1;
251 input->radius = -999;
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 $
char ** clo_getOptionStrings(clo_option_t *option, int *count)
int clo_isOptionSet(clo_option_t *option)
void clo_setVersion2(const char *programName, const char *versionStr)
void clo_setSelectOptionKeys(char **keys)
int64_t clo_getOptionInt64(clo_option_t *option)
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_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_dumpOption(clo_option_t *option)
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)