| 1 |
#ifndef _LANDSAT_H |
| 2 |
#define _LANDSAT_H |
| 3 |
|
| 4 |
#define UNCORRECTED 0 |
| 5 |
#define CORRECTED 1 |
| 6 |
|
| 7 |
#define DOS 10 |
| 8 |
#define DOS1 12 |
| 9 |
#define DOS2 14 |
| 10 |
#define DOS2b 15 |
| 11 |
#define DOS3 16 |
| 12 |
#define DOS4 18 |
| 13 |
|
| 14 |
#define NOMETADATAFILE 0 |
| 15 |
#define METADATAFILE 1 |
| 16 |
|
| 17 |
/********************************************************** |
| 18 |
* Landsat Structures |
| 19 |
* |
| 20 |
* Lmax and Lmin in W / (m^2 * sr * micron) -> Radiance |
| 21 |
* Esun in W / (m^2 * micron) -> Irradiance |
| 22 |
*********************************************************/ |
| 23 |
|
| 24 |
#define MAX_BANDS 11 |
| 25 |
|
| 26 |
typedef struct { |
| 27 |
int number; /* Band number */ |
| 28 |
int code; /* Band code */ |
| 29 |
|
| 30 |
double wavemax, wavemin; /* Wavelength in micron */ |
| 31 |
|
| 32 |
double esun; /* Mean solar irradiance */ |
| 33 |
double lmax, lmin; /* Spectral radiance */ |
| 34 |
double qcalmax, qcalmin; /* Quantized calibrated pixel */ |
| 35 |
|
| 36 |
char thermal; /* Flag to thermal band */ |
| 37 |
double gain, bias; /* Gain and Bias of sensor */ |
| 38 |
double K1, K2; /* Thermal calibration |
| 39 |
* or Rad2Ref constants */ |
| 40 |
} band_data; |
| 41 |
|
| 42 |
typedef struct { |
| 43 |
int flag; /* Line-data or file-data */ |
| 44 |
unsigned char number; /* Landsat number */ |
| 45 |
|
| 46 |
char creation[11]; /* Image production date */ |
| 47 |
char date[11]; /* Image acquisition date */ |
| 48 |
double time; /* Image acquisition time */ |
| 49 |
|
| 50 |
double dist_es; /* Distance Earth-Sun */ |
| 51 |
double sun_elev; /* Sun elevation */ |
| 52 |
double sun_az; /* Sun azimuth */ |
| 53 |
|
| 54 |
char sensor[10]; /* Sensor: MSS, TM, ETM+, OLI/TIRS */ |
| 55 |
int bands; /* Total number of bands */ |
| 56 |
band_data band[MAX_BANDS]; /* Data for each band */ |
| 57 |
|
| 58 |
} lsat_data; |
| 59 |
|
| 60 |
/***************************************************************************** |
| 61 |
* Landsat Equations Prototypes |
| 62 |
*****************************************************************************/ |
| 63 |
|
| 64 |
double lsat_qcal2rad(double, band_data *); |
| 65 |
double lsat_rad2ref(double, band_data *); |
| 66 |
double lsat_rad2temp(double, band_data *); |
| 67 |
|
| 68 |
void lsat_bandctes(lsat_data *, int, char, double, int, double); |
| 69 |
|
| 70 |
#endif |