OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
emeta.h
Go to the documentation of this file.
1 /*
2  * Name: emeta.h
3  *
4  * Purpose:
5  * Include file defining the enhanced metadata structure that is used to capture the
6  * scene viewing geometry information needed to calculate per-pixel view angles. This
7  * information includes linkages between L1T line/sample pixel coordinates and the
8  * corresponding time of observation, so it can also be used to generate per-pixel
9  * sun angles.
10  */
11 #ifndef _EMETA_H_
12 #define _EMETA_H_
13 
14 /* Defines the maximum number of normal bands present on any of the supported
15  satellites. Note that this should only be used if absolutely necessary.
16  It is preferred that arrays be sized dynamically. */
17 #define IAS_MAX_NBANDS 11
18 
19 /* Defines the maximum number of SCAs present on any of the supported
20  sensors. Note that this should only be used if absolutely necessary.
21  It is preferred that arrays be sized dynamically. */
22 #define IAS_MAX_NSCAS 14
23 
24 #include "ias_const.h"
25 #include "ias_structures.h" /* IAS_VECTOR and IAS_CORNERS */
26 
27 #define NUM_RPC_COEF 5 /* Number of image RPC coefficents in model */
28 #define ANG_RPC_COEF 10 /* Number of angle RPC coefficents in model */
29 
30 typedef struct EMETA_IMG_RPC
31 {
32  int sca_num; /* Number of current SCA */
33  double mean_l1r[2]; /* L1R mean line, sample offset */
34  double mean_l1t[2]; /* L1T mean line, sample offset */
35  double mean_hgt; /* Mean height offset */
36  double line_num[NUM_RPC_COEF]; /* L1R line RPC numerator coefficients */
37  double line_den[NUM_RPC_COEF-1]; /* L1R line RPC denominator coefficients */
38  double samp_num[NUM_RPC_COEF]; /* L1R sample RPC numerator coefficients */
39  double samp_den[NUM_RPC_COEF-1]; /* L1R sample RPC denominator coefficients */
41 
42 typedef struct EMETA_ANG_RPC
43 {
44  double mean_l1t[2]; /* L1T mean line, sample offset */
45  double mean_hgt; /* Mean height offset */
46  double mean_l1r[2]; /* L1R mean line, sample offset */
47  double mean_vec[3]; /* Mean vector component offsets */
48  double x_num[ANG_RPC_COEF]; /* X axis RPC numerator coefficients */
49  double x_den[ANG_RPC_COEF-1]; /* X axis RPC denominator coefficients */
50  double y_num[ANG_RPC_COEF]; /* Y axis RPC numerator coefficients */
51  double y_den[ANG_RPC_COEF-1]; /* Y axis RPC denominator coefficients */
52  double z_num[ANG_RPC_COEF]; /* Z axis RPC numerator coefficients */
53  double z_den[ANG_RPC_COEF-1]; /* Z axis RPC denominator coefficients */
55 
56 typedef struct EMETA_SCENE_PROJ
57 {
58  /* ==== WGS84 ellipsoid parameters ==== */
59  double wgs84_major_axis; /* WGS 84 ellipsoid semi-major axis (meters) */
60  double wgs84_minor_axis; /* WGS 84 ellipsoid semi-minor axis (meters) */
61  /* ==== Projection parameters and info. ==== */
62  char units[IAS_UNITS_SIZE]; /* Projection units string */
63  int code; /* Projection code for the output space image.
64  Values for this field are defined in the
65  "gctp.h" include file. */
66  char datum[IAS_DATUM_SIZE]; /* Projection datum string */
67  //int spheroid; /* Projection spheroid code */
68  int zone; /* Projection zone code for UTM or
69  State Plane projections. */
71  /* Array of 15 projection coefficients as required by the projection
72  transformation package. Refer to the projection package documentation
73  for a description of each field for a given projection. */
74  /* ==== Grid corners. ==== */
75  struct IAS_CORNERS corners; /* Projection coordinates of the resulting
76  output image's four corners. */
78 
79 typedef struct EMETA_BAND
80 {
81  int band; /* User band number */
82  int nsca; /* Number of SCAs in the band */
83  int l1t_lines; /* Number of lines in the L1T image. */
84  int l1t_samps; /* Number of samples in the L1T image. */
85  int l1r_lines; /* Number of lines in the L1R image. */
86  int l1r_samps; /* Number of samples in one L1R SCA. */
87  double pixsize; /* Projection distance per pixel in meters. */
88  double img_start_time; /* Image start time, offset in seconds from
89  ephemeris epoch */
90  double line_time; /* L1R line time increment in seconds */
91  EMETA_ANG_RPC sat; /* Satellite view vector RPC structure */
92  EMETA_ANG_RPC sun; /* Solar illumination vector RPC structure */
93  EMETA_IMG_RPC rpc[IAS_MAX_NSCAS]; /* Per SCA RPC coefficient structures */
94 } EMETA_BAND;
95 
96 typedef struct EMETA_EPHEM
97 {
98  double eph_sample_time; /* Sample time from ephemeris epoch */
99  IAS_VECTOR ecef_position; /* ECEF positions */
100 } EMETA_EPHEM;
101 
102 typedef struct EMETA
103 {
104  //int wrs_path; /* WRS path number (target) */
105  //int wrs_row; /* WRS row number (target) */
106  EMETA_SCENE_PROJ projection; /* Ground reference for this L1T scene */
107  int num_band; /* Number of bands in the metadata structure */
108  EMETA_BAND band_emeta[IAS_MAX_NBANDS]; /* Enhanced metadata for each band */
109  double eph_epoch_time[3]; /* UTC time ([0]=year,
110  [1]=day of year,
111  [2]=second of day )
112  of ephemeris epoch */
113  int ephem_count; /* Number of ephemeris samples */
114  EMETA_EPHEM *ephemeris; /* Ephemeris data for scene */
115  EMETA_EPHEM *sunvector; /* ECEF solar vectors for scene */
116 } EMETA;
117 
119  EMETA *emeta, /* Enhanced metadata structure */
120  int nephem ); /* Number of ephemeirs points required */
121 
123  EMETA *emeta ); /* Enhanced metadata structure */
124 
125 #endif
EMETA_ANG_RPC sat
Definition: emeta.h:91
double wgs84_major_axis
Definition: emeta.h:59
double eph_sample_time
Definition: emeta.h:98
double mean_vec[3]
Definition: emeta.h:47
#define IAS_MAX_NBANDS
Definition: emeta.h:17
int num_band
Definition: emeta.h:107
#define IAS_MAX_NSCAS
Definition: emeta.h:22
char units[IAS_UNITS_SIZE]
Definition: emeta.h:62
double projprms[IAS_PROJ_PARAM_SIZE]
Definition: emeta.h:70
int l1t_samps
Definition: emeta.h:84
double x_den[ANG_RPC_COEF-1]
Definition: emeta.h:49
double mean_l1t[2]
Definition: emeta.h:34
double samp_num[NUM_RPC_COEF]
Definition: emeta.h:38
double samp_den[NUM_RPC_COEF-1]
Definition: emeta.h:39
double mean_l1r[2]
Definition: emeta.h:46
int l1r_samps
Definition: emeta.h:86
int l1t_lines
Definition: emeta.h:83
double mean_l1r[2]
Definition: emeta.h:33
double x_num[ANG_RPC_COEF]
Definition: emeta.h:48
double mean_hgt
Definition: emeta.h:45
int ephem_count
Definition: emeta.h:113
double wgs84_minor_axis
Definition: emeta.h:60
IAS_VECTOR ecef_position
Definition: emeta.h:99
#define NUM_RPC_COEF
Definition: emeta.h:27
#define IAS_UNITS_SIZE
Definition: ias_const.h:55
EMETA_BAND band_emeta[IAS_MAX_NBANDS]
Definition: emeta.h:108
#define IAS_DATUM_SIZE
Definition: ias_const.h:58
#define ANG_RPC_COEF
Definition: emeta.h:28
Definition: emeta.h:102
char datum[IAS_DATUM_SIZE]
Definition: emeta.h:66
double mean_l1t[2]
Definition: emeta.h:44
EMETA_EPHEM * sunvector
Definition: emeta.h:115
double line_time
Definition: emeta.h:90
double line_num[NUM_RPC_COEF]
Definition: emeta.h:36
double eph_epoch_time[3]
Definition: emeta.h:109
double line_den[NUM_RPC_COEF-1]
Definition: emeta.h:37
EMETA_SCENE_PROJ projection
Definition: emeta.h:106
double mean_hgt
Definition: emeta.h:35
double img_start_time
Definition: emeta.h:88
EMETA_IMG_RPC rpc[IAS_MAX_NSCAS]
Definition: emeta.h:93
double z_den[ANG_RPC_COEF-1]
Definition: emeta.h:53
double y_den[ANG_RPC_COEF-1]
Definition: emeta.h:51
void emeta_free_ephemeris(EMETA *emeta)
Definition: emeta.c:51
double y_num[ANG_RPC_COEF]
Definition: emeta.h:50
int emeta_allocate_ephemeris(EMETA *emeta, int nephem)
Definition: emeta.c:12
struct IAS_CORNERS corners
Definition: emeta.h:75
double pixsize
Definition: emeta.h:87
int sca_num
Definition: emeta.h:32
EMETA_EPHEM * ephemeris
Definition: emeta.h:114
int nsca
Definition: emeta.h:82
#define IAS_PROJ_PARAM_SIZE
Definition: ias_const.h:61
EMETA_ANG_RPC sun
Definition: emeta.h:92
int l1r_lines
Definition: emeta.h:85
int band
Definition: emeta.h:81
double z_num[ANG_RPC_COEF]
Definition: emeta.h:52