57 static string FILE_ATTR_TABLE_NAME =
"HDF5_GLOBAL";
79 virtual const char *
what ()
const throw ()
94 template <
typename T,
typename U,
typename V,
typename W,
typename X >
static void
95 _throw5 (
const char *fname,
int line,
int numarg,
96 const T & a1,
const U & a2,
const V & a3,
const W & a4,
const X & a5)
99 ss << fname <<
":" << line <<
":";
100 for (
int i = 0; i < numarg; ++i) {
120 throw Exception (ss.str ());
126 #define throw1(a1) _throw5(__FILE__, __LINE__, 1, a1, 0, 0, 0, 0)
127 #define throw2(a1, a2) _throw5(__FILE__, __LINE__, 2, a1, a2, 0, 0, 0)
128 #define throw3(a1, a2, a3) _throw5(__FILE__, __LINE__, 3, a1, a2, a3, 0, 0)
129 #define throw4(a1, a2, a3, a4) _throw5(__FILE__, __LINE__, 4, a1, a2, a3, a4, 0)
130 #define throw5(a1, a2, a3, a4, a5) _throw5(__FILE__, __LINE__, 5, a1, a2, a3, a4, a5)
216 return (this->
value).size();
339 return this->cvartype;
373 return this->numofdbits;
395 return this->product_type;
412 return this->eos_type;
415 return this->point_lower;
418 return this->point_upper;
422 return this->point_left;
425 return this->point_right;
429 return this->eos5_pixelreg;
432 return this->eos5_origin;
436 return this->eos5_projcode;
440 return this->xdimsize;
444 return this->ydimsize;
518 hid_t file_id,
bool include_attr)
throw (
Exception);
597 void Retrieve_H5_VarType(
Var*,hid_t dset_id, const
string& varname,
bool &unsup_var_dtype) throw(Exception);
598 void Retrieve_H5_VarDim(Var*,hid_t dset_id,const
string &varname,
bool & unsup_var_dspace) throw(Exception);
621 File (const
char *path, hid_t file_id)
622 : path (
string(path)),
681 hid_t file_id,
bool include_attr)
throw (
Exception);
736 bool check_cv(
string & varname) throw(Exception);
781 vector <GMCVar *>cvars;
799 void Update_Dimnamelist();
809 vector <string> dimnames;
810 set <string> vardimnames;
811 map <string,hsize_t>dimnames_to_dimsizes;
812 map <hsize_t,string>dimsizes_to_dimnames;
816 map <string,string> dnames_to_1dvnames;
820 bool has_nodimnames_vars;
843 vector <string> dimnames;
844 set <string> vardimnames;
845 map <string,hsize_t>dimnames_to_dimsizes;
846 map <hsize_t,string>dimsizes_to_dimnames;
849 map <string,string> dnames_to_geo1dvnames;
866 vector <string> dimnames;
867 set <string> vardimnames;
868 map <string,hsize_t>dimnames_to_dimsizes;
869 map <hsize_t,string>dimsizes_to_dimnames;
872 map <string,string> dnames_to_1dvnames;
885 grids_multi_latloncvs(false),
899 hid_t file_id,
bool include_attr)
throw (
Exception);
911 void Adjust_EOS5Dim_Info(
HE5Parser*strmeta_info) throw(Exception);
914 void Add_EOS5File_Info(
HE5Parser*,
bool) throw(Exception);
917 void Adjust_Var_NewName_After_Parsing() throw(Exception);
926 void Check_Aura_Product_Status() throw(Exception);
939 void Adjust_Var_Dim_NewName_Before_Flattening() throw(Exception);
945 void Set_COARDS_Status() throw(Exception);
948 void Adjust_Attr_Info() throw(Exception);
969 void Adjust_EOS5Dim_List(vector<
HE5Dim>&) throw(Exception);
970 void Condense_EOS5Dim_List(vector<
HE5Dim>&) throw(Exception);
971 void Remove_NegativeSizeDims(vector<
HE5Dim>&) throw(Exception);
972 void Adjust_EOS5VarDim_Info(vector<
HE5Dim>&, vector<HE5Dim>&,const
string &,
EOS5Type) throw(Exception);
974 void EOS5Handle_nonlatlon_dimcvars(vector<
HE5Var> & eos5varlist,
EOS5Type,
string groupname, map<
string,
string>& dnamesgeo1dvnames) throw(Exception);
975 template <class T>
void EOS5SwathGrid_Set_LatLon_Flags(T* eos5gridswath, vector<
HE5Var>& eos5varlist) throw(Exception);
977 void Obtain_Var_NewName(
Var*) throw(Exception);
978 EOS5Type Get_Var_EOS5_Type(
Var*) throw(Exception);
980 bool Obtain_Var_Dims(
Var*,HE5Parser*) throw(Exception);
981 template <class T>
bool Set_Var_Dims(T*, Var*,vector<
HE5Var>&, const
string&,
int,EOS5Type) throw(Exception);
982 template<class T>
void Create_Unique_DimName(T*,set<
string>&,
Dimension *,
int , EOS5Type ) throw(Exception);
984 template <class T>
bool Check_All_DimNames(T*,
string &, hsize_t);
985 string Obtain_Var_EOS5Type_GroupName(Var*,EOS5Type ) throw(Exception);
986 int Check_EOS5Swath_FieldType(Var*) throw(Exception);
987 void Get_Unique_Name(set<
string>&,
string& ) throw(Exception);
989 template<class T>
string Create_Unique_FakeDimName(T*, EOS5Type) throw(Exception);
990 template<class T>
void Set_NonParse_Var_Dims(T*, Var*, map<hsize_t,
string>& ,
int,EOS5Type )throw(Exception);
992 void Handle_Grid_CVar(
bool) throw(Exception);
993 void Handle_Augmented_Grid_CVar() throw(Exception);
994 template <class T>
void Handle_Single_Augment_CVar(T*,EOS5Type) throw(Exception);
996 void Handle_Multi_Nonaugment_Grid_CVar() throw(Exception);
997 void Handle_Single_Nonaugment_Grid_CVar(
EOS5CFGrid*) throw(Exception);
998 bool Handle_Single_Nonaugment_Grid_CVar_OwnLatLon(
EOS5CFGrid *, set<
string>& ) throw(Exception);
999 bool Handle_Single_Nonaugment_Grid_CVar_EOS5LatLon(EOS5CFGrid *, set<
string>& ) throw(Exception);
1000 void Handle_NonLatLon_Grid_CVar(EOS5CFGrid *, set<
string>& ) throw(Exception);
1001 void Remove_MultiDim_LatLon_EOS5CFGrid() throw(Exception);
1002 void Adjust_EOS5GridDimNames(EOS5CFGrid *) throw(Exception);
1004 void Handle_Swath_CVar(
bool) throw(Exception);
1005 void Handle_Single_1DLatLon_Swath_CVar(
EOS5CFSwath *cfswath,
bool is_augmented) throw(Exception);
1006 void Handle_Single_2DLatLon_Swath_CVar(
EOS5CFSwath *cfswath,
bool is_augmented) throw(Exception);
1007 void Handle_NonLatLon_Swath_CVar(
EOS5CFSwath *cfswath, set<
string>& tempvardimnamelist) throw(Exception);
1008 void Handle_Special_NonLatLon_Swath_CVar(
EOS5CFSwath *cfswath, set<
string>&tempvardimnamelist) throw(Exception);
1010 void Handle_Za_CVar(
bool) throw(Exception);
1012 bool Check_Augmentation_Status() throw(Exception);
1013 bool Check_Augmented_Var_Attrs(Var *var) throw(Exception);
1014 template<class T>
bool Check_Augmented_Var_Candidate(T* , Var*, EOS5Type ) throw(Exception);
1016 template <class T>
void Adjust_Per_Var_Dim_NewName_Before_Flattening(T*,
bool,
int,
int,
int) throw(Exception);
1017 void Adjust_SharedLatLon_Grid_Var_Dim_Name() throw(Exception);
1019 void Adjust_Attr_Name() throw(Exception);
1020 void Adjust_Attr_Value() throw(Exception);
1021 void Handle_EOS5CVar_Unit_Attr()throw(Exception);
1022 void Handle_EOS5CVar_Special_Attr() throw(Exception);
1027 void Handle_EOS5CVar_NameClashing(set<
string> &) throw(Exception);
1028 void Handle_EOS5CVar_AttrNameClashing() throw(Exception);
1029 template <typename T>
void EOS5Handle_General_NameClashing(set <
string>&objnameset, vector<T*>& objvec) throw(Exception);
1030 void Adjust_CF_attr() throw(Exception);
1032 void Create_Added_Var_NewName_FullPath(EOS5Type, const
string& , const
string& ,
string &,
string &) throw(Exception);
1036 vector <EOS5CVar *>cvars;
1037 vector <EOS5CFGrid *>eos5cfgrids;
1040 map <
string,
string>eos5_to_cf_attr_map;
1043 bool grids_multi_latloncvs;
1046 multimap<
string,
string>dimname_to_dupdimnamelist;
void Adjust_H5_Attr_Value(Attribute *attr)
Adjust attribute values for general HDF5 products.
void Flatten_Obj_Name(bool include_attr)
Flatten the object name for general NASA HDF5 products.
void Retrieve_H5_Attr_Value(Attribute *attr, string)
void Handle_GMSPVar_AttrNameClashing()
vector< Dimension * > dims
void Handle_SpVar()
Handle special variables for general NASA HDF5 products.
void Create_Missing_CV(GMCVar *, const string &)
const string & getFullPath() const
Get the full path of this variable.
const vector< GMCVar * > & getCVars() const
This class represents one HDF5 dataset(CF variable)
void Handle_Coor_Attr()
Handle "coordinates" attributes for general HDF5 products.
void Handle_CVar()
Handle coordinate variables for general NASA HDF5 products.
int getRank() const
Get the dimension rank of this variable.
void Adjust_GPM_L3_Obj_Name()
const string & getName() const
Get the original name of this variable.
void Handle_DimNameClashing()
Handle dimension name clashing. Since COARDS requires the change of cv names, So we need to handle di...
void Handle_GPM_l1_Coor_Attr()
virtual void Replace_Var_Info(Var *src, Var *target)
void Add_Dim_Name()
Add dimension name.
const string & getName() const
void Handle_GeneralObj_NameClashing(bool, set< string > &objnameset)
void Add_Dim_Name_Dimscale_General_Product()
void Add_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(Var *, Attribute *)
virtual void Handle_DimNameClashing()=0
Handle dimension name clashing. Since COARDS requires the change of cv names, So we need to handle di...
bool check_cv(string &varname)
virtual void Retrieve_H5_Info(const char *path, hid_t file_id, bool include_attr)
Retrieve DDS information from the HDF5 file. The reason to separate reading DDS from DAS is: DAP need...
void Handle_RootGroup_NameClashing(set< string > &objnameset)
void Handle_CVar_Dimscale_General_Product()
const string & getNewName() const
const string & getPath() const
Get the original path of this group.
void Handle_Obj_NameClashing(bool)
Handle object name clashing for general NASA HDF5 products.
void GMHandle_General_NameClashing(set< string > &objnameset, vector< T * > &objvec)
This class is a derived class of Var. It represents a special general HDF5 product(currently ACOS) ...
void Add_Dim_Name_ACOS_L2S()
void Handle_CVar_Aqu_L3()
This class simulates an HDF-EOS5 Swath.
void Add_One_FakeDim_Name(Dimension *dim)
This class is a derived class of CVar. It represents a coordinate variable for general HDF5 files...
EOS5Type getEos5Type() const
virtual void Adjust_Obj_Name()=0
Adjust object names based on different products.
virtual void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes.
const std::vector< char > & getValue() const
const vector< Attribute * > & getAttributes() const
Public interface to obtain information of all attributes under the root group.
set< string > dimnamelist
const vector< Attribute * > & getAttributes() const
virtual void Adjust_Dim_Name()=0
Adjust dimension names based on different products.
void Handle_SpVar_Attr()
Handle special variable attributes for general NASA HDF5 products.
void Retrieve_H5_VarType(Var *, hid_t dset_id, const string &varname, bool &unsup_var_dtype)
map< hsize_t, string > dimsize_to_fakedimname
Handle added dimension names.
const std::vector< size_t > & getStrSize() const
This file includes functions to identify different NASA HDF5 products. Current supported products inc...
void Add_Dim_Name_Mea_SeaWiFS()
virtual void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes.
void Handle_CVar_OBPG_L3()
const string & getNewName() const
Get the new name of this group(flattened,name clashed checked)
virtual void Add_Supplement_Attrs(bool)
Add supplemental attributes such as fullpath and original name.
This class retrieves all information from an HDF5 file.
vector< Var * > vars
Var vectors.
virtual string get_CF_string(string)
H5DataType getOriginalType() const
void Add_Str_Attr(Attribute *attr, const string &attrname, const string &strvalue)
virtual void setException(string message)
bool unsupported_attr_dtype
void Adjust_Duplicate_FakeDim_Name(Dimension *dim)
const string & getNewName() const
This class is a derived class of CVar. It represents a coordinate variable for HDF-EOS5 files...
float getPointRight() const
virtual void Handle_Unsupported_Dspace()
Handle unsupported HDF5 dataspaces for datasets.
H5DataType getType() const
Get the data type of this variable(Not HDF5 datatype id)
This class is a derived class of File. It includes methods applied to general HDF5 files only...
EOS5GridOriginType getOrigin() const
const vector< GMSPVar * > & getSPVars() const
EOS5GridPCType getProjCode() const
void Adjust_Mea_Ozone_Obj_Name()
void Handle_CVar_GPM_L3()
void Handle_CVar_GPM_L1()
const vector< Attribute * > & getAttributes() const
void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes for general HDF5 products.
const string & getName() const
void Adjust_Dim_Name()
Adjust dimension name for general NASA HDF5 products.
void Change_Attr_One_Str_to_Others(Attribute *attr, Var *var)
void Add_Dim_Name_Aqu_L3()
void Retrieve_H5_Attr_Info(Attribute *, hid_t obj_id, const int j, bool &unsup_attr_dtype)
EOS5GridPRType
This file defines a few enum types used by HDF-EOS5 products.
Exception(const string &msg)
Constructor.
float getPointLeft() const
void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes for general HDF5 products.
CVType getCVType() const
Get the coordinate variable type of this variable.
const hid_t getFileID() const
Obtain the HDF5 file ID.
H5GCFProduct getPtType() const
Get the data type of this variable.
const string & getNewName() const
Get the new name of this variable.
void Handle_Obj_AttrNameClashing()
Dimension(hsize_t dimsize)
const string & getPath() const
Obtain the path of the file.
virtual void Handle_Coor_Attr()=0
Handle "coordinates" attributes.
void Handle_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(Var *)
GMFile(const char *path, hid_t file_id, H5GCFProduct product, GMPattern gproduct_pattern)
bool unsupported_var_dtype
This class is a derived class of File. It includes methods applied to HDF-EOS5 files only...
virtual void Handle_SpVar()=0
Handle special variables.
void Add_Dim_Name_Mea_Ozonel3z()
const vector< Dimension * > & getDimensions() const
Get the list of the dimensions.
map< string, hsize_t > dimname_to_dimsize
const vector< EOS5CVar * > & getCVars() const
Obtain coordinate variables for HDF-EOS5 products.
EOS5GridPRType getPixelReg() const
virtual void Replace_Var_Attrs(Var *src, Var *target)
void Retrieve_H5_VarDim(Var *, hid_t dset_id, const string &varname, bool &unsup_var_dspace)
vector< Attribute * > attrs
H5DataType getType() const
This class simulates an HDF-EOS5 Zonal average object.
A class for parsing NASA HDF-EOS5 StructMetadata.
This class represents one attribute.
void Handle_Unsupported_Dspace()
Handle unsupported HDF5 dataspaces for general HDF5 products.
Helper functions for generating DAS attributes and a function to check BES Key.
void Insert_One_NameSizeMap_Element2(map< string, hsize_t > &, string name, hsize_t size)
bool Is_netCDF_Dimension(Var *var)
void Check_General_Product_Pattern()
virtual void Handle_SpVar_Attr()=0
Handle special variable attributes.
This class simulates an HDF-EOS5 Grid. Currently only geographic projection is supported.
This file includes several helper functions for translating HDF5 to CF-compliant. ...
void Add_One_Float_Attr(Attribute *attr, const string &attrname, float float_value)
void Retrieve_H5_Obj(hid_t grp_id, const char *gname, bool include_attr)
void Handle_CVar_Mea_Ozone()
const vector< Var * > & getVars() const
Public interface to obtain information of all variables.
bool unsupported_attr_dtype
virtual const char * what() const
void Handle_GMCVar_NameClashing(set< string > &)
void Handle_GMSPVar_NameClashing(set< string > &)
const vector< Group * > & getGroups() const
Public interface to obtain all the group info.
void Handle_UseDimscale_Var_Dim_Names_General_Product(Var *)
virtual void Handle_CVar()=0
Handle coordinate variables.
bool unsupported_attr_dtype
float getPointLower() const
void Adjust_Obj_Name()
Adjust object names based on different general NASA HDF5 products.
This class repersents one dimension of an HDF5 dataset(variable).
void Handle_CVar_Mea_SeaWiFS()
This class is a derived class of Var. It represents a coordinate variable.
void Add_Dim_Name_General_Product()
void Handle_Var_NameClashing(set< string > &objnameset)
void Insert_One_NameSizeMap_Element(string name, hsize_t size)
void Handle_GMCVar_AttrNameClashing()
bool unsupported_var_dspace
string get_CF_string(string s)
H5GCFProduct getProductType() const
void Add_UseDimscale_Var_Dim_Names_General_Product(Var *, Attribute *)
virtual void Flatten_Obj_Name(bool)
Flatten the object name.
void Add_Supplement_Attrs(bool)
Add supplemental attributes such as fullpath and original name for general NASA HDF5 products...
This class represents an HDF5 group. The group will be flattened according to the CF conventions...
size_t getBufSize() const
vector< Attribute * > attrs
vector< Group * > groups
Non-root group vectors.
EOS5File(const char *path, hid_t file_id)
void Handle_General_NameClashing(set< string > &objnameset, vector< T * > &objvec)
void Retrieve_H5_Info(const char *path, hid_t file_id, bool include_attr)
Retrieve DDS information from the HDF5 file; real implementation for general HDF5 products...
float getPointUpper() const
vector< Attribute * > root_attrs
Root attribute vectors.
void Add_Dim_Name_OBPG_L3()