Go to the documentation of this file.
26 #define NEWSENSINFO 32
50 static int32_t sensorID_s = -999;
53 static float *
fwhm, *fwave;
56 static float window1, window2, window3, window4,
wp94c,
w1p14c;
63 printf(
"\nLoading atrem (atmospheric removal - water vapor,etc.) information for %s\n",
69 if ((filedir = getenv(
"OCDATAROOT")) ==
NULL) {
70 printf(
"-E- %s: OCDATAROOT env variable undefined.\n", __FILE__);
81 strcat(
filename,
"/msl12_atrem_info.dat");
84 printf(
"Opening atrem information file %s\n Looking for %s\n",
filename, pname);
87 fprintf(
stderr,
"-E- %s line %d: unable to open %s for reading\n",
94 while (fgets(
line, 80, fp)) {
101 if (
line[0] ==
'#' ||
line[0] ==
'\n')
103 if (!(
p = strchr(
line,
'=')))
110 if (strcmp(
name,
"Nbands") == 0) {
117 printf(
"-E- %s: error find Nbands in %s.\n", __FILE__,
filename);
126 if ((fwave = (
float*) calloc(
nbands,
sizeof (
float))) ==
NULL)
130 "-E- %s: error allocating space for %d bands in sensor info.\n",
138 while (fgets(
line, 80, fp)) {
145 if (
line[0] ==
'#' ||
line[0] ==
'\n')
147 if (!(
p = strchr(
line,
'=')))
156 if (strcmp(
name,
"Nbands") == 0)
158 else if (strcmp(
name,
"h2o") == 0)
160 else if (strcmp(
name,
"o2") == 0)
162 else if (strcmp(
name,
"o3") == 0)
164 else if (strcmp(
name,
"ch4") == 0)
166 else if (strcmp(
name,
"co") == 0)
168 else if (strcmp(
name,
"n2o") == 0)
170 else if (strcmp(
name,
"no2") == 0)
172 else if (strcmp(
name,
"co2") == 0)
174 else if (strcmp(
name,
"vrto3") == 0)
176 else if (strcmp(
name,
"sno2") == 0)
178 else if (strcmp(
name,
"window1") == 0)
179 window1 = (
float) atof(
value);
180 else if (strcmp(
name,
"window2") == 0)
182 else if (strcmp(
name,
"window3") == 0)
183 window3 = (
float) atof(
value);
184 else if (strcmp(
name,
"window4") == 0)
186 else if (strcmp(
name,
"w1p14c") == 0)
188 else if (strcmp(
name,
"wp94c") == 0)
190 else if (strcmp(
name,
"nb1") == 0)
192 else if (strcmp(
name,
"nb2") == 0)
194 else if (strcmp(
name,
"nb3") == 0)
196 else if (strcmp(
name,
"nb4") == 0)
198 else if (strcmp(
name,
"nbp94") == 0)
200 else if (strcmp(
name,
"nb1p14") == 0)
202 else if (strcmp(
name,
"full_calc") == 0)
204 else if (strcmp(
name,
"dogeom") == 0)
205 dogeom = (int32_t) atoi(
value);
208 sprintf(param,
"fwhm(%d)",
i + 1);
209 if (strcmp(
name, param) == 0) {
213 sprintf(param,
"Lambda(%d)",
i + 1);
214 if (strcmp(
name, param) == 0) {
230 printf(
"window1=%f\n", window1);
231 printf(
" %3s %8s\n",
"Bnd",
247 if (strcmp(pname,
"Nbands") == 0)
249 else if (strcmp(pname,
"fwhm") == 0)
250 *pval = (
void *)
fwhm;
251 else if (strcmp(pname,
"Lambda") == 0)
252 *pval = (
void *) fwave;
253 else if (strcmp(pname,
"o2") == 0)
254 *pval = (
void *) &
o2;
255 else if (strcmp(pname,
"o3") == 0)
256 *pval = (
void *) &
o3;
257 else if (strcmp(pname,
"n2o") == 0)
258 *pval = (
void *) &
n2o;
259 else if (strcmp(pname,
"ch4") == 0)
260 *pval = (
void *) &
ch4;
261 else if (strcmp(pname,
"co") == 0)
262 *pval = (
void *) &
co;
263 else if (strcmp(pname,
"no2") == 0)
264 *pval = (
void *) &
no2;
265 else if (strcmp(pname,
"h2o") == 0)
266 *pval = (
void *) &
h2o;
267 else if (strcmp(pname,
"co2") == 0)
268 *pval = (
void *) &
co2;
269 else if (strcmp(pname,
"vrto3") == 0)
270 *pval = (
void *) &
vrto3;
271 else if (strcmp(pname,
"sno2") == 0)
272 *pval = (
void *) &
sno2;
273 else if (strcmp(pname,
"window1") == 0)
274 *pval = (
void *) &window1;
275 else if (strcmp(pname,
"window2") == 0)
276 *pval = (
void *) &window2;
277 else if (strcmp(pname,
"window3") == 0)
278 *pval = (
void *) &window3;
279 else if (strcmp(pname,
"window4") == 0)
280 *pval = (
void *) &window4;
281 else if (strcmp(pname,
"wp94c") == 0)
282 *pval = (
void *) &
wp94c;
283 else if (strcmp(pname,
"w1p14c") == 0)
285 else if (strcmp(pname,
"nb1") == 0)
286 *pval = (
void *) &
nb1;
287 else if (strcmp(pname,
"nb2") == 0)
288 *pval = (
void *) &
nb2;
289 else if (strcmp(pname,
"nb3") == 0)
290 *pval = (
void *) &
nb3;
291 else if (strcmp(pname,
"nb4") == 0)
292 *pval = (
void *) &
nb4;
293 else if (strcmp(pname,
"nbp94") == 0)
294 *pval = (
void *) &
nbp94;
295 else if (strcmp(pname,
"nb1p14") == 0)
297 else if (strcmp(pname,
"full_calc") == 0)
299 else if (strcmp(pname,
"dogeom") == 0)
300 *pval = (
void *) &dogeom;
const char * sensorId2SensorDir(int sensorId)
int32_t rdatreminfo(int32_t sensorID, int32_t evalmask, const char *pname, void **pval)
void parseline(char *line, char *name, char *value)
char filename[FILENAME_MAX]
const char * sensorId2SensorName(int sensorId)
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
int32_t sensorID[MAXNFILES]