OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
smeta.h
Go to the documentation of this file.
1 /*
2  * Name: smeta.h
3  *
4  * Purpose:
5  * Include file defining the product metadata structure that is used to generate the
6  * scene viewing geometry information needed to calculate per-pixel view angles.
7  */
8 #ifndef _SMETA_H_
9 #define _SMETA_H_
10 
11 /* Defines the maximum number of normal bands present on any of the supported
12  satellites. Note that this should only be used if absolutely necessary.
13  It is preferred that arrays be sized dynamically. */
14 #define IAS_MAX_NBANDS 11
15 #define IAS_MAX_NBANDS_LS 8
16 /* Defines the maximum number of SCAs present on any of the supported
17  sensors. Note that this should only be used if absolutely necessary.
18  It is preferred that arrays be sized dynamically. */
19 #define IAS_MAX_NSCAS 14
20 
21 #define IAS_MAX_NSCANS 375
22 
23 #include "ias_const.h"
24 #include "ias_structures.h" /* IAS_VECTOR and IAS_CORNERS */
25 
26 typedef enum LANDSAT_SPACECRAFT
27 {
29  IAS_L1=1,
37 
38 typedef enum LANDSAT_SENSOR
39 {
46 
47 typedef enum SENSOR_MODE
48 {
50  MSS=1,
54 } SENSOR_MODE;
55 
56 
57 typedef struct SMETA_SCENE_PROJ
58 {
59  /* ==== WGS84 ellipsoid parameters ==== */
60  double wgs84_major_axis; /* WGS 84 ellipsoid semi-major axis (meters) */
61  double wgs84_minor_axis; /* WGS 84 ellipsoid semi-minor axis (meters) */
62  /* ==== Projection parameters and info. ==== */
63  char units[IAS_UNITS_SIZE]; /* Projection units string */
64  int code; /* Projection code for the output space image.
65  Values for this field are defined in the
66  "gctp.h" include file. */
67  char datum[IAS_DATUM_SIZE]; /* Projection datum string */
68  int spheroid; /* Projection spheroid code */
69  int zone; /* Projection zone code for UTM or
70  State Plane projections. */
72  /* Array of 15 projection coefficients as required by the projection
73  transformation package. Refer to the projection package documentation
74  for a description of each field for a given projection. */
75  /* ==== Grid corners. ==== */
76  struct IAS_CORNERS corners; /* Projection coordinates of the resulting
77  output image's four corners. */
79 
80 typedef struct SMETA_BAND
81 {
82  int band; /* User band number */
83  int l1t_lines; /* Number of lines in the L1T image. */
84  int l1t_samps; /* Number of samples in the L1T image. */
85  int nsca; /* Number of SCAs in this band */
86  /* Sudipta new addition for OLI to extract SCA and Det numbers */
87  int num_detectors; /* Number of detectors per SCA for this band */
88  /* End Sudipta new addition for OLI */
89  double pixsize; /* Projection distance per pixel in meters. */
90  double align[3][3]; /* Instrument to spacecraft alignment */
91  double legendre[IAS_MAX_NSCAS][2][4]; /* Per SCA Legendre coefficients */
92 } SMETA_BAND;
93 
94 /* for older LS */
95 typedef struct SMETA_BAND_LS
96 {
97  int band; /* User band number */
98  int l1t_lines; /* Number of lines in the L1T image. */
99  int l1t_samps; /* Number of samples in the L1T image. */
100  int nsca; /* Number of SCAs */
101  int nscans; /* Number of scans in this band */
102  int nlines; /* Number of lines within a scans in this band */
103  int nsamps; /* Number of samples within a scans in this band */
104  double pixsize; /* Projection distance per pixel in meters. */
105  double align[3][3]; /* Instrument to spacecraft alignment */
106  double fascan; /* Forward along scan field of view */
107  double rascan; /* Reverse along scan field of view */
108  double xscan; /* Across scan field of view */
109  double afov; /* Along detector field of view */
110  double xfov; /* Across detector field of view */
111  double aoffset; /* Along scan band offset */
112  double xoffset; /* Across scan band offset */
113  double center_sample; /* MSS Center sample location */
114  double sample_slope; /* MSS detectors / radian scale */
115 } SMETA_BAND_LS;
116 
117 
118 typedef struct SMETA
119 {
120  char scene_id[22]; /* Scene ID as Lx8ppprrryyyydddLGNnn */
121  LANDSAT_SPACECRAFT spacecraft_id; /* Landsat spacecraft ID */
122  LANDSAT_SENSOR sensor_id; /* Landsat sensor ID */
123  SENSOR_MODE sensor_mode; /* Sensor operating mode (for TM/ETM+) */
124  int wrs_path; /* WRS path number (target) */
125  int wrs_row; /* WRS row number (target) */
126  double roll_angle; /* Off-nadir roll angle in degrees */
127  int acq_date[3]; /* Acquisition year, month, day */
128  double sun_azimuth; /* Scene center sun azimuth in degrees */
129  double sun_elevation; /* Scene center sun elevation in degrees */
130  SMETA_SCENE_PROJ projection; /* Ground reference for this L1T scene */
131  int num_band; /* Number of bands in the metadata structure */
132  SMETA_BAND band_smeta[IAS_MAX_NBANDS]; /* Metadata for each band */
133  SMETA_BAND_LS band_smeta_ls[IAS_MAX_NBANDS_LS]; /* Metadata for each band for older LS */
134 } SMETA;
135 
136 #endif
@ unknown_mode
Definition: smeta.h:49
@ IAS_L1
Definition: smeta.h:29
@ IAS_L2
Definition: smeta.h:30
int band
Definition: smeta.h:82
SENSOR_MODE
Definition: smeta.h:47
SMETA_SCENE_PROJ projection
Definition: smeta.h:130
@ MSS
Definition: smeta.h:50
int nscans
Definition: smeta.h:101
double rascan
Definition: smeta.h:107
int l1t_samps
Definition: smeta.h:99
double sun_elevation
Definition: smeta.h:129
double sample_slope
Definition: smeta.h:114
int num_band
Definition: smeta.h:131
LANDSAT_SENSOR
Definition: smeta.h:38
double fascan
Definition: smeta.h:106
int nlines
Definition: smeta.h:102
@ IAS_ETM
Definition: smeta.h:43
#define IAS_MAX_NSCAS
Definition: smeta.h:19
double sun_azimuth
Definition: smeta.h:128
double xfov
Definition: smeta.h:110
double aoffset
Definition: smeta.h:111
int l1t_samps
Definition: smeta.h:84
int nsamps
Definition: smeta.h:103
double legendre[IAS_MAX_NSCAS][2][4]
Definition: smeta.h:91
double wgs84_major_axis
Definition: smeta.h:60
double align[3][3]
Definition: smeta.h:90
int l1t_lines
Definition: smeta.h:83
int wrs_path
Definition: smeta.h:124
@ IAS_OLI_TIRS
Definition: smeta.h:44
#define IAS_MAX_NBANDS
Definition: smeta.h:14
@ IAS_L4
Definition: smeta.h:32
@ IAS_L8
Definition: smeta.h:35
char units[IAS_UNITS_SIZE]
Definition: smeta.h:63
SMETA_BAND band_smeta[IAS_MAX_NBANDS]
Definition: smeta.h:132
#define IAS_UNITS_SIZE
Definition: ias_const.h:55
#define IAS_DATUM_SIZE
Definition: ias_const.h:58
double pixsize
Definition: smeta.h:104
int band
Definition: smeta.h:97
double roll_angle
Definition: smeta.h:126
@ TM_BUMPER
Definition: smeta.h:52
@ IAS_L5
Definition: smeta.h:33
LANDSAT_SPACECRAFT spacecraft_id
Definition: smeta.h:121
@ unknown_spacecraft_type
Definition: smeta.h:28
@ IAS_MSS
Definition: smeta.h:41
double xscan
Definition: smeta.h:108
@ TM_SAM
Definition: smeta.h:51
@ IAS_L3
Definition: smeta.h:31
#define IAS_MAX_NBANDS_LS
Definition: smeta.h:15
int num_detectors
Definition: smeta.h:87
int nsca
Definition: smeta.h:100
SMETA_BAND_LS band_smeta_ls[IAS_MAX_NBANDS_LS]
Definition: smeta.h:133
struct IAS_CORNERS corners
Definition: smeta.h:76
int acq_date[3]
Definition: smeta.h:127
@ unknown_sensor_type
Definition: smeta.h:40
LANDSAT_SPACECRAFT
Definition: smeta.h:26
double afov
Definition: smeta.h:109
@ IAS_L7
Definition: smeta.h:34
@ IAS_TM
Definition: smeta.h:42
double xoffset
Definition: smeta.h:112
int nsca
Definition: smeta.h:85
int spheroid
Definition: smeta.h:68
double center_sample
Definition: smeta.h:113
double align[3][3]
Definition: smeta.h:105
char datum[IAS_DATUM_SIZE]
Definition: smeta.h:67
char scene_id[22]
Definition: smeta.h:120
Definition: smeta.h:118
int wrs_row
Definition: smeta.h:125
SENSOR_MODE sensor_mode
Definition: smeta.h:123
double wgs84_minor_axis
Definition: smeta.h:61
@ OLI
Definition: smeta.h:53
double projprms[IAS_PROJ_PARAM_SIZE]
Definition: smeta.h:71
int l1t_lines
Definition: smeta.h:98
#define IAS_PROJ_PARAM_SIZE
Definition: ias_const.h:61
double pixsize
Definition: smeta.h:89
LANDSAT_SENSOR sensor_id
Definition: smeta.h:122