OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l1c_msi_private.h
Go to the documentation of this file.
1 
2 #ifndef L1C_MSI_PRIVATE_H
3 #define L1C_MSI_PRIVATE_H
4 
5 #include <boost/geometry.hpp>
6 #include <boost/geometry/geometries/point_xy.hpp>
7 #include <boost/geometry/geometries/polygon.hpp>
8 #include <boost/geometry/geometries/linestring.hpp>
9 #include <openjpeg.h>
10 
11 #include <proj.h>
12 
13 #define maxBands 13
14 #define numDetectors 12
15 
16 typedef boost::geometry::model::d2::point_xy<double> Point_t;
17 typedef boost::geometry::model::polygon<Point_t> Polygon_t;
18 
19 typedef struct msi_struct {
22 
23  float esdist; // Earth-Sun distance correction factor
24  float alt;
25 
26  char tileID[FILENAME_MAX]; // to hold the Sentinel TileID
27  char imgDir[FILENAME_MAX]; // char array for directories
28  char* granuleMetadataFile; //MTD_TL.xml for the granule - contains view angles
29  char* datastripMetadataFile; // MTD_DS.xml file for the 'datastrip' - contains orbit info
30  char* jp2[maxBands]; // char array for jp2 file name
31  char* detectorFootprintFiles[maxBands]; // for simplicity, choose just one 20m band
32 
33  // members for projection
34  int32_t CSCode; // EPSG Coordinate System Code
35  char* UTMZone; // UTM Zone Number
36  int32_t *ULCoord; // Upper left coordinates
37  PJ *pj; // projection
38 
39  // orbit posvec
40  int num_gps;
41  double *position[3];
42  double *gpstime;
43 
44  // detector footprint polygons
45  // there are 12 detectors arrays - not all are filled for every "scene"
47  // This delta time is the relative difference in time between the detectors
49  // The time between each line (ne scan) use to propagate start time to scantime
50  double lineTimeDelta;
51 
52  // tie-point view angles by band
53  double **sensorZenith;
54  double **sensorAzimuth;
55 
56  // members for decoding jp2 images
57  opj_image_t* image[maxBands]; // opj_image_t pointer array for image for each band
58  opj_stream_t* l_stream[maxBands]; // stream array
59  opj_codec_t* l_codec[maxBands]; // array of handle to a decompressor
60  opj_codestream_index_t* cstr_index[maxBands];
61  opj_dparameters_t parameters[maxBands]; // decompression parameters
62  opj_codestream_info_v2_t* cstr_info[maxBands]; //tile info
63 
64  uint32_t *buf; //buffer for data manipulations...meh.
65 } msi_t;
66 
67 msi_t* createPrivateData_msi(int numBands);
68 
69 #endif /* L1C_MSI_PRIVATE_H */
70 
opj_codestream_info_v2_t * cstr_info[maxBands]
char * orbit_direction
char * detectorFootprintFiles[maxBands]
msi_t * createPrivateData_msi(int numBands)
Definition: l1c_msi.cpp:189
char * granuleMetadataFile
opj_codestream_index_t * cstr_index[maxBands]
char * UTMZone
Polygon_t detectorFootprints[numDetectors]
int32_t * ULCoord
opj_stream_t * l_stream[maxBands]
double * gpstime
char * datastripMetadataFile
boost::geometry::model::d2::point_xy< double > Point_t
opj_codec_t * l_codec[maxBands]
double * position[3]
double lineTimeDelta
double ** sensorZenith
int32_t CSCode
double detectorDeltaTime[numDetectors][maxBands]
opj_dparameters_t parameters[maxBands]
opj_image_t * image[maxBands]
uint32_t * buf
bg::model::polygon< Point_t > Polygon_t
Definition: get_dataday.cpp:25
boost::geometry::model::polygon< Point_t > Polygon_t
double scene_start_time
char * jp2[maxBands]
#define maxBands
char tileID[FILENAME_MAX]
double ** sensorAzimuth
char imgDir[FILENAME_MAX]
#define numDetectors