54    GRID, SWATH, ZA, OTHERVARS
 
   57    GENERAL_DIMSCALE, GENERAL_LATLON2D, GENERAL_LATLON1D, GENERAL_LATLON_COOR_ATTR, OTHERGMS
 
   60    OMI, MLS, HIRDLS, TES, NOTAURA
 
   62static std::string FILE_ATTR_TABLE_NAME = 
"HDF5_GLOBAL";
 
   77    ~ Exception() throw () override = default;
 
   79    const 
char *what() const throw ()
 override 
   81        return this->message.c_str();
 
   84    virtual void setException(
const std::string& except_message)
 
   86        this->message = except_message;
 
 
   92template<
typename T, 
typename U, 
typename V, 
typename W, 
typename X> 
static void _throw5(
const char *fname, 
int line,
 
   93    int numarg, 
const T & a1, 
const U & a2, 
const V & a3, 
const W & a4, 
const X & a5)
 
   95    std::ostringstream ss;
 
   96    ss << fname << 
":" << line << 
":";
 
   97    for (
int i = 0; i < numarg; ++i) {
 
  125#define throw1(a1)  _throw5(__FILE__, __LINE__, 1, a1, 0, 0, 0, 0) 
  126#define throw2(a1, a2)  _throw5(__FILE__, __LINE__, 2, a1, a2, 0, 0, 0) 
  127#define throw3(a1, a2, a3)  _throw5(__FILE__, __LINE__, 3, a1, a2, a3, 0, 0) 
  128#define throw4(a1, a2, a3, a4)  _throw5(__FILE__, __LINE__, 4, a1, a2, a3, a4, 0) 
  129#define throw5(a1, a2, a3, a4, a5)  _throw5(__FILE__, __LINE__, 5, a1, a2, a3, a4, a5) 
  132    template<
typename T> 
void operator ()(T * ptr)
 
 
  144    hsize_t getSize()
 const 
  148    const std::string & getName()
 const 
  152    const std::string & getNewName()
 const 
  154        return this->newname;
 
  160        return unlimited_dim;
 
 
  170    std::string name =
"";
 
  171    std::string newname = 
"";
 
  172    bool unlimited_dim = 
false;
 
  174    friend class EOS5File;
 
  180    friend class EOS5CVar;
 
  181    friend class GMSPVar;
 
 
  188    Attribute() = 
default;
 
  190    ~Attribute() = 
default;
 
  192    const std::string & getName()
 const 
  197    const std::string & getNewName()
 const 
  199        return this->newname;
 
  202    H5DataType getType()
 const 
  207    hsize_t getCount()
 const 
  212    size_t getBufSize()
 const 
  214        return (this->value).size();
 
  217    const std::vector<char>&getValue()
 const 
  222    const std::vector<size_t>&getStrSize()
 const 
  224        return this->strsize;
 
  227    bool getCsetType()
 const {
 
  228        return this->is_cset_ascii;
 
  234    H5DataType dtype = H5UNSUPTYPE;
 
  236    std::vector<size_t> strsize;
 
  238    std::vector<char> value;
 
  239    bool is_cset_ascii = 
true;
 
  243    friend class EOS5File;
 
  247    friend class GMSPVar;
 
  248    friend class EOS5CVar;
 
 
  255    explicit Var(
const Var*var);
 
  268        return this->newname;
 
 
  274        return this->fullpath;
 
 
  277    size_t getTotalElems()
 const 
  279        return this->total_elems;
 
  283    bool getZeroStorageSize()
 const 
  285        return this->zero_storage_size;
 
  288    bool getCoorAttrAddPath()
 const 
  290        return this->coord_attr_add_path;
 
  305    const std::vector<Attribute *>&getAttributes()
 const 
  319        return this->comp_ratio;
 
 
  326    std::string fullpath;
 
  327    H5DataType dtype = H5UNSUPTYPE;
 
  329    float comp_ratio = 1.0;
 
  330    size_t total_elems = 0;
 
  331    bool zero_storage_size = 
false;
 
  332    bool unsupported_attr_dtype = 
false;
 
  333    bool unsupported_attr_dspace = 
false;
 
  334    bool unsupported_dspace = 
false;
 
  335    bool dimnameflag = 
false;
 
  336    bool coord_attr_add_path = 
true;
 
  338    std::vector<Attribute *> attrs;
 
  339    std::vector<Dimension *> dims;
 
 
  351class CVar: 
public Var {
 
  355    ~CVar() 
override = 
default;
 
  360        return this->cvartype;
 
 
  363    bool isLatLon() 
const;
 
  369    std::string cfdimname;
 
  370    CVType cvartype = CV_UNSUPPORTED;
 
 
  378class GMSPVar: 
public Var {
 
  381    explicit GMSPVar(
const Var *var);
 
  382    ~GMSPVar() 
override = 
default;
 
  384    H5DataType getOriginalType()
 const 
  389    int getStartBit()
 const 
  394    int getBitNum()
 const 
  396        return this->numofdbits;
 
  400    H5DataType otype = H5UNSUPTYPE;
 
 
  409class GMCVar: 
public CVar {
 
  412    explicit GMCVar(
const Var*var);
 
  413    ~GMCVar() 
override = 
default;
 
  418        return this->product_type;
 
 
  422    H5GCFProduct product_type = General_Product;
 
 
  427class EOS5CVar: 
public CVar {
 
  431        std::fill_n(param, 13, 0);
 
  434    explicit EOS5CVar(
const Var *);
 
  436    ~EOS5CVar() 
override = 
default;
 
  438    EOS5Type getEos5Type()
 const 
  440        return this->eos_type;
 
  442    float getPointLower()
 const 
  444        return this->point_lower;
 
  446    float getPointUpper()
 const 
  448        return this->point_upper;
 
  451    float getPointLeft()
 const 
  453        return this->point_left;
 
  455    float getPointRight()
 const 
  457        return this->point_right;
 
  460    EOS5GridPRType getPixelReg()
 const 
  462        return this->eos5_pixelreg;
 
  464    EOS5GridOriginType getOrigin()
 const 
  466        return this->eos5_origin;
 
  469    EOS5GridPCType getProjCode()
 const 
  471        return this->eos5_projcode;
 
  474    int getXDimSize()
 const 
  476        return this->xdimsize;
 
  479    int getYDimSize()
 const 
  481        return this->ydimsize;
 
  484    std::vector<double> getParams()
 const 
  486        std::vector<double> ret_params;
 
  487        for (
const auto ¶m_ele:param)
 
  488            ret_params.push_back(param_ele);
 
  497    int getSphere()
 const 
  503    EOS5Type eos_type = OTHERVARS;
 
  504    bool is_2dlatlon = 
false;
 
  505    float point_lower = 0.0;
 
  506    float point_upper = 0.0;
 
  507    float point_left = 0.0;
 
  508    float point_right = 0.0;
 
  511    EOS5GridPRType eos5_pixelreg = HE5_HDFE_CENTER; 
 
  512    EOS5GridOriginType eos5_origin = HE5_HDFE_GD_UL; 
 
  513    EOS5GridPCType eos5_projcode = HE5_GCTP_GEO; 
 
  517    friend class EOS5File;
 
 
  536        return this->newname;
 
 
  539    const std::vector<Attribute *>&getAttributes()
 const 
  549    std::vector<Attribute *> attrs;
 
  550    bool unsupported_attr_dtype = 
false;
 
  551    bool unsupported_attr_dspace = 
false;
 
  555    friend class EOS5File;
 
 
  662    void setDap4(
bool is_dap4)  
 
  671    bool getIsCOARD()
 const  
  688    void Retrieve_H5_Obj(hid_t grp_id, 
const char*gname, 
bool include_attr);
 
  689    void Retrieve_H5_Attr_Info(
Attribute *, hid_t obj_id, 
const int j, 
bool& unsup_attr_dtype, 
bool & unsup_attr_dspace) 
const;
 
  691    void Retrieve_H5_Attr_Value(
Attribute *attr, 
const std::string &) 
const;
 
  693    void Retrieve_H5_VarType(
Var*, hid_t dset_id, 
const std::string& varname, 
bool &unsup_var_dtype) 
const; 
 
  694    void Retrieve_H5_VarDim(
Var*, hid_t dset_id, 
const std::string &varname, 
bool & unsup_var_dspace);
 
  696    float Retrieve_H5_VarCompRatio(
const Var*, 
const hid_t) 
const;
 
  698    void Handle_Group_Unsupported_Dtype() ;
 
  699    void Handle_Var_Unsupported_Dtype() ;
 
  700    void Handle_VarAttr_Unsupported_Dtype() ;
 
  702    void Handle_GroupAttr_Unsupported_Dspace() ;
 
  703    void Handle_VarAttr_Unsupported_Dspace() ;
 
  705    void Gen_Group_Unsupported_Dtype_Info() ;
 
  706    void Gen_Var_Unsupported_Dtype_Info() ;
 
  707    virtual void Gen_VarAttr_Unsupported_Dtype_Info() ;
 
  709    void Handle_GeneralObj_NameClashing(
bool, std::set<std::string> &objnameset) ;
 
  710    void Handle_Var_NameClashing(std::set<std::string> &objnameset) ;
 
  711    void Handle_Group_NameClashing(std::set<std::string> &objnameset) ;
 
  712    void Handle_Obj_AttrNameClashing() ;
 
  713    template<
typename T> 
void Handle_General_NameClashing(std::set<std::string>&objnameset, std::vector<T*>& objvec) ;
 
  715    void Add_One_FakeDim_Name(
Dimension *dim) ;
 
  716    void Adjust_Duplicate_FakeDim_Name(
Dimension * dim) ;
 
  717    void Adjust_Duplicate_FakeDim_Name2(
Dimension * dim,
int dup_dim_size_index) ;
 
  718    void Insert_One_NameSizeMap_Element(
const std::string & name, hsize_t size, 
bool unlimited) ;
 
  719    void Insert_One_NameSizeMap_Element2(std::map<std::string, hsize_t> &, std::map<std::string, bool>&, 
const std::string &name, hsize_t size,
 
  720        bool unlimited) 
const;
 
  722    virtual std::string get_CF_string(std::string);
 
  723    void Replace_Var_Info(
const Var* src, 
Var *target);
 
  724    void Replace_Var_Attrs(
const Var *src, 
Var*target);
 
  726    void Add_Str_Attr(
Attribute* attr, 
const std::string &attrname, 
const std::string& strvalue) 
const;
 
  727    std::string Retrieve_Str_Attr_Value(
Attribute *attr, 
const std::string& var_path) 
const;
 
  728    bool Is_Str_Attr(
Attribute* attr, 
const std::string & varfullpath, 
const std::string &attrname, 
const std::string& strvalue);
 
  729    void Add_One_Float_Attr(
Attribute* attr, 
const std::string &attrname, 
float float_value) 
const;
 
  730    void Replace_Var_Str_Attr(
Var* var, 
const std::string &attr_name, 
const std::string& strvalue);
 
  731    void Change_Attr_One_Str_to_Others(
Attribute *attr, 
const Var *var) 
const;
 
  734    bool Is_geolatlon(
const std::string &var_name, 
bool is_lat) 
const;
 
  735    bool has_latlon_cf_units(
Attribute*attr, 
const std::string &varfullpath, 
bool is_lat);
 
  740    bool is_var_under_group(
const std::string &varname, 
const std::string &grpname, 
const int var_rank, std::vector<size_t> &var_size) 
const;
 
  743    void remove_netCDF_internal_attributes(
bool include_attr);
 
  745    virtual void Gen_Unsupported_Dtype_Info(
bool) = 0;
 
  746    virtual void Gen_Unsupported_Dspace_Info() ;
 
  747    void Gen_DimScale_VarAttr_Unsupported_Dtype_Info() ;
 
  748    void add_ignored_info_page_header();
 
  749    void add_ignored_info_obj_header();
 
  754    void add_ignored_info_links_header();
 
  755    void add_ignored_info_links(
const std::string& link_name);
 
  756    void add_ignored_info_namedtypes(
const std::string&, 
const std::string&);
 
  757    void add_ignored_info_attrs(
bool is_grp, 
const std::string & obj_path, 
const std::string &attr_name);
 
  758    void add_ignored_info_objs(
bool is_dim_related, 
const std::string & obj_path);
 
  759    void add_no_ignored_info();
 
  760    bool ignored_dimscale_ref_list(
const Var *var) 
const;
 
  761    bool Check_DropLongStr(
const Var *var, 
const Attribute *attr) ;
 
  762    void add_ignored_var_longstr_info(
const Var*var, 
const Attribute *attr) ;
 
  763    void add_ignored_grp_longstr_info(
const std::string& grp_path, 
const std::string& attr_name);
 
  764    void add_ignored_droplongstr_hdr();
 
  765    bool Check_VarDropLongStr(
const std::string &varpath, 
const std::vector<Dimension *>&, H5DataType) 
const;
 
  767    void release_standalone_var_vector(std::vector<Var*>&
vars);
 
  770    std::string Check_Grid_Mapping_VarName(
const std::string& attr_value,
const std::string& var_full_path) 
const;
 
  771    std::string Check_Grid_Mapping_FullPath(
const std::string& attr_value) 
const;
 
  774    File(
const char *h5_path, hid_t file_id) :
 
  775        path(std::string(h5_path)), fileid(file_id)
 
  793    bool unsupported_var_dtype = 
false;
 
  794    bool unsupported_attr_dtype = 
false;
 
  796    bool unsupported_var_dspace = 
false;
 
  797    bool unsupported_attr_dspace = 
false;
 
  798    bool unsupported_var_attr_dspace = 
false;
 
  800    std::set<std::string> dimnamelist;
 
  802    std::map<std::string, hsize_t> dimname_to_dimsize;
 
  805    std::map<std::string, bool> dimname_to_unlimited;
 
  809    int addeddimindex = 0;
 
  810    std::vector<std::pair<hsize_t, std::string>>dup_dimsize_dimname;
 
  812    bool check_ignored = 
false;
 
  813    bool have_ignored = 
false;
 
  814    bool have_udim = 
false;
 
  815    bool _is_dap4 = 
false;
 
  816    bool iscoard = 
false;
 
  817    std::string ignored_msg;
 
 
  822class GMFile: 
public File {
 
  824    GMFile(
const char*path, hid_t file_id, H5GCFProduct product, GMPattern gproduct_pattern);
 
  827    H5GCFProduct getProductType()
 const 
  832    const std::vector<GMCVar *>&getCVars()
 const 
  837    const std::vector<GMSPVar *>&getSPVars()
 const 
  842    bool is_special_gpm_l3()
 const 
  844        return this->special_gpm_l3;
 
  848    void Retrieve_H5_Info(
const char *path, hid_t file_id, 
bool include_attr) 
override;
 
  910    bool Is_Hybrid_EOS5() 
const;
 
  911    void Handle_Hybrid_EOS5();
 
  937        return check_ignored;
 
 
  947    bool Check_And_Update_New_GPM_L3();
 
  948    void Remove_OMPSNPP_InputPointers();
 
  949    void Add_Dim_Name_GPM() ;
 
  950    void Add_Dim_Name_Mea_SeaWiFS() ;
 
  951    void Handle_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(
Var*) ;
 
  952    void Add_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(
const Var *, 
const Attribute*) ;
 
  954    void Add_Dim_Name_Mea_Ozonel3z() ;
 
  955    bool check_cv(
const std::string & varname) 
const;
 
  957    void Add_Dim_Name_Aqu_L3() 
const;
 
  958    void Add_Dim_Name_OBPG_L3() ;
 
  959    void Add_Dim_Name_OSMAPL2S() ;
 
  960    void Add_Dim_Name_ACOS_L2S_OCO2_L1B() ;
 
  962    void Add_Dim_Name_General_Product() ;
 
  963    void Check_General_Product_Pattern() ;
 
  964    bool Check_Dimscale_General_Product_Pattern() ;
 
  965    bool Check_LatLon2D_General_Product_Pattern() ;
 
  966    bool Check_LatLon2D_General_Product_Pattern_Name_Size(
const std::string& latname, 
const std::string& lonname)
 
  968    bool Check_LatLon1D_General_Product_Pattern() ;
 
  969    bool Check_LatLon1D_General_Product_Pattern_Name_Size(
const std::string& latname, 
const std::string& lonname)
 
  972    bool Check_LatLon_With_Coordinate_Attr_General_Product_Pattern() ;
 
  973    void Build_lat1D_latlon_candidate(
const Var*, 
const std::vector<Var*>&);
 
  974    void Build_latg1D_latlon_candidate(
Var*, 
const std::vector<Var*>&);
 
  975    void Build_unique_latlon_candidate();
 
  976    void Add_Dim_Name_LatLon1D_Or_CoordAttr_General_Product() ;
 
  977    void Add_Dim_Name_LatLon2D_General_Product() ;
 
  978    void Add_Dim_Name_Dimscale_General_Product() ;
 
  979    void Handle_UseDimscale_Var_Dim_Names_General_Product(
Var*) ;
 
  980    void Add_UseDimscale_Var_Dim_Names_General_Product(
const Var*, 
const Attribute*) ;
 
  983    void Update_M2DLatLon_Dimscale_CVs() ;
 
  984    bool Check_1DGeolocation_Dimscale() ;
 
  985    void Obtain_1DLatLon_CVs(std::vector<GMCVar*> &cvar_1dlat, std::vector<GMCVar*> &cvar_1dlon);
 
  986    void Obtain_2DLatLon_Vars(std::vector<Var*> &var_2dlat, std::vector<Var*> &var_2dlon,
 
  987        std::map<std::string, int>&latlon2d_path_to_index);
 
  988    void Obtain_2DLLVars_With_Dims_not_1DLLCVars(std::vector<Var*> &var_2dlat, std::vector<Var*> &var_2dlon,
 
  989        const std::vector<GMCVar*> &cvar_1dlat, 
const std::vector<GMCVar*> &cvar_1dlon, std::map<std::string, int>&latlon2d_path_to_index);
 
  990    void Obtain_2DLLCVar_Candidate(std::vector<Var*> &var_2dlat, std::vector<Var*> &var_2dlon,
 
  991        std::map<std::string, int>&latlon2d_path_to_index) ;
 
  992    void Obtain_unique_2dCV(std::vector<Var*>&, std::map<std::string, int>&);
 
  993    void Remove_2DLLCVar_Final_Candidate_from_Vars(std::vector<int>&) ;
 
  995    void Handle_CVar_GPM_L1() ;
 
  996    void Handle_CVar_GPM_L3() ;
 
  997    void Handle_CVar_Mea_SeaWiFS() ;
 
  998    void Handle_CVar_Aqu_L3() ;
 
  999    void Handle_CVar_OBPG_L3() ;
 
 1000    void Handle_CVar_OSMAPL2S() ;
 
 1001    void Handle_CVar_Mea_Ozone() ;
 
 1002    void Handle_SpVar_ACOS_OCO2() ;
 
 1003    void Handle_CVar_Dimscale_General_Product() ;
 
 1004    void Handle_CVar_LatLon2D_General_Product() ;
 
 1005    void Handle_CVar_LatLon1D_General_Product() ;
 
 1006    void Handle_CVar_LatLon_General_Product() ;
 
 1008    void Adjust_Mea_Ozone_Obj_Name() 
const;
 
 1009    void Adjust_GPM_L3_Obj_Name() 
const;
 
 1012    void Handle_GMCVar_NameClashing(std::set<std::string> &) ;
 
 1013    void Handle_GMCVar_AttrNameClashing() ;
 
 1014    void Handle_GMSPVar_NameClashing(std::set<std::string> &) ;
 
 1015    void Handle_GMSPVar_AttrNameClashing() ;
 
 1016    template<
typename T> 
void GMHandle_General_NameClashing(std::set<std::string>&objnameset, std::vector<T*>& objvec)
 
 1019    std::string get_CF_string(std::string s) 
override;
 
 1022    bool Check_Var_2D_CVars(
Var*) 
const;
 
 1023    bool Flatten_VarPath_In_Coordinates_Attr(
Var*) ;
 
 1027    void Handle_LatLon_With_CoordinateAttr_Coor_Attr() ;
 
 1028    bool Coord_Match_LatLon_NameSize(
const std::string & coord_values) ;
 
 1029    bool Coord_Match_LatLon_NameSize_Same_Group(
const std::string & coord_values, 
const std::string &var_path) ;
 
 1030    void Add_VarPath_In_Coordinates_Attr(
Var*, 
const std::string &);
 
 1033    void Handle_GPM_l1_Coor_Attr() 
const;
 
 1034    void Correct_GPM_L1_LatLon_units(
Var *var, 
const std::string & unit_value) ;
 
 1035    void Add_GPM_Attrs() ;
 
 1037    void Add_Aqu_Attrs() ;
 
 1038    void Add_SeaWiFS_Attrs() 
const;
 
 1039    void Create_Missing_CV(
GMCVar*, 
const std::string &) ;
 
 1041    bool Is_netCDF_Dimension(
const Var *var) 
const;
 
 1043    void Gen_Unsupported_Dtype_Info(
bool) 
override;
 
 1044    void Gen_VarAttr_Unsupported_Dtype_Info()  
override;
 
 1045    void Gen_GM_VarAttr_Unsupported_Dtype_Info();
 
 1046    void Gen_Unsupported_Dspace_Info()  
override;
 
 1047    void Handle_GM_Unsupported_Dtype(
bool) ;
 
 1048    void Handle_GM_Unsupported_Dspace(
bool) ;
 
 1050    bool Remove_EOS5_Strings(std::string &) 
const;
 
 1051    bool Remove_EOS5_Strings_NonEOS_Fields (std::string &) 
const;
 
 1052    void release_standalone_GMCVar_vector(std::vector<GMCVar*> &tempgc_vars);
 
 1055    H5GCFProduct product_type;
 
 1056    GMPattern gproduct_pattern;
 
 1057    std::vector<GMCVar *> cvars;
 
 1058    std::vector<GMSPVar *> spvars;
 
 1059    std::string gp_latname;
 
 1060    std::string gp_lonname;
 
 1061    std::set<std::string> grp_cv_paths;
 
 1062    std::set<std::string> nc4_sdimv_dv_path;
 
 1063    std::vector<struct Name_Size_2Pairs> latloncv_candidate_pairs;
 
 1068    bool have_nc4_non_coord = 
false;
 
 1069    bool special_gpm_l3 = 
false;
 
 
 1078        std::fill_n(param, 13, 0);
 
 1081    ~EOS5CFGrid() = 
default;
 
 1084    void Update_Dimnamelist();
 
 1087    float point_lower = 0.0;
 
 1088    float point_upper = 0.0;
 
 1089    float point_left = 0.0;
 
 1090    float point_right = 0.0;
 
 1091    EOS5GridPRType eos5_pixelreg = HE5_HDFE_CENTER; 
 
 1092    EOS5GridOriginType eos5_origin = HE5_HDFE_GD_UL; 
 
 1093    EOS5GridPCType eos5_projcode = HE5_GCTP_GEO; 
 
 1099    std::vector<std::string> dimnames;
 
 1100    std::set<std::string> vardimnames;
 
 1101    std::map<std::string, hsize_t> dimnames_to_dimsizes;
 
 1104    std::map<std::string, bool> dimnames_to_unlimited;
 
 1106    std::map<hsize_t, std::string> dimsizes_to_dimnames;
 
 1107    int addeddimindex = 0;
 
 1109    std::map<std::string, std::string> dnames_to_1dvnames;
 
 1113    bool has_nolatlon = 
true;
 
 1114    bool has_1dlatlon = 
false;
 
 1115    bool has_2dlatlon = 
false;
 
 1116    bool has_g2dlatlon = 
false;
 
 1118    friend class EOS5File;
 
 
 1124    EOS5CFSwath() = 
default;
 
 1125    ~EOS5CFSwath() = 
default;
 
 1129    std::vector<std::string> dimnames;
 
 1130    std::set<std::string> vardimnames;
 
 1131    std::map<std::string, hsize_t> dimnames_to_dimsizes;
 
 1134    std::map<std::string, bool> dimnames_to_unlimited;
 
 1136    std::map<hsize_t, std::string> dimsizes_to_dimnames;
 
 1137    int addeddimindex = 0;
 
 1139    std::map<std::string, std::string> dnames_to_geo1dvnames;
 
 1141    bool has_nolatlon = 
true;
 
 1142    bool has_1dlatlon = 
false;
 
 1143    bool has_2dlatlon = 
false;
 
 1144    bool has_g2dlatlon = 
false;
 
 1146    friend class EOS5File;
 
 
 1152    EOS5CFZa() = 
default;
 
 1154    ~EOS5CFZa() = 
default;
 
 1158    std::vector<std::string> dimnames;
 
 1159    std::set<std::string> vardimnames;
 
 1160    std::map<std::string, hsize_t> dimnames_to_dimsizes;
 
 1162    std::map<std::string, bool> dimnames_to_unlimited;
 
 1164    std::map<hsize_t, std::string> dimsizes_to_dimnames;
 
 1165    int addeddimindex = 0;
 
 1167    std::map<std::string, std::string> dnames_to_1dvnames;
 
 1170    friend class EOS5File;
 
 
 1174class EOS5File: 
public File {
 
 1176    EOS5File(
const char*he5_path, hid_t file_id) :
 
 1177        File(he5_path, file_id)
 
 1181    ~EOS5File() 
override;
 
 1191    void Retrieve_H5_Info(
const char *path, hid_t file_id, 
bool include_attr) 
override;
 
 1271    bool Have_EOS5_Grids()
 const {
 
 1272        return !(this->eos5cfgrids.empty());
 
 1276        return check_ignored;
 
 
 1285    void Adjust_H5_Attr_Value(
const Attribute *attr) 
const;
 
 1287    void Adjust_EOS5Dim_List(std::vector<HE5Dim>&) 
const;
 
 1288    void Condense_EOS5Dim_List(std::vector<HE5Dim>&) 
const;
 
 1289    void Remove_NegativeSizeDims(std::vector<HE5Dim>&) 
const;
 
 1290    void Adjust_EOS5DimSize_List(std::vector<HE5Dim>&,
const std::vector<HE5Var>&, 
const EOS5Type,
const std::string & eos5objname) 
const;
 
 1291    void Adjust_EOS5VarDim_Info(std::vector<HE5Dim>&, std::vector<HE5Dim>&, 
const std::string &, EOS5Type) ;
 
 1293    void EOS5Handle_nonlatlon_dimcvars(std::vector<HE5Var> & eos5varlist, EOS5Type, 
const std::string &groupname,
 
 1294        std::map<std::string, std::string>& dnamesgeo1dvnames) 
const;
 
 1295    template<
class T> 
void EOS5SwathGrid_Set_LatLon_Flags(T* eos5gridswath, std::vector<HE5Var>& eos5varlist) 
const;
 
 1297    void Obtain_Var_NewName(
Var*) 
const;
 
 1298    EOS5Type Get_Var_EOS5_Type(
const Var*) 
const;
 
 1301    template<
class T> 
bool Set_Var_Dims(T*, 
const Var*, std::vector<HE5Var>&, 
const std::string&, 
int, EOS5Type) ;
 
 1302    template<
class T> 
void Create_Unique_DimName(T*, std::set<std::string>&, 
Dimension *, 
int, EOS5Type) ;
 
 1304    template<
class T> 
bool Check_All_DimNames(T*, std::string &, hsize_t) 
const;
 
 1305    std::string Obtain_Var_EOS5Type_GroupName(
const Var*, EOS5Type) 
const;
 
 1306    int Check_EOS5Swath_FieldType(
const Var*) 
const;
 
 1307    void Get_Unique_Name(std::set<std::string>&, std::string&) 
const;
 
 1309    template<
class T> std::string Create_Unique_FakeDimName(T*, EOS5Type) 
const;
 
 1310    template<
class T> 
void Set_NonParse_Var_Dims(T*, 
const Var*, 
const std::map<hsize_t, std::string>&, 
int, EOS5Type) ;
 
 1312    void Handle_Grid_CVar(
bool) ;
 
 1313    void Handle_Augmented_Grid_CVar() ;
 
 1314    template<
class T> 
void Handle_Single_Augment_CVar(T*, EOS5Type) ;
 
 1316    void Handle_Multi_Nonaugment_Grid_CVar() ;
 
 1317    void Handle_Single_Nonaugment_Grid_CVar(
EOS5CFGrid*) ;
 
 1318    bool Handle_Single_Nonaugment_Grid_CVar_OwnLatLon(
const EOS5CFGrid *, std::set<std::string>&) ;
 
 1319    bool Handle_Single_Nonaugment_Grid_CVar_EOS5LatLon(
const EOS5CFGrid *, std::set<std::string>&) ;
 
 1320    void Handle_NonLatLon_Grid_CVar(
EOS5CFGrid *, std::set<std::string>&) ;
 
 1321    void Remove_MultiDim_LatLon_EOS5CFGrid() ;
 
 1322    void Adjust_EOS5GridDimNames(
const EOS5CFGrid *) 
const;
 
 1324    void Handle_Swath_CVar(
bool) ;
 
 1325    void Handle_Single_1DLatLon_Swath_CVar(
EOS5CFSwath *cfswath, 
bool is_augmented) ;
 
 1326    void Handle_Single_2DLatLon_Swath_CVar(
EOS5CFSwath *cfswath, 
bool is_augmented) ;
 
 1327    void Handle_NonLatLon_Swath_CVar(
EOS5CFSwath *cfswath, std::set<std::string>& tempvardimnamelist) ;
 
 1328    void Handle_Special_NonLatLon_Swath_CVar(
EOS5CFSwath *cfswath, 
const std::set<std::string>&tempvardimnamelist) ;
 
 1330    void Handle_Za_CVar(
bool) ;
 
 1332    bool Check_Augmentation_Status() 
const;
 
 1337    template<
class T> 
bool Check_Augmented_Var_Candidate(T*, 
const Var*, EOS5Type) 
const;
 
 1339    template<
class T> 
void Adjust_Per_Var_Dim_NewName_Before_Flattening(T*, 
bool, 
int, 
int, 
int) 
const;
 
 1340    void Adjust_SharedLatLon_Grid_Var_Dim_Name() 
const;
 
 1342    void Adjust_Aura_Attr_Name() ;
 
 1343    void Adjust_Aura_Attr_Value() 
const;
 
 1344    void Handle_EOS5CVar_Unit_Attr() 
const;
 
 1345    void Add_EOS5_Grid_CF_Attr() ;
 
 1346    void Handle_Aura_Special_Attr() 
const;
 
 1348    std::string get_CF_string(std::string s) 
override;
 
 1351    void Handle_EOS5CVar_NameClashing(std::set<std::string> &) ;
 
 1352    void Handle_EOS5CVar_AttrNameClashing() ;
 
 1353    template<
typename T> 
void EOS5Handle_General_NameClashing(std::set<std::string>&objnameset, std::vector<T*>& objvec)
 
 1355    template<
typename T> 
void Create_Missing_CV(T*, 
EOS5CVar*, 
const std::string &, EOS5Type, 
int) 
const;
 
 1356    void Create_Added_Var_NewName_FullPath(EOS5Type, 
const std::string&, 
const std::string&, std::string &, std::string &) 
const;
 
 1358    void Handle_EOS5_Unsupported_Dtype(
bool) ;
 
 1359    void Handle_EOS5_Unsupported_Dspace(
bool) ;
 
 1361    void Gen_Unsupported_Dtype_Info(
bool) 
override;
 
 1362    void Gen_VarAttr_Unsupported_Dtype_Info()  
override;
 
 1363    void Gen_EOS5_VarAttr_Unsupported_Dtype_Info() ;
 
 1365    void Gen_Unsupported_Dspace_Info()  
override;
 
 1368    std::vector<EOS5CVar *> cvars;
 
 1369    std::vector<EOS5CFGrid *> eos5cfgrids;
 
 1370    std::vector<EOS5CFSwath *> eos5cfswaths;
 
 1371    std::vector<EOS5CFZa *> eos5cfzas;
 
 1372    std::map<std::string, std::string> eos5_to_cf_attr_map;
 
 1373    bool grids_multi_latloncvs = 
false;
 
 1374    bool isaura = 
false;
 
 1375    EOS5AuraName aura_name = NOTAURA;
 
 1376    int orig_num_grids = 0;
 
 1377    std::multimap<std::string, std::string> dimname_to_dupdimnamelist;
 
 
This file includes several helper functions for translating HDF5 to CF-compliant.
 
This file includes functions to identify different NASA HDF5 products. Current supported products inc...
 
A class for parsing NASA HDF-EOS5 StructMetadata.
 
This class represents one attribute.
 
This class is a derived class of Var. It represents a coordinate variable.
 
CVType getCVType() const
Get the coordinate variable type of this variable.
 
This class repersents one dimension of an HDF5 dataset(variable).
 
bool HaveUnlimitedDim() const
Has unlimited dimensions.
 
This class simulates an HDF-EOS5 Grid. Currently only geographic projection is supported.
 
This class simulates an HDF-EOS5 Swath.
 
This class is a derived class of CVar. It represents a coordinate variable for HDF-EOS5 files.
 
This class is a derived class of File. It includes methods applied to HDF-EOS5 files only.
 
bool Get_IgnoredInfo_Flag() override
Obtain the flag to see if ignored objects should be generated.
 
const std::string & Get_Ignored_Msg() override
Obtain the message that contains the ignored object info.
 
void Adjust_Obj_Name() override
This method is a no-op operation. Leave here since the method in the base class is pure virtual.
 
void Add_EOS5File_Info(HE5Parser *, bool)
Add HDF-EOS5 dimension and coordinate variable related info. to EOS5Grid,EOS5Swath etc.
 
void Handle_Grid_Mapping_Vars() override
Handle Grid Mapping Vars.
 
void Retrieve_H5_Info(const char *path, hid_t file_id, bool include_attr) override
Retrieve DDS information from the HDF5 file; a real implementation for HDF-EOS5 products.
 
void Adjust_Var_NewName_After_Parsing() const
Adjust variable names for HDF-EOS5 files.
 
void Add_Supplement_Attrs(bool) override
Add the supplemental attributes for HDF-EOS5 products.
 
void Set_COARDS_Status()
Set COARDS flag.
 
void Handle_CVar() override
Handle coordinate variable for HDF-EOS5 files.
 
void Adjust_Attr_Info()
Adjust the attribute info for HDF-EOS5 products.
 
void Handle_SpVar_Attr() override
Handle special variables for HDF-EOS5 files.
 
void Handle_Obj_NameClashing(bool)
Handle the object name clashing for HDF-EOS5 products.
 
void Handle_Unsupported_Dtype(bool) override
Handle unsupported HDF5 datatypes for HDF-EOS5 products.
 
bool Have_Grid_Mapping_Attrs() override
Check if having Grid Mapping Attrs.
 
void Handle_DimNameClashing() override
 
void Handle_Unsupported_Others(bool) override
Handle other unmapped objects/attributes for HDF-EOS5 products.
 
void Retrieve_H5_CVar_Supported_Attr_Values() override
Retrieve coordinate variable attributes.
 
void Handle_SpVar() override
Handle special variables for HDF-EOS5 files.
 
void Retrieve_H5_Supported_Attr_Values() override
Retrieve attribute values for the supported HDF5 datatypes for HDF-EOS5 products.
 
void Add_Dim_Name(HE5Parser *)
Add the dimension name for HDF-EOS5 files.
 
void Adjust_Dim_Name() override
Adjust the dimension name for HDF-EOS5 products.
 
void Handle_SpVar_DMR() override
Handle special variables and attributes for HDF-EOS5 files(for DMR)
 
void Handle_Unsupported_Dspace(bool) override
Handle unsupported HDF5 dataspaces for HDF-EOS5 products.
 
void Adjust_Var_Dim_NewName_Before_Flattening() const
Adjust variable dimension names before the flattening for HDF-EOS5 files.
 
void Flatten_Obj_Name(bool include_attr) override
Flatten the object name for HDF-EOS5 files.
 
void Check_Aura_Product_Status()
Check if the HDF-EOS5 file is an Aura file. Special CF operations need to be used.
 
const std::vector< EOS5CVar * > & getCVars() const
Obtain coordinate variables for HDF-EOS5 products.
 
void Adjust_EOS5Dim_Info(HE5Parser *strmeta_info)
Adjust HDF-EOS5 dimension information.
 
void Handle_Coor_Attr() override
Handle the coordinates attribute for HDF-EOS5 products.
 
Exception(const std::string &msg)
Constructor.
 
This class retrieves all information from an HDF5 file.
 
bool HaveUnlimitedDim() const
Has unlimited dimensions.
 
std::vector< Group * > groups
Non-root group vectors.
 
virtual void Retrieve_H5_Var_Attr_Values(Var *var)
Retrieve attribute values for a variable.
 
virtual void Handle_Unsupported_Dspace(bool)
Handle unsupported HDF5 dataspaces for datasets.
 
std::map< hsize_t, std::string > dimsize_to_fakedimname
Handle added dimension names.
 
virtual void Handle_Grid_Mapping_Vars()
Handle Grid Mapping Vars.
 
virtual bool Get_IgnoredInfo_Flag()=0
Obtain the flag to see if ignored objects should be generated.
 
hid_t getFileID() const
Obtain the HDF5 file ID.
 
virtual void Handle_Unsupported_Others(bool)
Handle other unmapped objects/attributes.
 
virtual void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes.
 
std::vector< Var * > vars
Var vectors.
 
const std::vector< Attribute * > & getAttributes() const
Public interface to obtain information of all attributes under the root group.
 
virtual void Add_Supplement_Attrs(bool)
Add supplemental attributes such as fullpath and original name.
 
virtual void Handle_Coor_Attr()=0
Handle "coordinates" attributes.
 
virtual void Retrieve_H5_Info(const char *path, hid_t file_id, bool)
 
std::vector< Attribute * > root_attrs
Root attribute vectors.
 
virtual void Handle_SpVar_Attr()=0
Handle special variable attributes.
 
const std::vector< Group * > & getGroups() const
Public interface to obtain all the group info.
 
virtual void Handle_CVar()=0
Handle coordinate variables.
 
virtual void Adjust_Dim_Name()=0
Adjust dimension names based on different products.
 
const std::string & getPath() const
Obtain the path of the file.
 
virtual void Adjust_Obj_Name()=0
Adjust object names based on different products.
 
const std::vector< Var * > & getVars() const
Public interface to obtain information of all variables.
 
virtual void Handle_SpVar_DMR()=0
Handle Special variable and attributes for DMR.
 
virtual void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes.
 
virtual const std::string & Get_Ignored_Msg()=0
Obtain the message that contains the ignored object info.
 
virtual void Flatten_Obj_Name(bool)
Flatten the object name.
 
virtual void Handle_DimNameClashing()=0
 
virtual void Retrieve_H5_CVar_Supported_Attr_Values()=0
Retrieve coordinate variable attributes.
 
virtual void Handle_SpVar()=0
Handle special variables.
 
virtual bool Have_Grid_Mapping_Attrs()
Check if having Grid Mapping Attrs.
 
This class is a derived class of CVar. It represents a coordinate variable for general HDF5 files.
 
H5GCFProduct getPtType() const
Get the data type of this variable.
 
This class is a derived class of File. It includes methods applied to general HDF5 files only.
 
void Add_Supplement_Attrs(bool) override
Add supplemental attributes such as fullpath and original name for general NASA HDF5 products.
 
void Add_Path_Coord_Attr()
Update the coordinate attribute to include path and also flatten.
 
void Rename_NC4_NonCoordVars() const
Remove the _nc4_non_coord from the variable new names.
 
void Handle_Obj_NameClashing(bool)
Handle object name clashing for general NASA HDF5 products.
 
void Remove_Unused_FakeDimVars()
Unsupported datatype array may generate FakeDim. Remove them.
 
void Update_Product_Type()
Update "product type" attributes for general HDF5 products.
 
bool Have_Grid_Mapping_Attrs() override
Check if having Grid Mapping Attrs.
 
void Handle_SpVar_Attr() override
Handle special variable attributes for general NASA HDF5 products.
 
void Handle_DimNameClashing() override
 
void Handle_Grid_Mapping_Vars() override
Handle Grid Mapping Vars.
 
void Retrieve_H5_CVar_Supported_Attr_Values() override
Retrieve coordinate variable attributes.
 
void Update_Bounds_Attr()
Update the Bounds attribute to follow the CF conventions.
 
void Retrieve_H5_Info(const char *path, hid_t file_id, bool include_attr) override
Retrieve DDS information from the HDF5 file; real implementation for general HDF5 products.
 
void Handle_SpVar() override
Handle special variables for general NASA HDF5 products.
 
const std::string & Get_Ignored_Msg() override
Get the message that contains the ignored obj. info.
 
void Remove_Unneeded_Objects()
Remove unneeded objects.
 
void Update_NC4_PureDimSize()
Update the netCDF-4 pure dimension size when the pure dimension is an unlimited dimension.
 
void Handle_CVar() override
Handle coordinate variables for general NASA HDF5 products.
 
void Add_Dim_Name()
Add dimension name.
 
void Retrieve_H5_Supported_Attr_Values() override
Retrieve attribute values for the supported HDF5 datatypes for general HDF5 products.
 
void Handle_Coor_Attr() override
Handle "coordinates" attributes for general HDF5 products.
 
void Handle_Unsupported_Dspace(bool) override
Handle unsupported HDF5 dataspaces for general HDF5 products.
 
void Handle_Unsupported_Others(bool) override
Handle other unmapped objects/attributes for general HDF5 products.
 
void Handle_Unsupported_Dtype(bool) override
Handle unsupported HDF5 datatypes for general HDF5 products.
 
void Flatten_Obj_Name(bool include_attr) override
Flatten the object name for general NASA HDF5 products.
 
void Adjust_H5_Attr_Value(Attribute *attr) const
Adjust attribute values for general HDF5 products.
 
void Adjust_Dim_Name() override
Adjust dimension name for general NASA HDF5 products.
 
void Adjust_Obj_Name() override
Adjust object names based on different general NASA HDF5 products.
 
void Handle_SpVar_DMR() override
 
bool Get_IgnoredInfo_Flag() override
Obtain ignored info. flag.
 
This class is a derived class of Var. It represents a special general HDF5 product(currently ACOS and...
 
const std::string & getPath() const
Get the original path of this group.
 
const std::string & getNewName() const
Get the new name of this group(flattened,name clashed checked)
 
This class represents one HDF5 dataset(CF variable)
 
float getCompRatio() const
Get the compression ratio of this dataset.
 
int getRank() const
Get the dimension rank of this variable.
 
const std::string & getFullPath() const
Get the full path of this variable.
 
const std::string & getName() const
Get the original name of this variable.
 
H5DataType getType() const
Get the data type of this variable(Not HDF5 datatype id)
 
const std::vector< Dimension * > & getDimensions() const
Get the list of the dimensions.
 
const std::string & getNewName() const
Get the new name of this variable.