bes  Updated for version 3.20.6
HDF5CF::File Class Referenceabstract

This class retrieves all information from an HDF5 file. More...

#include <HDF5CF.h>

Collaboration diagram for HDF5CF::File:
Collaboration graph

Public Member Functions

virtual void Add_Supplement_Attrs (bool)
 Add supplemental attributes such as fullpath and original name. More...
 
virtual void Adjust_Dim_Name ()=0
 Adjust dimension names based on different products. More...
 
virtual void Adjust_Obj_Name ()=0
 Adjust object names based on different products. More...
 
virtual void Flatten_Obj_Name (bool)
 Flatten the object name. More...
 
virtual const std::string & Get_Ignored_Msg ()=0
 Obtain the message that contains the ignored object info. More...
 
virtual bool Get_IgnoredInfo_Flag ()=0
 Obtain the flag to see if ignored objects should be generated. More...
 
const std::vector< Attribute * > & getAttributes () const
 Public interface to obtain information of all attributes under the root group. More...
 
hid_t getFileID () const
 Obtain the HDF5 file ID. More...
 
const std::vector< Group * > & getGroups () const
 Public interface to obtain all the group info. More...
 
const std::string & getPath () const
 Obtain the path of the file. More...
 
const std::vector< Var * > & getVars () const
 Public interface to obtain information of all variables. More...
 
virtual void Handle_Coor_Attr ()=0
 Handle "coordinates" attributes. More...
 
virtual void Handle_CVar ()=0
 Handle coordinate variables. More...
 
virtual void Handle_DimNameClashing ()=0
 
template<class T >
void Handle_General_NameClashing (set< string > &objnameset, vector< T * > &objvec)
 
virtual void Handle_Grid_Mapping_Vars ()
 Handle Grid Mapping Vars. More...
 
virtual void Handle_SpVar ()=0
 Handle special variables. More...
 
virtual void Handle_SpVar_Attr ()=0
 Handle special variable attributes. More...
 
virtual void Handle_Unsupported_Dspace (bool)
 Handle unsupported HDF5 dataspaces for datasets. More...
 
virtual void Handle_Unsupported_Dtype (bool)
 Handle unsupported HDF5 datatypes. More...
 
virtual void Handle_Unsupported_Others (bool)
 Handle other unmapped objects/attributes. More...
 
virtual bool Have_Grid_Mapping_Attrs ()
 Check if having Grid Mapping Attrs. More...
 
bool HaveUnlimitedDim () const
 Has unlimited dimensions. More...
 
virtual void Retrieve_H5_CVar_Supported_Attr_Values ()=0
 Retrieve coordinate variable attributes. More...
 
virtual void Retrieve_H5_Info (const char *path, hid_t file_id, bool)
 
virtual void Retrieve_H5_Supported_Attr_Values ()
 Retrieve attribute values for the supported HDF5 datatypes. More...
 
virtual void Retrieve_H5_Var_Attr_Values (Var *var)
 Retrieve attribute values for a variable. More...
 

Protected Member Functions

void add_ignored_droplongstr_hdr ()
 
void add_ignored_grp_longstr_info (const std::string &grp_path, const std::string &attr_name)
 
void add_ignored_info_attrs (bool is_grp, const std::string &obj_path, const std::string &attr_name)
 
void add_ignored_info_links (const std::string &link_name)
 
void add_ignored_info_links_header ()
 
void add_ignored_info_namedtypes (const std::string &, const std::string &)
 
void add_ignored_info_obj_header ()
 
void add_ignored_info_objs (bool is_dim_related, const std::string &obj_path)
 
void add_ignored_info_page_header ()
 
void add_ignored_var_longstr_info (Var *var, Attribute *attr)
 
void add_no_ignored_info ()
 
void Add_One_FakeDim_Name (Dimension *dim)
 
void Add_One_Float_Attr (Attribute *attr, const std::string &attrname, float float_value)
 
void Add_Str_Attr (Attribute *attr, const std::string &attrname, const std::string &strvalue)
 
void Adjust_Duplicate_FakeDim_Name (Dimension *dim)
 
void Change_Attr_One_Str_to_Others (Attribute *attr, Var *var)
 
bool Check_DropLongStr (Var *var, Attribute *attr)
 
std::string Check_Grid_Mapping_FullPath (const std::string &attr_value)
 
std::string Check_Grid_Mapping_VarName (const std::string &attr_value, const std::string &var_full_path)
 
bool Check_VarDropLongStr (const std::string &varpath, const std::vector< Dimension * > &, H5DataType)
 
 File (const char *h5_path, hid_t file_id)
 
void Gen_DimScale_VarAttr_Unsupported_Dtype_Info ()
 
void Gen_Group_Unsupported_Dtype_Info ()
 
virtual void Gen_Unsupported_Dspace_Info ()
 
virtual void Gen_Unsupported_Dtype_Info (bool)=0
 
void Gen_Var_Unsupported_Dtype_Info ()
 
virtual void Gen_VarAttr_Unsupported_Dtype_Info ()
 
virtual std::string get_CF_string (std::string)
 
template<typename T >
void Handle_General_NameClashing (std::set< std::string > &objnameset, std::vector< T * > &objvec)
 
void Handle_GeneralObj_NameClashing (bool, std::set< std::string > &objnameset)
 
void Handle_Group_NameClashing (std::set< std::string > &objnameset)
 
void Handle_Group_Unsupported_Dtype ()
 
void Handle_GroupAttr_Unsupported_Dspace ()
 
void Handle_Obj_AttrNameClashing ()
 
void Handle_Var_NameClashing (std::set< std::string > &objnameset)
 
void Handle_Var_Unsupported_Dtype ()
 
void Handle_VarAttr_Unsupported_Dspace ()
 
void Handle_VarAttr_Unsupported_Dtype ()
 
bool has_latlon_cf_units (Attribute *attr, const std::string &varfullpath, bool is_lat)
 
bool ignored_dimscale_ref_list (Var *var)
 
void Insert_One_NameSizeMap_Element (std::string name, hsize_t size, bool unlimited)
 
void Insert_One_NameSizeMap_Element2 (std::map< std::string, hsize_t > &, std::map< std::string, bool > &, std::string name, hsize_t size, bool unlimited)
 
bool Is_geolatlon (const std::string &var_name, bool is_lat)
 
bool Is_Str_Attr (Attribute *attr, std::string varfullpath, const std::string &attrname, const std::string &strvalue)
 
bool is_var_under_group (const std::string &varname, const std::string &grpname, const int var_rank, std::vector< size_t > &var_size)
 
void release_standalone_var_vector (std::vector< Var * > &vars)
 
void remove_netCDF_internal_attributes (bool include_attr)
 
virtual void Replace_Var_Attrs (Var *src, Var *target)
 
virtual void Replace_Var_Info (Var *src, Var *target)
 
void Replace_Var_Str_Attr (Var *var, const std::string &attr_name, const std::string &strvalue)
 
void Retrieve_H5_Attr_Info (Attribute *, hid_t obj_id, const int j, bool &unsup_attr_dtype, bool &unsup_attr_dspace)
 
void Retrieve_H5_Attr_Value (Attribute *attr, std::string)
 
void Retrieve_H5_Obj (hid_t grp_id, const char *gname, bool include_attr)
 
float Retrieve_H5_VarCompRatio (Var *, hid_t)
 
void Retrieve_H5_VarDim (Var *, hid_t dset_id, const std::string &varname, bool &unsup_var_dspace)
 
void Retrieve_H5_VarType (Var *, hid_t dset_id, const std::string &varname, bool &unsup_var_dtype)
 
std::string Retrieve_Str_Attr_Value (Attribute *attr, const std::string var_path)
 

Protected Attributes

int addeddimindex
 
bool check_ignored
 
std::map< std::string, hsize_t > dimname_to_dimsize
 
std::map< std::string, bool > dimname_to_unlimited
 
std::set< std::string > dimnamelist
 
std::map< hsize_t, std::string > dimsize_to_fakedimname
 Handle added dimension names. More...
 
hid_t fileid
 
std::vector< Group * > groups
 Non-root group vectors. More...
 
bool have_ignored
 
bool have_udim
 
std::string ignored_msg
 
std::string path
 
std::vector< Attribute * > root_attrs
 Root attribute vectors. More...
 
hid_t rootid
 
bool unsupported_attr_dspace
 
bool unsupported_attr_dtype
 
bool unsupported_var_attr_dspace
 
bool unsupported_var_dspace
 
bool unsupported_var_dtype
 
std::vector< Var * > vars
 Var vectors. More...
 

Detailed Description

This class retrieves all information from an HDF5 file.

Definition at line 581 of file HDF5CF.h.

Member Function Documentation

◆ Add_Supplement_Attrs()

void File::Add_Supplement_Attrs ( bool  add_path)
virtual

Add supplemental attributes such as fullpath and original name.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 1948 of file HDF5CF.cc.

◆ Adjust_Dim_Name()

virtual void HDF5CF::File::Adjust_Dim_Name ( )
pure virtual

Adjust dimension names based on different products.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Adjust_Obj_Name()

virtual void HDF5CF::File::Adjust_Obj_Name ( )
pure virtual

Adjust object names based on different products.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Flatten_Obj_Name()

void File::Flatten_Obj_Name ( bool  include_attr)
virtual

Flatten the object name.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 1350 of file HDF5CF.cc.

◆ Get_Ignored_Msg()

virtual const std::string& HDF5CF::File::Get_Ignored_Msg ( )
pure virtual

Obtain the message that contains the ignored object info.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Get_IgnoredInfo_Flag()

virtual bool HDF5CF::File::Get_IgnoredInfo_Flag ( )
pure virtual

Obtain the flag to see if ignored objects should be generated.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ getAttributes()

const std::vector<Attribute *>& HDF5CF::File::getAttributes ( ) const
inline

Public interface to obtain information of all attributes under the root group.

Definition at line 664 of file HDF5CF.h.

◆ getFileID()

hid_t HDF5CF::File::getFileID ( ) const
inline

Obtain the HDF5 file ID.

Definition at line 646 of file HDF5CF.h.

◆ getGroups()

const std::vector<Group *>& HDF5CF::File::getGroups ( ) const
inline

Public interface to obtain all the group info.

Definition at line 670 of file HDF5CF.h.

◆ getPath()

const std::string& HDF5CF::File::getPath ( ) const
inline

Obtain the path of the file.

Definition at line 652 of file HDF5CF.h.

◆ getVars()

const std::vector<Var *>& HDF5CF::File::getVars ( ) const
inline

Public interface to obtain information of all variables.

Definition at line 658 of file HDF5CF.h.

◆ Handle_Coor_Attr()

virtual void HDF5CF::File::Handle_Coor_Attr ( )
pure virtual

Handle "coordinates" attributes.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Handle_CVar()

virtual void HDF5CF::File::Handle_CVar ( )
pure virtual

Handle coordinate variables.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Handle_DimNameClashing()

virtual void HDF5CF::File::Handle_DimNameClashing ( )
pure virtual

Handle dimension name clashing. Since COARDS requires the change of cv names, So we need to handle dimension name clashing specially.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Handle_Grid_Mapping_Vars()

void File::Handle_Grid_Mapping_Vars ( )
virtual

Handle Grid Mapping Vars.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 2123 of file HDF5CF.cc.

◆ Handle_SpVar()

virtual void HDF5CF::File::Handle_SpVar ( )
pure virtual

Handle special variables.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Handle_SpVar_Attr()

virtual void HDF5CF::File::Handle_SpVar_Attr ( )
pure virtual

Handle special variable attributes.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Handle_Unsupported_Dspace()

void File::Handle_Unsupported_Dspace ( bool  include_attr)
virtual

Handle unsupported HDF5 dataspaces for datasets.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 1253 of file HDF5CF.cc.

◆ Handle_Unsupported_Dtype()

void File::Handle_Unsupported_Dtype ( bool  include_attr)
virtual

Handle unsupported HDF5 datatypes.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 910 of file HDF5CF.cc.

◆ Handle_Unsupported_Others()

void File::Handle_Unsupported_Others ( bool  include_attr)
virtual

Handle other unmapped objects/attributes.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 1300 of file HDF5CF.cc.

◆ Have_Grid_Mapping_Attrs()

bool File::Have_Grid_Mapping_Attrs ( )
virtual

Check if having Grid Mapping Attrs.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 2103 of file HDF5CF.cc.

◆ HaveUnlimitedDim()

bool HDF5CF::File::HaveUnlimitedDim ( ) const
inline

Has unlimited dimensions.

Definition at line 676 of file HDF5CF.h.

◆ Retrieve_H5_CVar_Supported_Attr_Values()

virtual void HDF5CF::File::Retrieve_H5_CVar_Supported_Attr_Values ( )
pure virtual

Retrieve coordinate variable attributes.

Implemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

◆ Retrieve_H5_Info()

void File::Retrieve_H5_Info ( const char *  path,
hid_t  file_id,
bool  include_attr 
)
virtual

Retrieve DDS information from the HDF5 file. The reason to separate reading DDS from DAS is: DAP needs to hold all values of attributes in the memory, building DDS doesn't need the attributes. So to reduce huge memory allocation for some HDF5 files, we separate the access of DAS from DDS although internally they still share common routines.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 168 of file HDF5CF.cc.

◆ Retrieve_H5_Supported_Attr_Values()

void File::Retrieve_H5_Supported_Attr_Values ( )
virtual

Retrieve attribute values for the supported HDF5 datatypes.

Reimplemented in HDF5CF::EOS5File, and HDF5CF::GMFile.

Definition at line 722 of file HDF5CF.cc.

◆ Retrieve_H5_Var_Attr_Values()

void File::Retrieve_H5_Var_Attr_Values ( Var var)
virtual

Retrieve attribute values for a variable.

Definition at line 741 of file HDF5CF.cc.

Member Data Documentation

◆ dimsize_to_fakedimname

std::map<hsize_t, std::string> HDF5CF::File::dimsize_to_fakedimname
protected

Handle added dimension names.

Definition at line 810 of file HDF5CF.h.

◆ groups

std::vector<Group*> HDF5CF::File::groups
protected

Non-root group vectors.

Definition at line 793 of file HDF5CF.h.

◆ root_attrs

std::vector<Attribute *> HDF5CF::File::root_attrs
protected

Root attribute vectors.

Definition at line 790 of file HDF5CF.h.

◆ vars

std::vector<Var *> HDF5CF::File::vars
protected

Var vectors.

Definition at line 787 of file HDF5CF.h.


The documentation for this class was generated from the following files: