OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
jplaeriallib.c
Go to the documentation of this file.
1 /*
2  * jplaeriallib.c
3  *
4  * Created on: Jun 12, 2015
5  * Author: r. healy
6  * Various functions for BIP and BIL header files (AVIRIS and PRISM presently)
7  */
8 
9 #include "jplaeriallib.h"
10 
11 #include <stdlib.h>
12 #include <stdio.h>
13 #include <math.h>
14 #include <string.h>
15 #include <genutils.h>
16 
17 char* getinbasename_av(char *file) {
18 
19  int pos, k;
20  char *inbasename;
21 
22  pos = 0;
23  k = strlen(file);
24  while (k > 0 && file[k] != '/') {
25  if (file[k] == '_') pos = k;
26  k--;
27  }
28 
29  if (pos > 0) {
30  pos += 2; //file should have an _x
31  inbasename = (char *) malloc((pos + 1) * sizeof (char));
32  strncpy(inbasename, file, pos);
33  inbasename[pos] = '\0';
34  } else
35  inbasename = NULL;
36 
37  return (inbasename);
38 
39 }
40 
41 char* getinbasename(char *file) {
42 
43  int pos, k;
44  char *inbasename;
45 
46  pos = 0;
47  k = strlen(file);
48  while (k > 0 && file[k] != '/') {
49  if (file[k] == '_') pos = k;
50  k--;
51  }
52 
53  if (pos > 0) {
54  inbasename = (char *) malloc((pos + 1) * sizeof (char));
55  strncpy(inbasename, file, pos);
56  inbasename[pos] = '\0';
57  } else
58  inbasename = NULL;
59 
60  printf("2)getinbasename=%s\n", inbasename);
61  return (inbasename);
62 
63 }
64 
65 void readWavInfo_jpl(FILE* fp, char* tag, char* val) {
66  char* result;
67  char line[itemSize];
68  int count;
69 
70  result = fgets(line, itemSize, fp);
71  if (result == NULL) {
72  fprintf(stderr, "-E- %s line %d: unable to read all of the required metadata from aviris/prism file\n",
73  __FILE__, __LINE__);
74  exit(1);
75  }
77 
78  count = sscanf(line, "%s %s", val, tag);
79  if (count != 2) {
80  // not found so return blank line
81  tag[0] = 0;
82  val[0] = 0;
83  return;
84  }
85 
86  trimBlanks(val);
87 
88 }
89 
90 void readNextLine_jpl(FILE* fp, char* tag, char* val) {
91  char* result;
92  char line[itemSize];
93  int count;
94 
95  result = fgets(line, itemSize, fp);
96  if (result == NULL) {
97  fprintf(stderr, "-E- %s line %d: unable to read all of the required metadata from aviris/prism file\n",
98  __FILE__, __LINE__);
99  exit(1);
100  }
101  trimBlanks(line);
102 
103  count = sscanf(line, "%s = %s", tag, val);
104  if (count != 2) {
105  // not found so return blank line
106  tag[0] = 0;
107  val[0] = 0;
108  return;
109  }
110 
111  trimBlanks(val);
112 }
113 
114 /*
115  * A generic reader for 2 byte integer binary BIL/BIP files
116  * @param out Lt array
117  * @param in recnum - scan line number
118  * @param in npix - number of pixels in scan line
119  * @param in gain array - factor to divide Lt by band number
120  * @param in nbands - number of bands in L2 sensor
121  * @param in numBands - number of bands in input file (numBands >= nbands)
122  * @param in interleave - binary interleave (either BIP or BIL)
123  * @param in ptr - input file pointer
124  */
125 int readBinScanLine4ocia_int2(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr) {
126 
127  int ib, ibp, ipb_av, ip, status;
128  int16_t *ibuf;
129  long fpos;
130 
131  ibuf = (int16_t *) malloc(npix * numBands * sizeof (int16_t));
132 
133  if (!ibuf) {
134  fprintf(stderr, "-E- %s line %d: Out of Memory allocating buffer array.\n",
135  __FILE__, __LINE__);
136  exit(1);
137 
138  }
139 
140  fpos = (long) sizeof (int16_t)*(long) numBands * (long) npix * (long) (recnum - 1);
141  fseek(ptr, fpos, 0);
142  status = fread(ibuf, sizeof (int16_t), numBands*npix, ptr);
143  if (status != numBands * npix) {
144  fprintf(stderr, "-E- %s line %d: Wrong Lt data read size: want %d got %d\n",
145  __FILE__, __LINE__, npix*numBands, status);
146  exit(1);
147  }
148  if (swap == 1)
149  swapc_bytes((char *) ibuf, sizeof (int16_t), npix * numBands);
150 
151  for (ip = 0; ip < npix; ip++) {
152  for (ib = 0; ib < nbands; ib++) {
153  //ipb = ip*nbands+ib;
154  switch (interleave) {
155  case BIP:
156  ipb_av = ip * numBands + ib;
157  break;
158  case BIL:
159  ipb_av = ib * npix + ip;
160  break;
161  }
162 
163  ibp = ib * npix + ip;
164 
165  if (ibuf[ipb_av] <= 0) {
166  Lt[ibp] = BAD_FLT; // I assume this is outside the projected tile
167  // l1rec->navfail[ip] = 1; // so set navigation failure - Commented out for hyperspectal - RJH
168  } else {
169  Lt[ibp] = ibuf[ipb_av] / gain[ib]; //uWatts/cm^2/sr
170  }
171  }
172  }
173 
174  free(ibuf);
175  return (status);
176 }
177 
178 /*
179  * A generic reader for 4 byte float binary BIL/BIP files
180  * @param out Lt array
181  * @param in recnum - scan line number
182  * @param in npix - number of pixels in scan line
183  * @param in gain array - factor to divide Lt by band number
184  * @param in nbands - number of bands in L2 sensor
185  * @param in numBands - number of bands in input file (numBands >= nbands)
186  * @param in interleave - binary interleave (either BIP or BIL)
187  * @param in ptr - input file pointer
188  */
189 int readBinScanLine4Ocip_float(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr) {
190 
191  int ib, ibp, ipb_av, ip, status;
192  float *ibuf;
193  long lpos;
194 
195  ibuf = (float *) malloc(npix * numBands * sizeof (float));
196 
197  if (!ibuf) {
198  fprintf(stderr, "-E- %s line %d: Out of Memory allocating buffer array.\n",
199  __FILE__, __LINE__);
200  exit(1);
201 
202  }
203 
204  lpos = (long) 4 * (long) numBands * (long) npix * (long) (recnum - 1);
205  fseek(ptr, lpos, SEEK_SET);
206  status = fread(ibuf, 4, numBands*npix, ptr);
207 
208  if (status != numBands * npix) {
209  fprintf(stderr, "-E- %s line %d: Wrong Lt data read size: want %d got %d\n",
210  __FILE__, __LINE__, npix*numBands, status);
211  exit(1);
212  }
213 
214  if (swap)
215  swapc_bytes((char *) ibuf, 4, npix * numBands);
216 
217  for (ip = 0; ip < npix; ip++) {
218  for (ib = 0; ib < nbands; ib++) {
219  // ipb = ip*nbands+ib;
220  switch (interleave) {
221  case BIP:
222  ipb_av = ip * numBands + ib;
223  break;
224  case BIL:
225  ipb_av = ib * npix + ip;
226  break;
227  }
228 
229  ibp = ib * npix + ip;
230  if (ibuf[ipb_av] <= 0) {
231  Lt[ibp] = BAD_FLT; // I assume this is outside the projected tile
232  // l1rec->navfail[ip] = 1; // so set navigation failure - Commented out for hyperspectal - RJH
233  } else {
234  Lt[ibp] = ibuf[ipb_av] / gain[ib]; //uWatts/cm^2/sr
235  }
236  }
237  }
238 
239  free(ibuf);
240  return (status);
241 }
242 
243 /*
244  * A generic reader for 2 byte integer binary BIL/BIP files
245  * @param out Lt array
246  * @param in recnum - scan line number
247  * @param in npix - number of pixels in scan line
248  * @param in gain array - factor to divide Lt by band number
249  * @param in nbands - number of bands in L2 sensor
250  * @param in numBands - number of bands in input file (numBands >= nbands)
251  * @param in interleave - binary interleave (either BIP or BIL)
252  * @param in ptr - input file pointer
253  */
254 int readBinScanLine_sub_int2(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr) {
255 
256  int ib, ipb_av, ip, ipb, status;
257  int16_t *ibuf;
258  long fpos;
259 
260  ibuf = (int16_t *) malloc(npix * numBands * sizeof (int16_t));
261 
262  if (!ibuf) {
263  fprintf(stderr, "-E- %s line %d: Out of Memory allocating buffer array.\n",
264  __FILE__, __LINE__);
265  exit(1);
266 
267  }
268 
269  fpos = (long) sizeof (int16_t)*(long) numBands * (long) npix * (long) (recnum - 1);
270  fseek(ptr, fpos, 0);
271  status = fread(ibuf, sizeof (int16_t), numBands*npix, ptr);
272  if (status != numBands * npix) {
273  fprintf(stderr, "-E- %s line %d: Wrong Lt data read size: want %d got %d\n",
274  __FILE__, __LINE__, npix*numBands, status);
275  exit(1);
276  }
277  if (swap == 1)
278  swapc_bytes((char *) ibuf, sizeof (int16_t), npix * numBands);
279 
280  for (ip = 0; ip < npix; ip++) {
281  for (ib = 0; ib < nbands; ib++) {
282  ipb = ip * nbands + ib;
283  switch (interleave) {
284  case BIP:
285  ipb_av = ip * numBands + ib;
286  break;
287  case BIL:
288  ipb_av = ib * npix + ip;
289  break;
290  }
291 
292  //ibp = ib*npix+ip;
293 
294  if (ibuf[ipb_av] <= 0) {
295  Lt[ipb] = BAD_FLT; // I assume this is outside the projected tile
296  // l1rec->navfail[ip] = 1; // so set navigation failure - Commented out for hyperspectal - RJH
297  } else {
298  Lt[ipb] = ibuf[ipb_av] / gain[ib]; //uWatts/cm^2/sr
299  }
300  }
301  }
302 
303  free(ibuf);
304  return (status);
305 }
306 
307 int readBinScanLine_int2(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int interleave, int swap, FILE *ptr) {
308 
309  int ib, ipb_av, ip, ipb, status;
310  int16_t *ibuf;
311  long fpos;
312 
313  ibuf = (int16_t *) malloc(npix * nbands * sizeof (int16_t));
314 
315  if (!ibuf) {
316  fprintf(stderr, "-E- %s line %d: Out of Memory allocating buffer array.\n",
317  __FILE__, __LINE__);
318  exit(1);
319 
320  }
321 
322  fpos = (long) sizeof (int16_t)*(long) nbands * (long) npix * (long) (recnum - 1);
323  fseek(ptr, fpos, 0);
324  status = fread(ibuf, sizeof (int16_t), nbands*npix, ptr);
325  if (status != nbands * npix) {
326  fprintf(stderr, "-E- %s line %d: Wrong Lt data read size: want %d got %d\n",
327  __FILE__, __LINE__, npix*nbands, status);
328  exit(1);
329  }
330  if (swap == 1)
331  swapc_bytes((char *) ibuf, sizeof (int16_t), npix * nbands);
332 
333  for (ip = 0; ip < npix; ip++) {
334  for (ib = 0; ib < nbands; ib++) {
335  ipb = ip * nbands + ib;
336  switch (interleave) {
337  case BIP:
338  ipb_av = ip * nbands + ib;
339  break;
340  case BIL:
341  ipb_av = ib * npix + ip;
342  break;
343  }
344 
345  //ibp = ib*npix+ip;
346 
347  if (ibuf[ipb_av] <= 0) {
348  Lt[ipb] = BAD_FLT; // I assume this is outside the projected tile
349  // l1rec->navfail[ip] = 1; // so set navigation failure - Commented out for hyperspectal - RJH
350  } else {
351  Lt[ipb] = ibuf[ipb_av] / gain[ib]; //uWatts/cm^2/sr
352  }
353  }
354  }
355 
356  free(ibuf);
357  return (status);
358 }
359 
360 /*
361  * A generic reader for 4 byte float binary BIL/BIP files
362  * @param out Lt array
363  * @param in recnum - scan line number
364  * @param in npix - number of pixels in scan line
365  * @param in gain array - factor to divide Lt by band number
366  * @param in nbands - number of bands in L2 sensor
367  * @param in numBands - number of bands in input file (numBands >= nbands)
368  * @param in interleave - binary interleave (either BIP or BIL)
369  * @param in ptr - input file pointer
370  */
371 int readBinScanLine_float(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr) {
372 
373  int ib, ipb_av, ip, ipb, status;
374  float *ibuf;
375  long lpos;
376 
377  ibuf = (float *) malloc(npix * numBands * sizeof (float));
378 
379  if (!ibuf) {
380  fprintf(stderr, "-E- %s line %d: Out of Memory allocating buffer array.\n",
381  __FILE__, __LINE__);
382  exit(1);
383 
384  }
385 
386  lpos = (long) 4 * (long) numBands * (long) npix * (long) (recnum - 1);
387  fseek(ptr, lpos, SEEK_SET);
388  status = fread(ibuf, 4, numBands*npix, ptr);
389  if (status != numBands * npix) {
390  fprintf(stderr, "-E- %s line %d: Wrong Lt data read size: want %d got %d\n",
391  __FILE__, __LINE__, npix*numBands, status);
392  exit(1);
393  }
394 
395  if (swap)
396  swapc_bytes((char *) ibuf, 4, npix * numBands);
397 
398  for (ip = 0; ip < npix; ip++) {
399  for (ib = 0; ib < nbands; ib++) {
400  ipb = ip * nbands + ib;
401  switch (interleave) {
402  case BIP:
403  ipb_av = ip * numBands + ib;
404  break;
405  case BIL:
406  ipb_av = ib * npix + ip;
407  break;
408  }
409 
410  if (ibuf[ipb_av] <= 0) {
411  Lt[ipb] = BAD_FLT; // I assume this is outside the projected tile
412  // l1rec->navfail[ip] = 1; // so set navigation failure - Commented out for hyperspectal - RJH
413  } else {
414  Lt[ipb] = ibuf[ipb_av] / gain[ib]; //uWatts/cm^2/sr
415  }
416  }
417  }
418 
419  free(ibuf);
420  return (status);
421 }
422 
423 double getValidAngle(double *ang, int32_t npix, int32_t skip) {
424  int32_t i, k = 0;
425 
426  for (i = 0; i < npix && ang[i] <= skip; i++)
427  k = i;
428 
429  return (ang[k]);
430 
431 }
432 
433 char* checkTagLine(char *linein, char* tag) {
434  static char* result;
435  int count;
436  char line[1024];
437 
438  strncpy(line, linein, 1023);
439  line[1023] = '\0';
440  count = 0;
441  if (strstr(line, tag)) {
442  result = strtok(line, "=");
443  if (result) {
444  result = strtok(NULL, "=");
445  count = 1;
446  }
447  }
448  if (count < 1) {
449  return (NULL);
450  }
451 
453 
454  return (result);
455 }
456 
457 float checkTagLine_f(char *linein, char* tag) {
458  char* result;
459  int count;
460  char line[1024];
461  float tmp;
462 
463  strncpy(line, linein, 1024);
464  line[1023] = '\0';
465  count = 0;
466  if (strstr(line, tag)) {
467  result = strtok(line, "=");
468  if (result) {
469  result = strtok(NULL, "=");
470  count = 1;
471  }
472  }
473  if (count < 1) {
474  return (-999);
475  }
476 
478  tmp = atof(result);
479  return (tmp);
480 }
481 
482 int checkTagLine_i(char *linein, char* tag) {
483  char* result;
484  int count;
485  char line[1024];
486  int tmp;
487 
488  strncpy(line, linein, 1024);
489  line[1023] = '\0';
490  count = 0;
491  if (strstr(line, tag)) {
492  result = strtok(line, "=");
493  if (result) {
494  result = strtok(NULL, "=");
495  count = 1;
496  }
497  }
498  if (count < 1) {
499  return (-999);
500  }
501 
503  tmp = atoi(result);
504  return (tmp);
505 }
506 
507 char* checkTagLine_m(char *linein, char *line, char* tag) {
508  char* result;
509  int count;
510  // char line[1024];
511 
512  strncpy(line, linein, 1024);
513  line[1023] = '\0';
514  count = 0;
515  if (strstr(line, tag)) {
516  result = strtok(line, "=");
517  if (result) {
518  line = strtok(NULL, "=");
519  count = 1;
520  }
521  }
522  if (count < 1) {
523  return (NULL);
524  }
525 
526  trimBlanks(line);
527 
528  return (line);
529 }
530 
531 /* Find the tag within a line that has multiple tokens
532  * Return the value to the right of the token
533  */
534 char* checknspTagLine(char *linein, char* tag) {
535 
536  char* result;
537  int count;
538  char line[1024];
539 
540  strncpy(line, linein, 1024);
541  line[1023] = '\0';
542 
543  count = 0;
544  if (strstr(line, tag)) {
545  result = strtok(line, "=");
546  while (!strstr(result, tag)) {
547  result = strtok(NULL, "=");
548  }
549  if (result) {
550  result = strtok(NULL, "=");
551  count = 1;
552  }
553  }
554  if (count < 1) {
555  return (NULL);
556  }
557 
558  return (result);
559 }
560 
561 void getPosVec(float lat, float lon, float alt, double *pos) {
562 
563  int i;
564  double gv[3];
565  double hv[3];
566  double re = 6378.137;
567  double f = 1 / 298.257;
568  double omf2 = (1.0 - f) * (1.0 - f);
569  double slat = lat * DEG_TO_RAD;
570  double slon = lon * DEG_TO_RAD;
571 
572  // Compute geocentric radius
573  double slatg = atan(tan(slat) * omf2);
574  double r = re * (1.0 - f) / sqrt(1.0 - (2.0 - f) * f * pow(cos(slatg), 2));
575 
576  // Compute geocentric subsensor vector
577  gv[0] = cos(slatg) * cos(slon);
578  gv[1] = cos(slatg) * sin(slon);
579  gv[2] = sin(slatg);
580 
581  // Compute geodetic height vector
582  hv[0] = cos(slat) * cos(slon);
583  hv[1] = cos(slat) * sin(slon);
584  hv[2] = sin(slat);
585 
586  // Compute sensor position vector
587  for (i = 0; i < 3; i++) {
588  pos[i] = gv[i] * r + hv[i] * alt;
589  }
590 
591 }
592 
593 void getPosVecR(float lat, float lon, float alt, double *pos) {
594 
595  double re = 6378.137;
596  double f = 1 / 298.257;
597  double omf2 = (1.0 - f) * (1.0 - f);
598  double slat = lat * DEG_TO_RAD;
599  double slon = lon * DEG_TO_RAD;
600 
601  // Compute geocentric radius
602  double slatg = atan(tan(slat) * omf2);
603  double clatg = cos(slatg);
604  double r = re * (1.0 - f) / sqrt(1.0 - (2.0 - f) * f * pow(cos(slatg), 2));
605  /*
606  p(0) = cos(olon/!radeg)*(rl*cltg + alt(i)*cos(olat/!radeg))
607  p(1) = sin(olon/!radeg)*(rl*cltg + alt(i)*cos(olat/!radeg))
608  p(2) = rl*sin(glat) + alt(i)*sin(olat/!radeg)
609  */
610  pos[0] = cos(slon)*(r * clatg + alt * cos(slat));
611  pos[1] = sin(slon)*(r * clatg + alt * cos(slat));
612  pos[2] = r * sin(slatg) + alt * sin(slat);
613 
614  // // Compute geocentric subsensor vector
615  // gv[0] = cos(slatg) * cos(slon);
616  // gv[1] = cos(slatg) * sin(slon);
617  // gv[2] = sin(slatg);
618  //
619  // // Compute geodetic height vector
620  // hv[0] = cos(slat) * cos(slon);
621  // hv[1] = cos(slat) * sin(slon);
622  // hv[2] = sin(slat);
623 
624  // Compute sensor position vector
625  // for (i = 0; i < 3; i++) {
626  // pos[i] = gv[i] * r + hv[i] * alt;
627  // }
628 
629 }
int r
Definition: decode_rs.h:73
void getPosVecR(float lat, float lon, float alt, double *pos)
Definition: jplaeriallib.c:593
int status
Definition: l1_czcs_hdf.c:32
int16 * gain
Definition: l1_czcs_hdf.c:33
char * getinbasename_av(char *file)
Definition: jplaeriallib.c:17
void getPosVec(float lat, float lon, float alt, double *pos)
Definition: jplaeriallib.c:561
char * checknspTagLine(char *linein, char *tag)
Definition: jplaeriallib.c:534
#define NULL
Definition: decode_rs.h:63
void trimBlanks(char *str)
Definition: trimBlanks.c:10
double getValidAngle(double *ang, int32_t npix, int32_t skip)
Definition: jplaeriallib.c:423
int readBinScanLine_int2(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int interleave, int swap, FILE *ptr)
Definition: jplaeriallib.c:307
float32 * pos
Definition: l1_czcs_hdf.c:35
float * lat
#define DEG_TO_RAD
Definition: jplaeriallib.h:17
char * checkTagLine_m(char *linein, char *line, char *tag)
Definition: jplaeriallib.c:507
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed file
Definition: HISTORY.txt:413
int swapc_bytes(char *in, int nbyte, int ntime)
Definition: swapc_bytes.c:4
int readBinScanLine_float(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr)
Definition: jplaeriallib.c:371
int readBinScanLine4ocia_int2(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr)
Definition: jplaeriallib.c:125
#define BIL
double precision function f(R1)
Definition: tmd.lp.f:1454
data_t tmp
Definition: decode_rs.h:74
read recnum
float checkTagLine_f(char *linein, char *tag)
Definition: jplaeriallib.c:457
#define re
Definition: l1_czcs_hdf.c:701
#define BIP
int readBinScanLine4Ocip_float(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr)
Definition: jplaeriallib.c:189
void readWavInfo_jpl(FILE *fp, char *tag, char *val)
Definition: jplaeriallib.c:65
int readBinScanLine_sub_int2(float *Lt, int32_t recnum, int32_t npix, double *gain, int nbands, int numBands, int interleave, int swap, FILE *ptr)
Definition: jplaeriallib.c:254
#define omf2
Definition: l1_czcs_hdf.c:703
#define BAD_FLT
Definition: jplaeriallib.h:19
int32_t nbands
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)
float * lon
char * getinbasename(char *file)
Definition: jplaeriallib.c:41
int checkTagLine_i(char *linein, char *tag)
Definition: jplaeriallib.c:482
int i
Definition: decode_rs.h:71
msiBandIdx val
Definition: l1c_msi.cpp:34
char * checkTagLine(char *linein, char *tag)
Definition: jplaeriallib.c:433
int k
Definition: decode_rs.h:73
int npix
Definition: get_cmp.c:27
void readNextLine_jpl(FILE *fp, char *tag, char *val)
Definition: jplaeriallib.c:90
int count
Definition: decode_rs.h:79