NASA Logo
Ocean Color Science Software

ocssw V2022
l1_l5tm.c
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <stdio.h>
3 
4 #include <netcdf.h>
5 #include "l1.h"
6 #include "l1_l5tm.h"
7 
8 #include <tiffio.h>
9 #include <geotiff.h>
10 #include <xtiffio.h>
11 #include <geo_normalize.h>
12 #include <libgen.h>
13 
14 /* For Landsat 5 TM */
15 
16 int get_l57tm_nom_angles( char *meta_filename, int32_t npix, int32_t nscan, int32_t iscan,
17  float *solz, float *sola, float *senz, float *sena);
18 int get_l5tm_angles( char *emeta_filename, int32_t npix, int32_t nscan, int32_t iscan,
19  float *solz, float *sola, float *senz, float *sena);
20 int32_t chk_l5tm_geo(char *fname);
21 
22 static const int itemSize = 500;
23 static const int maxBands = 7;
24 
25 typedef struct L5TM_struct {
26  int32_t year, doy, msec;
28  double *lat, *lon;
29  double *scale, *offset;
30  /* double *refl_scale, *refl_offset; */ // not available for Landsat 5 TM
31  TIFF** tif; // file handle for each band
32  GTIF* gtif; // geotiff handle for the first file
33  GTIFDefn* defn; // geotiff definition structure for first file
34  uint8_t* buf; // buffer used to read one scan line from TIFF file
35 } l5tm_t;
36 
37 
38 l5tm_t* createPrivateData_l5tm(int numBands) {
39  l5tm_t* data = (l5tm_t*)calloc(1, sizeof(l5tm_t));
40  if(data == NULL) {
41  fprintf(stderr,"-E- %s line %d: unable to allocate private data for L5TM\n",
42  __FILE__,__LINE__);
43  exit(1);
44  }
45 
46  data->scale = (double *) malloc(numBands*sizeof(double) );
47  data->offset = (double *) malloc(numBands*sizeof(double) );
48  if(data->scale==NULL || data->offset==NULL) {
49  fprintf(stderr,"-E- %s line %d: unable to allocate scale/offset data for L5TM\n",
50  __FILE__,__LINE__);
51  exit(1);
52  }
53 
54  /* data->refl_scale = (double *) malloc(numBands*sizeof(double) );
55  data->refl_offset = (double *) malloc(numBands*sizeof(double) );
56  if(data->refl_scale==NULL || data->refl_offset==NULL) {
57  fprintf(stderr,"-E- %s line %d: unable to allocate reflectance scale/offset data for L5TM\n",
58  __FILE__,__LINE__);
59  exit(1);
60  } */
61 
62  data->tif = (TIFF**) calloc(numBands, sizeof(TIFF*) );
63  if(data->tif==NULL) {
64  fprintf(stderr,"-E- %s line %d: unable to allocate TIFF pointers for L5TM\n",
65  __FILE__,__LINE__);
66  exit(1);
67  }
68 
69  data->defn = (GTIFDefn*) malloc(sizeof(GTIFDefn) );
70  if(data->defn==NULL) {
71  fprintf(stderr,"-E- %s line %d: unable to allocate GEOTIFF definition structure for L5TM\n",
72  __FILE__,__LINE__);
73  exit(1);
74  }
75 
76  return data;
77 }
78 
79 void freePrivateData_l5tm(l5tm_t* data) {
80  free(data->scale);
81  free(data->offset);
82  /* free(data->refl_scale);
83  free(data->refl_offset); */
84  free(data->tif);
85  free(data->defn);
86  free(data);
87 }
88 
89 void readNextLine_l5tm(FILE* fp, char* tag, int* i, char* val) {
90  char* result;
91  char line[itemSize];
92  int count;
93 
94  result = fgets(line, itemSize, fp);
95  if(result == NULL) {
96  fprintf(stderr,"-E- %s line %d: unable to read all of the required metadata from L5TM file\n",
97  __FILE__,__LINE__);
98  exit(1);
99  }
100  trimBlanks(line);
101 
102  count = sscanf(line, "%s = %s", tag, val);
103  if(count != 2) {
104  // not found so return blank line
105  tag[0] = 0;
106  *i = 0;
107  val[0] = 0;
108  return;
109  }
110 
111  // grab index if it exists
112  result = strrchr(tag, '_');
113  if(result) {
114  result++;
115  *i = atoi(result);
116  } else {
117  *i = 0;
118  }
119 
120  // get rid of the quotes from val
121  if(val[0] == '"')
122  val[0] = ' ';
123  count = strlen(val) - 1;
124  if(val[count] == '"')
125  val[count] = 0;
126  trimBlanks(val);
127 }
128 
129 
130 int read_l5tm_angles(char *file, int32_t npix, int32_t nscan, int32_t iscan,
131  float *solz, float *sola, float *senz, float *sena) {
132 
133  static int firstCall = 1;
134  static int fileID;
135 
136  int retval;
137  int xid, yid, varID=-1;
138  size_t geo_npix, geo_nscan;
139  size_t start[3], count[3];
140 
141  if (firstCall) {
142 
143  firstCall = 0;
144 
145  printf("Reading path angles from %s.\n",file);
146 
147  // Open the netcdf file
148  retval = nc_open(file, NC_NOWRITE, &fileID);
149  if (retval != NC_NOERR) {
150  fprintf(stderr, "-E- %s line %d: nc_open(%s) failed.\n",
151  __FILE__, __LINE__, file);
152  return (-1);
153  }
154 
155  // Get pixel and scan dimensions
156  retval = nc_inq_dimid(fileID, "Pixels", &xid);
157  retval = nc_inq_dimid(fileID, "Lines" , &yid);
158  retval = nc_inq_dimlen(fileID, xid, &geo_npix);
159  retval = nc_inq_dimlen(fileID, yid, &geo_nscan);
160 
161  if (retval != NC_NOERR) {
162  fprintf(stderr, "-E- %s line %d: Error reading dimensions from %s.\n",
163  __FILE__, __LINE__, file);
164  return (-1);
165  }
166  if (geo_npix != npix || geo_nscan != nscan) {
167  fprintf(stderr, "-E- %s line %d: geofile dimensions (%zu,%zu) do not match image dimensions (%d,%d).\n",
168  __FILE__, __LINE__, geo_npix,geo_nscan,npix,nscan);
169  return (-1);
170  }
171 
172  }
173 
174  start[0] = iscan;
175  start[1] = 0;
176  count[0] = 1;
177  count[1] = npix;
178 
179  retval = nc_inq_varid(fileID, "solz", &varID);
180  if (retval == NC_NOERR)
181  retval = nc_get_vara_float(fileID, varID, start, count, solz);
182  if (retval != NC_NOERR) {
183  fprintf(stderr,
184  "-E- %s line %d: Unable to read solz from %s.\n",
185  __FILE__, __LINE__, file);
186  return (-1);
187  }
188 
189  retval = nc_inq_varid(fileID, "sola", &varID);
190  if (retval == NC_NOERR)
191  retval = nc_get_vara_float(fileID, varID, start, count, sola);
192  if (retval != NC_NOERR) {
193  fprintf(stderr,
194  "-E- %s line %d: Unable to read sola from %s.\n",
195  __FILE__, __LINE__, file);
196  return (-1);
197  }
198 
199  retval = nc_inq_varid(fileID, "senz", &varID);
200  if (retval == NC_NOERR)
201  retval = nc_get_vara_float(fileID, varID, start, count, senz);
202  if (retval != NC_NOERR) {
203  fprintf(stderr,
204  "-E- %s line %d: Unable to read senz from %s.\n",
205  __FILE__, __LINE__, file);
206  return (-1);
207  }
208 
209  retval = nc_inq_varid(fileID, "sena", &varID);
210  if (retval == NC_NOERR)
211  retval = nc_get_vara_float(fileID, varID, start, count, sena);
212  if (retval != NC_NOERR) {
213  fprintf(stderr,
214  "-E- %s line %d: Unable to read sena from %s.\n",
215  __FILE__, __LINE__, file);
216  return (-1);
217  }
218 
219  return(0);
220 }
221 
222 
223 int openl1_l5tm(filehandle *file) {
224  int i;
225  FILE *fp;
226  char tag[itemSize];
227  char val[itemSize];
228  char dateStr[32];
229  char timeStr[32];
230  char fileName[itemSize];
231 
232  l5tm_t* data = file->private_data = createPrivateData_l5tm(maxBands);
233 
234  if(want_verbose)
235  printf("L5TM Level-1B %s\n", file->name );
236 
237  /* Open file */
238  if ((fp = fopen(file->name, "r")) == NULL) {
239  fprintf(stderr,"-E- %s line %d: unable open %s\n",
240  __FILE__,__LINE__,file->name);
241  exit(1);
242  }
243 
244  int dateNeeded = 1;
245  int timeNeeded = 1;
246  int filesNeeded = 1;
247  int numLinesNeeded = 1;
248  int numSamplesNeeded = 1;
249  int sunAzimuthNeeded = 1;
250  int sunElevationNeeded = 1;
251  int scaleNeeded = 1;
252  int offsetNeeded = 1;
253  /* int reflScaleNeeded = 1;
254  int reflOffsetNeeded = 1; */
255 
256  // loop metadata
257  while(dateNeeded ||
258  timeNeeded ||
259  numLinesNeeded ||
260  numSamplesNeeded ||
261  filesNeeded ||
262  sunAzimuthNeeded ||
263  sunElevationNeeded ||
264  /* reflScaleNeeded ||
265  reflOffsetNeeded || */
266  scaleNeeded ||
267  offsetNeeded) {
268 
269  readNextLine_l5tm(fp, tag, &i, val);
270 
271  // skip blank lines
272  if(tag[0] == 0)
273  continue;
274 
275  // get date
276  if(!strcmp(tag, "DATE_ACQUIRED")) {
277  dateNeeded = 0;
278  strcpy(dateStr, val);
279 
280  // get time
281  } else if(!strcmp(tag, "SCENE_CENTER_TIME")) {
282  timeNeeded = 0;
283  strcpy(timeStr, val);
284 
285  // get num lines
286  } else if(!strcmp(tag, "REFLECTIVE_LINES")) {
287  numLinesNeeded = 0;
288  file->nscan = atoi(val);
289 
290  // get num samples
291  } else if(!strcmp(tag, "REFLECTIVE_SAMPLES")) {
292  numSamplesNeeded = 0;
293  file->npix = atoi(val);
294 
295 
296  // get band file names
297  } else if(!strncmp(tag, "FILE_NAME_BAND_", 15)) {
298  if(i == maxBands)
299  filesNeeded = 0;
300  i--;
301  if(i>=0 && i<maxBands) {
302  // dirname might destroy input, so we pass it a copy
303  char dir[FILENAME_MAX];
304  strcpy(dir,file->name);
305  strcpy(fileName, dirname(dir));
306  strcat(fileName, "/");
307  strcat(fileName, val);
308  if(want_verbose)
309  printf("L5TM Level-1B Band[%d]:%s\n", i, fileName );
310  data->tif[i] = XTIFFOpen(fileName, "r");
311  if (!data->tif[i]) {
312  fprintf(stderr,"-E- %s line %d: unable open TIFF file %s\n",
313  __FILE__,__LINE__,fileName);
314  exit(1);
315  }
316  }
317 
318  // get sun azimuth
319  } else if(!strcmp(tag, "SUN_AZIMUTH")) {
320  sunAzimuthNeeded = 0;
321  data->sunAzimuth = atof(val);
322 
323  // get sun elevation
324  } else if(!strcmp(tag, "SUN_ELEVATION")) {
325  sunElevationNeeded = 0;
326  data->sunElevation = atof(val);
327 
328  // get refl_scale
329  } /* else if(!strncmp(tag, "REFLECTANCE_MULT_BAND_", 22)) {
330  if(i == maxReflBands)
331  reflScaleNeeded = 0;
332  i--;
333  if(i>=0 && i<maxReflBands) {
334  data->refl_scale[i] = atof(val);
335  }
336 
337  // get refl_offset
338  } else if(!strncmp(tag, "REFLECTANCE_ADD_BAND_", 21)) {
339  if(i == maxReflBands)
340  reflOffsetNeeded = 0;
341  i--;
342  if(i>=0 && i<maxReflBands) {
343  data->refl_offset[i] = atof(val);
344  }
345 
346  } */
347  // radiance scale
348  else if(!strncmp(tag, "RADIANCE_MULT_BAND_", 19)) {
349  if(i == maxBands)
350  scaleNeeded = 0;
351  i--;
352  if(i>=0 && i<maxBands) {
353  data->scale[i] = atof(val);
354  }
355 
356  // get offset
357  } else if(!strncmp(tag, "RADIANCE_ADD_BAND_", 18)) {
358  if(i == maxBands)
359  offsetNeeded = 0;
360  i--;
361  if(i>=0 && i<maxBands) {
362  data->offset[i] = atof(val);
363  }
364  }
365 
366  } // while
367 
368  fclose(fp);
369 
370  // allocate lat and lon storage
371  data->lat = (double *) malloc(file->npix*sizeof(double) );
372  data->lon = (double *) malloc(file->npix*sizeof(double) );
373  if(data->lat==NULL || data->lon==NULL) {
374  fprintf(stderr,"-E- %s line %d: unable to allocate lat/lon data for L5TM\n",
375  __FILE__,__LINE__);
376  exit(1);
377  }
378 
379  // only need the GEO TIFF info from one file
380  data->gtif = GTIFNew(data->tif[0]);
381  if (!data->gtif) {
382  fprintf(stderr,"-E- %s line %d: unable open GEOTIFF file %s\n",
383  __FILE__,__LINE__,fileName);
384  exit(1);
385  }
386 
387  if(!GTIFGetDefn(data->gtif, data->defn)) {
388  fprintf(stderr,"-E- %s line %d: unable populate GEOTIFF defn structure for %s\n",
389  __FILE__,__LINE__,fileName);
390  exit(1);
391  }
392 
393  // allocate buffer to hold one scan line
394  int size = TIFFScanlineSize(data->tif[0]);
395  if(size != file->npix) /* For Landsat 5 TM the data type is Byte */
396  {
397  fprintf(stderr,"-E- %s line %d: unexpected pixel data size in %s\n",
398  __FILE__,__LINE__,fileName);
399  exit(1);
400  }
401  data->buf = (uint8_t*) malloc(size);
402 
403  // get date "2013-07-19"
404  int year, month, day;
405  sscanf(dateStr, "%d-%d-%d", &year, &month, &day);
406 
407  // get time "10:41:59.9930740Z"
408  int hour, minute;
409  double sec;
410  sscanf(timeStr, "%d:%d:%lf", &hour, &minute, &sec);
411 
412  int isec = (int)sec;
413  ymdhms2ydmsec(year, month, day, hour, minute, isec,
414  &data->year, &data->doy, &data->msec);
415  sec -= isec;
416  data->msec += sec * 1000;
417 
418  if(want_verbose) {
419  printf("L5TM Start Time: %4d-%02d-%02d %03d %02d:%02d:%f\n",
420  year, month, day, data->doy, hour, minute, sec);
421 
422  printf("L5TM file has %d bands, %d samples, %d lines\n",
423  file->nbands, file->npix, file->nscan );
424  }
425  strcpy(file->spatialResolution,"30 m");
426 
427  return 0;
428 }
429 
430 int readl1_l5tm( filehandle *file, int recnum, l1str *l1rec, int lonlat) {
431  int ip, ib, ipb;
432  l5tm_t* data = (l5tm_t*)file->private_data;
433 
434  // set information about data
435  l1rec->npix = file->npix;
436  l1rec->l1file->sensorID = file->sensorID;
437  l1rec->scantime = yds2unix((int16_t) data->year, (int16_t) data->doy,
438  (double) (data->msec / 1000.0 ));
439 
440  // get lat-lon
441  for (ip=0; ip<file->npix; ip++) {
442  data->lon[ip] = ip;
443  data->lat[ip] = recnum;
444  GTIFImageToPCS(data->gtif, data->lon+ip, data->lat+ip);
445  }
446 
447  if (!GTIFProj4ToLatLong(data->defn, file->npix, data->lon, data->lat) ) {
448  fprintf(stderr,"-E- %s line %d: unable reproject points for scan %d\n",
449  __FILE__,__LINE__,recnum);
450  exit(1);
451  }
452 
453  for (ip=0; ip<file->npix; ip++) {
454 
455  l1rec->pixnum[ip] = ip;
456 
457  if ( isnan(data->lat[ip]) )
458  data->lat[ip] = -999.0;
459  if ( isnan(data->lon[ip]) )
460  data->lon[ip] = -999.0;
461  l1rec->lat[ip] = data->lat[ip];
462  l1rec->lon[ip] = data->lon[ip];
463 
464  /* printf("lat = %f, lon = %f\n", l1rec->lat[ip], l1rec->lon[ip]); */
465 
466  if (l1rec->lon[ip] < -181.0 || l1rec->lon[ip] > 181.0 ||
467  l1rec->lat[ip] < -91.0 || l1rec->lat[ip] > 91.0 )
468  {
469  l1rec->navfail[ip] = 1;
470  printf("ERROR: lat = %f, lon = %f\n", l1rec->lat[ip], l1rec->lon[ip]);
471  }
472 
473  }
474 
475  // read path angles if user supplied, else use best guess
476 
477  /* For Landsat 5 this IS the only option
478  * if (file->geofile == NULL || file->geofile[0] == 0)
479  { */
480  if (get_l57tm_nom_angles(file->name,file->npix,file->nscan,recnum,l1rec->solz,l1rec->sola,l1rec->senz,l1rec->sena) == -1) {
481  fprintf(stderr, "-E- %s line %d: missing or incompatible geofile\n",
482  __FILE__,__LINE__);
483  exit(1);
484  /* } */
485 
486  }
487  /* not sure if for Landsat 5 enhanced metadata file (EMD) is even available so commented out
488  *
489  * else {
490  if (chk_l5tm_geo(file->geofile) != FT_L5TML1B) {
491  printf("Exit get_oli_angles with error\n");
492  fprintf(stderr, "-E- %s line %d: non-existent or incompatible geofile.\n-E- File specified must be an Enhanced Meta-Data file (EMD format)\n",
493  __FILE__,__LINE__);
494  exit(1);
495  }
496  if ( get_oli_angles(file->geofile,file->npix,file->nscan,recnum,l1rec->solz,l1rec->sola,l1rec->senz,l1rec->sena) == -1) {
497  printf("Exit get_oli_angles with error\n");
498  fprintf(stderr, "-E- %s line %d: missing or incompatible geofile\n",
499  __FILE__,__LINE__);
500  exit(1);
501  }
502  } */
503 
504  // exit for lonlat mode, read in only lon, lat, time and solz
505  if (lonlat)
506  return(LIFE_IS_GOOD);
507 
508  for(ib = 0; ib < file->nbands; ib++)
509  {
510 
511  /* For Landsat 5 skip band 6 */
512  if (ib == 5)
513  {
514  if(TIFFReadScanline(data->tif[ib+1], (void*)data->buf, recnum, 0) == -1) {
515  fprintf(stderr, "-E- %s line %d: Failed to read Lt, band %d, recnum %d\n",
516  __FILE__,__LINE__, ib, recnum );
517  exit(1);
518  }
519  }
520  else
521  {
522  if(TIFFReadScanline(data->tif[ib], (void*)data->buf, recnum, 0) == -1) {
523  fprintf(stderr, "-E- %s line %d: Failed to read Lt, band %d, recnum %d\n",
524  __FILE__,__LINE__, ib, recnum );
525  exit(1);
526  }
527  }
528 
529  for (ip=0; ip<file->npix; ip++) {
530  ipb = ip*file->nbands+ib;
531  if(data->buf[ip] == 0) {
532  l1rec->Lt[ipb] = BAD_FLT; // I assume this is outside the projected tile
533  l1rec->navfail[ip] = 1; // so set navigation failure
534  } else
535  {
536  /* For Landsat 5 skip band 6 */
537  if (ib == 5)
538  {
539  l1rec->Lt[ipb] = (data->buf[ip] * data->scale[ib+1] + data->offset[ib+1]) / 10.0;
540  /* printf("band = %d, scale = %f, offset = %f\n", ib+1, data->scale[ib+1], data->offset[ib+1]);
541  printf("buf = %d, final = %f\n", data->buf[ip], l1rec->Lt[ipb]); */
542  }
543  else
544  {
545  l1rec->Lt[ipb] = (data->buf[ip] * data->scale[ib] + data->offset[ib]) / 10.0;
546  /* printf("band = %d, scale = %f, offset = %f\n", ib, data->scale[ib], data->offset[ib]);
547  printf("buf = %d, final = %f\n", data->buf[ip], l1rec->Lt[ipb]); */
548  }
549 
550  }
551  }
552  }
553 
554  // read Cirrus Band 9
555 
556  /* ib = 8;
557  if(TIFFReadScanline(data->tif[ib], (void*)data->buf, recnum, 0) == -1) {
558  fprintf(stderr, "-E- %s line %d: Failed to read cirrus band, recnum %d\n",
559  __FILE__,__LINE__, recnum );
560  exit(1);
561  }
562 
563  for (ip=0;ip<file->npix; ip++) {
564  if(data->buf[ip] == 0)
565  l1rec->rho_cirrus[ip] = BAD_FLT;
566  else
567  l1rec->rho_cirrus[ip] = (data->buf[ip] * data->refl_scale[ib] + data->refl_offset[ib])
568  / cos(l1rec->solz[ip]/RADEG);
569 
570  } */
571 
572  return 0;
573 }
574 
575 int closel1_l5tm(filehandle *file) {
576  int ib;
577  l5tm_t* data = (l5tm_t*) file->private_data;
578 
579  // undo what open allocated
580  free(data->lat);
581  free(data->lon);
582  data->lat = data->lon = NULL;
583 
584  free(data->buf);
585  data->buf = NULL;
586 
587  GTIFFree(data->gtif);
588  data->gtif = NULL;
589 
590  for(ib=0; ib<file->nbands; ib++) {
591  XTIFFClose(data->tif[ib]);
592  }
594  file->private_data = NULL;
595 
596  return 0;
597 }
void freePrivateData_l5tm(l5tm_t *data)
Definition: l1_l5tm.c:79
int32_t day
double yds2unix(int16_t year, int16_t day, double secs)
Definition: yds2unix.c:7
double * offset
Definition: l1_l5tm.c:29
void readNextLine_l5tm(FILE *fp, char *tag, int *i, char *val)
Definition: l1_l5tm.c:89
int32_t year
Definition: l1_l5tm.c:26
int16_t fileID
#define NULL
Definition: decode_rs.h:63
int closel1_l5tm(filehandle *file)
Definition: l1_l5tm.c:575
read l1rec
double * scale
Definition: l1_l5tm.c:29
void trimBlanks(char *str)
Definition: trimBlanks.c:10
double sunAzimuth
Definition: l1_l5tm.c:27
double sunElevation
Definition: l1_l5tm.c:27
int32 nscan
Definition: l1_czcs_hdf.c:19
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
GTIF * gtif
Definition: l1_l5tm.c:32
#define LIFE_IS_GOOD
Definition: passthebuck.h:4
read recnum
subroutine lonlat(alon, alat, xlon, ylat)
Definition: lonlat.f:2
int read_l5tm_angles(char *file, int32_t npix, int32_t nscan, int32_t iscan, float *solz, float *sola, float *senz, float *sena)
Definition: l1_l5tm.c:130
TIFF ** tif
Definition: l1_l5tm.c:31
int32_t doy
Definition: l1_l5tm.c:26
int want_verbose
double * lon
Definition: l1_l5tm.c:28
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude data
Definition: HISTORY.txt:356
int32_t chk_l5tm_geo(char *fname)
Definition: filetype.c:1329
#define maxBands
int readl1_l5tm(filehandle *file, int recnum, l1str *l1rec, int lonlat)
Definition: l1_l5tm.c:430
#define BAD_FLT
Definition: jplaeriallib.h:19
void ymdhms2ydmsec(int yy, int mm, int dd, int hh, int mn, int sc, int32_t *year, int32_t *day, int32_t *msec)
Definition: ydhms2ydmsec.c:3
int32_t iscan
int get_l5tm_angles(char *emeta_filename, int32_t npix, int32_t nscan, int32_t iscan, float *solz, float *sola, float *senz, float *sena)
double * lat
Definition: l1_l5tm.c:28
uint8_t * buf
Definition: l1_l5tm.c:34
int get_l57tm_nom_angles(char *meta_filename, int32_t npix, int32_t nscan, int32_t iscan, float *solz, float *sola, float *senz, float *sena)
l5tm_t * createPrivateData_l5tm(int numBands)
Definition: l1_l5tm.c:38
int i
Definition: decode_rs.h:71
GTIFDefn * defn
Definition: l1_l5tm.c:33
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 msec
Definition: l1_l5tm.c:26
int npix
Definition: get_cmp.c:28
int openl1_l5tm(filehandle *file)
Definition: l1_l5tm.c:223
int count
Definition: decode_rs.h:79