OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l1c_filehandle.cpp
Go to the documentation of this file.
1 //
2 // l1c_filehandle.cpp
3 //
4 //
5 // Created by Martin Montes on 10/26/20.
6 //
7 
8 #include "l1c_filehandle.h"
9 #include <string>
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <math.h>
13 #include <boost/assign/list_of.hpp> // for 'list_of()'
14 #include <boost/assert.hpp>
15 #include <list>
16 #include <stack>
17 #include <vector>
18 #include <iostream>
19 
20 
21 using namespace std;
22 using namespace boost::assign;
23 
24 namespace l1c {
25 
26 l1c_filehandle::l1c_filehandle() {
27  //global--
28  //L1C produts-
29  //std::vector<std::string> cust_l1cprod = list_of("pc")("vsf")("dpr");//3 options selected for for l1c products, principal components, volume scattering function and degree linear polarization
30  //std::vector<std::string> cust_l1cprod = {"pc","vsf","dpr"};
31  cust_l1cprod.push_back("pc");
32  gridname="";
33  azeast_name="";
34  swtnum=1;
35  for(int j=0;j<10;j++){
36  selgran[j]=-1;}
37  l1c_pflag=0;
38  l1b_name="";
39  sd_id=0;
40  format=FT_INVALID;
41  mode=READ;
42  length=0;
43  sensorID = -1;
44  subsensorID = -1;
45  res_spat=-999.0;;
46  res_spec=-999.0;;
47 
48  //time-space limits of image
49  syear=0;
50  sday=0;
51  minlat_img=-999.0;;
52  maxlat_img=-999.0;;
53  minlon_img=-999.0;;
54  maxlon_img=-999.0;;
55 
56  //dimensions--
57  nframes=-1;//HARP sensor
58  ndets=1;
59  nscan=0;
60  n_views=1;//sensor views
61  npols=1; //polarization states
62  nbands=0;//number of total bands
63  nband_blue=0;//this includes uv + visible bands
64  nband_red=0;//this includes nir + visible bands
65  nband_swir=0;
66  npix=0;
67 
68  //sensor characteritics
69  views=nullptr;//indexes are not defined
70  for (int i=0;i<3;i++){
71  pols[i] = 0;//0: non-pol, 1: cross, 2: parall
72  }
73 
74  bbands=nullptr;//array with bands wavelengths
75  rbands=nullptr;
76  swirbands=nullptr;
77 
78  //navigation attributes
79  orbit_number=0;
80  orb_dir=-1;//0 asc 1 des
81  orbit_node_lon=-999.0;//this is node_crossing_time
82  eqt=-999.0;
83  tswt_ini="";//metadata string for initial time
84  tswt_end=""; //metadata string for final time
85  tswt_ini_file="";
86  tunix_start=-999.;//start utc time for the swath,
87  tg_s=-999.;
88  tg_e=-999.;
89  numgran=-1;
90  tfile_ini_sec=-999.;
91 
92  //telemetry stauff----L1A--HKT
93  fileix=0;
94  gransize=5; //granule size in minutes
95  gd_per_gran=400;
96 
97  //geolocation attributes
98  terrain_corrected=0;
99  cloud_corrected=0;
100  cloud_height=nullptr;
101 
102  //calibration attributes
103  Fobar=nullptr;
104 
105  //projection attribute
106  mean_az_east=-999.0;
107  NY1=-1;
108  NY2=-1;
109  num_gridlines=-1;
110  nbinx=-1;
111  sensor=-1;
112  latnorth=90.0;
113  latsouth=-90.0;
114  nswath=-1;
115  ndswaths=-1;
116  nswt_files=-1;
117  nadpix=-1;
118  gres=-999.0;
119 
120 
121  proj_type=-1;//0 'swath_grid" and 1: socea
122  //rot_az=-999.0;//rotation pole params
123  lat0=0.0;
124  //lon0=-999.0;
125  //latc=-999.0;
126  //lonc=-999.0;
127 
128  //multi attributes (view, pol, bands)
129  view_agg=nullptr; //views to be aggregated for later products such as vsfs etc
130  pol_agg=nullptr;//polarization states to be aggregated for post-processing products, linear depolarization ratio etc
131  band_agg=nullptr;//specific bands for future merged products
132  overlap_vflag=0;//tells if we want merged views
133  overlap_pflag=0;//tells if we want merged polarizations
134  overlap_bflag=0;//tells if we want merged spectral bands
135  //uncertainty params l1c merged products
136  unc_meth=-1;
137  unc_thres_v=-999.0; //uncertainity threshold of angular merged products as %
138  unc_thres_p=-999.0;//same but for polarization
139  unc_thres_b=-999.0;//same but for spectral bands
140 
141 
142 }
143 
144 
145 l1c_filehandle::~l1c_filehandle() {
146 }
147 
148 
149 
151  std::vector<std::string> cust_l1cprod = {"pc", "vsf", "dpr"};
152 // cust_l1cprod = {"pc", "vsf", "dpr"};
153  for ( const auto & item : cust_l1cprod)
154  {
155  std::cout << item << std::endl;
156  }
157  // cout<<"so far so good"<<endl;
158 }
159 
160 
161 } // close namespace l1c
int j
Definition: decode_rs.h:73
#define READ
Definition: l1c.h:32
README for MOD_PR02AQUA(AQUA) Version to set to For disabling creating and output data sets when in night mode
Definition: README.txt:96
void printProducts()
int syear
Definition: l1_czcs_hdf.c:15
int32 nscan
Definition: l1_czcs_hdf.c:19
int sday
Definition: l1_czcs_hdf.c:15
Definition: l1c.cpp:76
int32_t nbands
@ FT_INVALID
Definition: filetype.h:12
int i
Definition: decode_rs.h:71
int32_t sensorID[MAXNFILES]
Definition: l2bin.cpp:97
int npix
Definition: get_cmp.c:27