OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l1c_filehandle.h
Go to the documentation of this file.
1 /*
2  * File: l1c_filehandle.h
3  * Author: mmontes
4  *
5 ---------------------------------------------------------
6 l1cgen firstly defined as mainL1C.cpp
7  Created by Martin Montes on 10/26/20.
8  last version 3/7/2022
9 ---------------------------------------------------------
10  */
11 
12 #ifndef L1C_FILEHANDLE_H
13 #define L1C_FILEHANDLE_H
14 
15 #include <stdio.h>
16 #include <string>
17 #include <vector>
18 #include <filetype.h>
19 
20 
21 #define READ 0
22 #define WRITE 1
23 
24 
25 namespace l1c {
26 
28 protected:
29 
30 public:
31  //methods---
33  virtual ~l1c_filehandle();
34  virtual void printProducts();
35  //global attributes----
36  std::string l1b_name;//just the input l1b filenamed
37  size_t sd_id;
38 
39 
40  //more L1C input vars
41  size_t swtnum;
42  int16_t selgran[10];//selected granule ids for L1C processing
43  const char* gridname;//name for l1cgrid having 2-d lon,lat gd points
44  const char* azeast_name;//filename of az_east in degrees
45  size_t l1c_pflag;//L1C processing 0:no processing, 1:full orbit, 2: full swath, half-day daytime, 3: L1C grid generation, 4: 5-minute granule file
46  std::vector<std::string> cust_l1cprod;//list of L1c products to be included, flexible approach
47  std::vector<std::string> ifiles;
48  file_type format;//file type, netcdf4 or hdf4/5
49  size_t mode;//read/write file mode
50  size_t length;//data block
51  size_t sensorID;//original int32 changed to size_t type
52  size_t subsensorID;
53  float res_spat;//spatial resolution in km
54  float res_spec;//spectral resolution in nm
55 
56  //time-space limits of image
57  int16_t syear;
58  int16_t sday;
59  float minlat_img;
60  float maxlat_img;
61  float minlon_img;
62  float maxlon_img;
63 
64  //dimensions--
65  size_t nframes;
66  size_t ndets;
67  size_t nscan;
68  size_t n_views;//sensor views
69  size_t npols; //polarization states
70  size_t nbands;//number of total bands
71  size_t nband_blue;//this includes uv + visible bands
72  size_t nband_red;//this includes nir + visible bands
73  size_t nband_swir;
74  size_t npix;//number of pixels per line or across-track --x component
75 
76  //sensor characteritics
77  float *views;//indexes are not defined
78  size_t pols[3];//[1 0 0] non-pol, [1 1 0]: non+cross, [1 1 1]: non+cross+parall
79  float *bbands;//array with bands wavelengths
80  float *rbands;
81  float *swirbands;
82 
83 
84  //navigation attributes
85  //swath attr here
86  size_t orbit_number;
87  size_t orb_dir;//asc or desc orbit 1 or 0 respectively
88  float orbit_node_lon;//long at which is crossing the equator asc or desc
89  double eqt;//equat crossing time
90  std::string tswt_ini;//UTC initial time of swath
91  std::string tswt_end;//UTC ennd time of swath
93  double tunix_start;// unix time
94  double tg_s;
95  double tg_e;
96  int numgran;
97  double tfile_ini_sec;//unix time seconds since 1970
98 
99  //telemetry stauff----L1A--HKT
100  int32_t fileix;
101  int32_t gransize;//granule size in minutes
102  int32_t gd_per_gran;//#gridlines per granule time
103 
104  //geolocation attributes
107  float *cloud_height; //should be in geolocation group nc file
108 
109  //calibration attributes
110  float *Fobar;
111 
112  //projection attributes-
113  //std::string proj_type;
114  float mean_az_east;//swath mean bearing for right side scan
115  int32_t NY1;
116  int32_t NY2;
117  int32_t num_gridlines;
118  int32_t nbinx;//grid bins across-track
119  int32_t sensor;
120  float latnorth;
121  float latsouth;
122  int16_t nswath;
123  int16_t ndswaths;
124  int16_t nswt_files;
125  int32_t nadpix;
126  size_t proj_type;
127  float gres;//grid resolution in km
128 
129  //these params go to proj class
130  //float rot_az;//rotation pole params
131  float lat0;
132  //float lon0;
133  //float latc;
134  //float lonc;
135 
136  //multi attributes (view, pol, bands)
137  float *view_agg; //views to be aggregated for later products such as vsfs etc
138  float *pol_agg;//polarization states to be aggregated for post-processing products, linear depolarization ratio etc
139  float *band_agg;//specific bands for future merged products
140  size_t overlap_vflag;//tells if we want merged views
141  size_t overlap_pflag;//tells if we want merged polarizations
142  size_t overlap_bflag;//tells if we want merged spectral bands
143  //uncertainty params for merged l1c products
144  size_t unc_meth;//0: no error calculation, 1: propagation, 2: Monte Carlo
145  float unc_thres_v; //uncertainity threshold of angular merged products as %
146  float unc_thres_p;//same but for polarization
147  float unc_thres_b;//same but for spectral bands
148  //ancill info, requested products?
149  //float *cloud_h;//this is cloud_height
150 
151 };
152 
153 //we move this to l1c class --void load_l1c_filehandle(filehandle *file,l1c_filehandle *filel1c);
154 //void printVector(const std::vector<std::string> &n);
155  void printProducts();
156 
157 
158 }//end namespace
159 #endif
160 
std::string l1b_name
virtual void printProducts()
void printProducts()
@ string
const char * azeast_name
std::string tswt_ini
const char * gridname
std::string tswt_end
Definition: l1c.cpp:76
file_type
Definition: filetype.h:11
std::vector< std::string > cust_l1cprod
std::string tswt_ini_file
std::vector< std::string > ifiles