Go to the documentation of this file.
8 input_str->infile[0] =
'\0';
9 input_str->ofile[0] =
'\0';
10 input_str->pfile[0] =
'\0';
12 strcpy(input_str->out_parm,
"DEFAULT");
13 strcpy(input_str->repimg,
"ORIGINAL");
15 input_str->tflag =
'O';
17 input_str->syear = 9999;
18 input_str->sday = 999;
20 input_str->eyear = 9999;
21 input_str->eday = 999;
23 input_str->sorbit = -1;
24 input_str->eorbit = -1;
26 input_str->reduce_fac = 1;
30 input_str->merged[0] =
'\0';
32 input_str->loneast = +180;
33 input_str->lonwest = -180;
34 input_str->latnorth = +90;
35 input_str->latsouth = -90;
37 input_str->verbose = 0;
66 if (argc == 1)
return (-1);
72 printf(
"-E- %s: Error initializing input structure.\n", __FILE__);
79 for (
i = 1;
i < argc;
i++)
87 sprintf(str_buf,
"INFILE = %s|",
input->infile);
88 strcat(
input->parms, str_buf);
89 sprintf(str_buf,
"OFILE = %s|",
input->ofile);
90 strcat(
input->parms, str_buf);
91 sprintf(str_buf,
"PFILE = %s|",
input->ofile);
92 strcat(
input->parms, str_buf);
94 sprintf(str_buf,
"SYEAR = %ld|",
input->syear);
95 strcat(
input->parms, str_buf);
96 sprintf(str_buf,
"EYEAR = %ld|",
input->eyear);
97 strcat(
input->parms, str_buf);
99 sprintf(str_buf,
"SDAY = %ld|",
input->sday);
100 strcat(
input->parms, str_buf);
101 sprintf(str_buf,
"EDAY = %ld|",
input->eday);
102 strcat(
input->parms, str_buf);
104 sprintf(str_buf,
"SORBIT = %ld|",
input->sorbit);
105 strcat(
input->parms, str_buf);
106 sprintf(str_buf,
"EORBIT = %ld|",
input->eorbit);
107 strcat(
input->parms, str_buf);
109 sprintf(str_buf,
"OUT_PARM = %s|",
input->out_parm);
110 strcat(
input->parms, str_buf);
112 sprintf(str_buf,
"TFLAG = %c|",
input->tflag);
113 strcat(
input->parms, str_buf);
114 sprintf(str_buf,
"REPIMG = %s|",
input->repimg);
115 strcat(
input->parms, str_buf);
117 sprintf(str_buf,
"REDUCE_FAC = %ld|",
input->reduce_fac);
118 strcat(
input->parms, str_buf);
120 sprintf(str_buf,
"MERGED = %s|",
input->merged);
121 strcat(
input->parms, str_buf);
123 sprintf(str_buf,
"LONEAST = %f|",
input->loneast);
124 strcat(
input->parms, str_buf);
126 sprintf(str_buf,
"LONWEST = %f|",
input->lonwest);
127 strcat(
input->parms, str_buf);
129 sprintf(str_buf,
"LATNORTH = %f|",
input->latnorth);
130 strcat(
input->parms, str_buf);
132 sprintf(str_buf,
"LATSOUTH = %f|",
input->latsouth);
133 strcat(
input->parms, str_buf);
135 sprintf(str_buf,
"VERBOSE = %ld|",
input->verbose);
136 strcat(
input->parms, str_buf);
145 char tmp_file[FILENAME_MAX];
148 if ((tmp_str = strchr(arg,
'=')) ==
NULL) {
149 printf(
"Invalid argument \"%s\"\n", arg);
153 ilen1 = tmp_str - arg;
155 keyword[ilen1] =
'\0';
156 strcpy(parm_str, tmp_str + 1);
160 while (*tmp_str !=
'\0') {
161 if (isupper(*tmp_str)) *tmp_str = tolower(*tmp_str);
165 if (strncmp(keyword,
"parfile", 3) == 0) {
169 }
else if (strcmp(keyword,
"in") == 0) {
173 }
else if (strcmp(keyword,
"out") == 0) {
177 }
else if (strcmp(keyword,
"infile") == 0) {
181 }
else if (strcmp(keyword,
"ofile") == 0) {
185 }
else if (strcmp(keyword,
"pfile") == 0) {
189 }
else if (strcmp(keyword,
"rep") == 0) {
192 }
else if (strcmp(keyword,
"tflag") == 0) {
193 memcpy(&
input->tflag, parm_str, 1);
195 }
else if (strcmp(keyword,
"syear") == 0) {
196 input->syear = atoi(parm_str);
198 }
else if (strcmp(keyword,
"eyear") == 0) {
199 input->eyear = atoi(parm_str);
201 }
else if (strcmp(keyword,
"sday") == 0) {
202 input->sday = atoi(parm_str);
204 }
else if (strcmp(keyword,
"eday") == 0) {
205 input->eday = atoi(parm_str);
207 }
else if (strcmp(keyword,
"orbit1") == 0) {
208 input->sorbit = atoi(parm_str);
210 }
else if (strcmp(keyword,
"orbit2") == 0) {
211 input->eorbit = atoi(parm_str);
213 }
else if (strcmp(keyword,
"gsfcqual") == 0) {
215 }
else if (strcmp(keyword,
"out_parm") == 0) {
217 strcat(
input->out_parm, parm_str);
218 strcat(
input->out_parm,
":");
220 }
else if (strcmp(keyword,
"reduce_fac") == 0) {
221 input->reduce_fac = atoi(parm_str);
223 }
else if (strcmp(keyword,
"noext") == 0) {
224 input->noext = atoi(parm_str);
226 }
else if (strcmp(keyword,
"merged") == 0) {
230 }
else if (strcmp(keyword,
"loneast") == 0) {
231 input->loneast = atof(parm_str);
233 }
else if (strcmp(keyword,
"lonwest") == 0) {
234 input->lonwest = atof(parm_str);
236 }
else if (strcmp(keyword,
"latnorth") == 0) {
237 input->latnorth = atof(parm_str);
239 }
else if (strcmp(keyword,
"latsouth") == 0) {
240 input->latsouth = atof(parm_str);
242 }
else if (strcmp(keyword,
"verbose") == 0) {
243 input->verbose = atoi(parm_str);
254 printf(
"Invalid argument \"%s\"\n", arg);
263 if ((fp = fopen(pfile,
"r")) ==
NULL) {
264 printf(
"Error on opening the parameter file - %s\n", pfile);
268 while ((fgets(arg, 2047, fp)) !=
NULL) {
270 if (arg[0] ==
'#' || arg[0] ==
';' || arg[0] ==
' ' || arg[0] ==
'\0' ||
274 arg[strlen(arg) - 1] =
'\0';
void parse_file_name(const char *inpath, char *outpath)
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")