OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
L3FileSMI.h
Go to the documentation of this file.
1 #ifndef L3FileSMI_h
2 #define L3FileSMI_h
3 
4 #include <netcdf>
5 #include <L3File.h>
6 #include <vector>
7 
8 namespace l3 {
9 
13 class L3FileSMI : public L3File {
14 protected:
15  std::vector<std::string> prodNameList;
16  netCDF::NcFile *ncFile;
18  std::vector<netCDF::NcVar> prodVarList;
19 
20  virtual int initRecordLookup();
21 
22  virtual L3Row* readRow(int32_t row);
23 
24 public:
25  L3FileSMI();
26  virtual ~L3FileSMI();
27 
28  template<typename TheType>
29  bool readAttribute(std::string name, TheType &val) {
30  if (ncFile == NULL || ncFile->isNull()) {
31  return false;
32  }
33  std::multimap<std::string, netCDF::NcGroupAtt> attributeList = ncFile->getAtts();
34  std::multimap<std::string, netCDF::NcGroupAtt>::iterator myIter;
35  myIter = attributeList.find(name);
36  if (myIter == attributeList.end())
37  return false;
38  myIter->second.getValues(val);
39  return true;
40  }
41 
42  template<typename TheType>
43  bool readAttribute(const netCDF::NcGroup &group,
44  std::string name, TheType &val) {
45  if (group.isNull()) {
46  return false;
47  }
48  std::multimap<std::string, netCDF::NcGroupAtt> attributeList = ncFile->getAtts();
49  std::multimap<std::string, netCDF::NcGroupAtt>::iterator myIter;
50  myIter = attributeList.find(name);
51  if (myIter == attributeList.end())
52  return false;
53  myIter->second.getValues(val);
54  return true;
55  }
56 
57  template<typename TheType>
58  bool readAttribute(const netCDF::NcVar &var,
59  std::string name, TheType &val) {
60  if (var.isNull()) {
61  return false;
62  }
63  std::map<std::string, netCDF::NcVarAtt> attributeList = var.getAtts();
64  std::map<std::string, netCDF::NcVarAtt>::iterator myIter;
65  myIter = attributeList.find(name);
66  if (myIter == attributeList.end())
67  return false;
68  myIter->second.getValues(val);
69  return true;
70  }
71 
72  template<typename TheType>
73  bool readAttribute(const netCDF::NcVar &var,
74  std::string name, TheType *val) {
75  if (var.isNull()) {
76  return false;
77  }
78  std::map<std::string, netCDF::NcVarAtt> attributeList = var.getAtts();
79  std::map<std::string, netCDF::NcVarAtt>::iterator myIter;
80  myIter = attributeList.find(name);
81  if (myIter == attributeList.end())
82  return false;
83  myIter->second.getValues(val);
84  return true;
85  }
86 
87  virtual bool readVarCF(netCDF::NcVar &var, const std::vector<size_t> &start,
88  const std::vector<size_t> &count, float* data);
89 
90  virtual bool open(const char* fileName);
91  virtual void close();
92  virtual meta_l3bType* getMetaData();
93  virtual int32_t getNumProducts();
94  virtual std::string getProductName(size_t index = 0);
95  virtual bool setActiveProductList(const char* prodStr);
96  virtual bool hasQuality();
97 
98 };
99 
100 } // namespace l3
101 
102 #endif
bool readAttribute(std::string name, TheType &val)
Definition: L3FileSMI.h:29
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
virtual bool setActiveProductList(const char *prodStr)
Definition: L3FileSMI.cpp:374
bool readAttribute(const netCDF::NcGroup &group, std::string name, TheType &val)
Definition: L3FileSMI.h:43
virtual L3Row * readRow(int32_t row)
Definition: L3FileSMI.cpp:407
#define NULL
Definition: decode_rs.h:63
std::vector< netCDF::NcVar > prodVarList
Definition: L3FileSMI.h:18
bool readAttribute(const netCDF::NcVar &var, std::string name, TheType *val)
Definition: L3FileSMI.h:73
@ string
virtual bool hasQuality()
Definition: L3FileSMI.cpp:462
virtual void close()
Definition: L3FileSMI.cpp:316
virtual bool open(const char *fileName)
Definition: L3FileSMI.cpp:238
virtual meta_l3bType * getMetaData()
Definition: L3FileSMI.cpp:328
virtual bool readVarCF(netCDF::NcVar &var, const std::vector< size_t > &start, const std::vector< size_t > &count, float *data)
Definition: L3FileSMI.cpp:29
std::vector< std::string > prodNameList
array of all product names in file
Definition: L3FileSMI.h:15
bool readAttribute(const netCDF::NcVar &var, std::string name, TheType &val)
Definition: L3FileSMI.h:58
virtual ~L3FileSMI()
Definition: L3FileSMI.cpp:25
virtual std::string getProductName(size_t index=0)
Definition: L3FileSMI.cpp:370
virtual int32_t getNumProducts()
Definition: L3FileSMI.cpp:366
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude data
Definition: HISTORY.txt:356
meta_l3bType metaData
Definition: L3FileSMI.h:17
netCDF::NcFile * ncFile
Definition: L3FileSMI.h:16
virtual int initRecordLookup()
Definition: L3FileSMI.cpp:336
Definition: L3File.cpp:10
msiBandIdx val
Definition: l1c_msi.cpp:34
int count
Definition: decode_rs.h:79