55 GRID, SWATH, ZA, OTHERVARS
58 GENERAL_DIMSCALE, GENERAL_LATLON2D, GENERAL_LATLON1D, GENERAL_LATLON_COOR_ATTR, OTHERGMS
61 OMI, MLS, HIRDLS, TES, NOTAURA
63 static std::string FILE_ATTR_TABLE_NAME =
"HDF5_GLOBAL";
82 virtual const char *what()
const throw ()
84 return this->message.c_str();
87 virtual void setException(std::string except_message)
89 this->message = except_message;
95 template<
typename T,
typename U,
typename V,
typename W,
typename X>
static void _throw5(
const char *fname,
int line,
96 int numarg,
const T & a1,
const U & a2,
const V & a3,
const W & a4,
const X & a5)
98 std::ostringstream ss;
99 ss << fname <<
":" << line <<
":";
100 for (
int i = 0; i < numarg; ++i) {
122 throw Exception(ss.str());
128 #define throw1(a1) _throw5(__FILE__, __LINE__, 1, a1, 0, 0, 0, 0)
129 #define throw2(a1, a2) _throw5(__FILE__, __LINE__, 2, a1, a2, 0, 0, 0)
130 #define throw3(a1, a2, a3) _throw5(__FILE__, __LINE__, 3, a1, a2, a3, 0, 0)
131 #define throw4(a1, a2, a3, a4) _throw5(__FILE__, __LINE__, 4, a1, a2, a3, a4, 0)
132 #define throw5(a1, a2, a3, a4, a5) _throw5(__FILE__, __LINE__, 5, a1, a2, a3, a4, a5)
135 template<
typename T>
void operator ()(T * ptr)
147 hsize_t getSize()
const
151 const std::string & getName()
const
155 const std::string & getNewName()
const
157 return this->newname;
163 return unlimited_dim;
168 size(dimsize), name(
""), newname(
""), unlimited_dim(false)
178 friend class EOS5File;
184 friend class EOS5CVar;
185 friend class GMSPVar;
193 dtype(H5UNSUPTYPE), count(0), fstrsize(0),is_cset_ascii(
true)
199 const std::string & getName()
const
204 const std::string & getNewName()
const
206 return this->newname;
209 H5DataType getType()
const
214 hsize_t getCount()
const
219 size_t getBufSize()
const
221 return (this->value).size();
224 const std::vector<char>&getValue()
const
229 const std::vector<size_t>&getStrSize()
const
231 return this->strsize;
234 bool getCsetType()
const {
235 return this->is_cset_ascii;
243 std::vector<size_t> strsize;
245 std::vector<char> value;
262 dtype(H5UNSUPTYPE), rank(-1), comp_ratio(1), total_elems(0), zero_storage_size(
false),unsupported_attr_dtype(
false),
263 unsupported_attr_dspace(
false), unsupported_dspace(
false), dimnameflag(
false),coord_attr_add_path(
true)
279 return this->newname;
285 return this->fullpath;
288 size_t getTotalElems()
const
290 return this->total_elems;
294 const bool getZeroStorageSize()
const
296 return this->zero_storage_size;
299 const bool getCoorAttrAddPath()
const
301 return this->coord_attr_add_path;
316 const std::vector<Attribute *>&getAttributes()
const
330 return this->comp_ratio;
337 std::string fullpath;
342 bool zero_storage_size;
343 bool unsupported_attr_dtype;
344 bool unsupported_attr_dspace;
345 bool unsupported_dspace;
347 bool coord_attr_add_path;
349 std::vector<Attribute *> attrs;
350 std::vector<Dimension *> dims;
365 cvartype(CV_UNSUPPORTED)
374 return this->cvartype;
377 bool isLatLon()
const;
383 std::string cfdimname;
395 otype(H5UNSUPTYPE), sdbit(-1), numofdbits(-1)
402 H5DataType getOriginalType()
const
407 int getStartBit()
const
412 int getBitNum()
const
414 return this->numofdbits;
430 product_type(General_Product)
441 return this->product_type;
445 H5GCFProduct product_type;
453 eos_type(OTHERVARS), is_2dlatlon(
false), point_lower(0.0), point_upper(0.0), point_left(0.0), point_right(0.0), xdimsize(
454 0), ydimsize(0), eos5_pixelreg(HE5_HDFE_CENTER),
455 eos5_origin(HE5_HDFE_GD_UL),
456 eos5_projcode(HE5_GCTP_GEO),
459 std::fill_n(param, 13, 0);
468 EOS5Type getEos5Type()
const
470 return this->eos_type;
472 float getPointLower()
const
474 return this->point_lower;
476 float getPointUpper()
const
478 return this->point_upper;
481 float getPointLeft()
const
483 return this->point_left;
485 float getPointRight()
const
487 return this->point_right;
490 EOS5GridPRType getPixelReg()
const
492 return this->eos5_pixelreg;
494 EOS5GridOriginType getOrigin()
const
496 return this->eos5_origin;
499 EOS5GridPCType getProjCode()
const
501 return this->eos5_projcode;
504 int getXDimSize()
const
506 return this->xdimsize;
509 int getYDimSize()
const
511 return this->ydimsize;
514 std::vector<double> getParams()
const
516 std::vector<double> ret_params;
517 for (
int i = 0; i < 13; i++)
518 ret_params.push_back(param[i]);
527 int getSphere()
const
541 EOS5GridPRType eos5_pixelreg;
542 EOS5GridOriginType eos5_origin;
543 EOS5GridPCType eos5_projcode;
555 unsupported_attr_dtype(
false), unsupported_attr_dspace(
false)
570 return this->newname;
573 const std::vector<Attribute *>&getAttributes()
const
583 std::vector<Attribute *> attrs;
584 bool unsupported_attr_dtype;
585 bool unsupported_attr_dspace;
589 friend class EOS5File;
703 void Retrieve_H5_Obj(hid_t grp_id,
const char*gname,
bool include_attr);
704 void Retrieve_H5_Attr_Info(
Attribute *, hid_t obj_id,
const int j,
bool& unsup_attr_dtype,
bool & unsup_attr_dspace);
706 void Retrieve_H5_Attr_Value(
Attribute *attr, std::string);
708 void Retrieve_H5_VarType(
Var*, hid_t dset_id,
const std::string& varname,
bool &unsup_var_dtype);
709 void Retrieve_H5_VarDim(
Var*, hid_t dset_id,
const std::string &varname,
bool & unsup_var_dspace);
711 float Retrieve_H5_VarCompRatio(
Var*, hid_t);
713 void Handle_Group_Unsupported_Dtype() ;
714 void Handle_Var_Unsupported_Dtype() ;
715 void Handle_VarAttr_Unsupported_Dtype() ;
717 void Handle_GroupAttr_Unsupported_Dspace() ;
718 void Handle_VarAttr_Unsupported_Dspace() ;
720 void Gen_Group_Unsupported_Dtype_Info() ;
721 void Gen_Var_Unsupported_Dtype_Info() ;
722 virtual void Gen_VarAttr_Unsupported_Dtype_Info() ;
724 void Handle_GeneralObj_NameClashing(
bool, std::set<std::string> &objnameset) ;
725 void Handle_Var_NameClashing(std::set<std::string> &objnameset) ;
726 void Handle_Group_NameClashing(std::set<std::string> &objnameset) ;
727 void Handle_Obj_AttrNameClashing() ;
728 template<
typename T>
void Handle_General_NameClashing(std::set<std::string>&objnameset, std::vector<T*>& objvec) ;
730 void Add_One_FakeDim_Name(
Dimension *dim) ;
731 void Adjust_Duplicate_FakeDim_Name(
Dimension * dim) ;
732 void Insert_One_NameSizeMap_Element(std::string name, hsize_t size,
bool unlimited) ;
733 void Insert_One_NameSizeMap_Element2(std::map<std::string, hsize_t> &, std::map<std::string, bool>&, std::string name, hsize_t size,
736 virtual std::string get_CF_string(std::string);
737 virtual void Replace_Var_Info(
Var* src,
Var *target);
738 virtual void Replace_Var_Attrs(
Var *src,
Var*target);
740 void Add_Str_Attr(
Attribute* attr,
const std::string &attrname,
const std::string& strvalue) ;
741 std::string Retrieve_Str_Attr_Value(
Attribute *attr,
const std::string var_path);
742 bool Is_Str_Attr(
Attribute* attr, std::string varfullpath,
const std::string &attrname,
const std::string& strvalue);
743 void Add_One_Float_Attr(
Attribute* attr,
const std::string &attrname,
float float_value) ;
744 void Replace_Var_Str_Attr(
Var* var,
const std::string &attr_name,
const std::string& strvalue);
745 void Change_Attr_One_Str_to_Others(
Attribute *attr,
Var *var) ;
748 bool Is_geolatlon(
const std::string &var_name,
bool is_lat);
749 bool has_latlon_cf_units(
Attribute*attr,
const std::string &varfullpath,
bool is_lat);
754 bool is_var_under_group(
const std::string &varname,
const std::string &grpname,
const int var_rank, std::vector<size_t> &var_size);
757 void remove_netCDF_internal_attributes(
bool include_attr);
759 virtual void Gen_Unsupported_Dtype_Info(
bool) = 0;
760 virtual void Gen_Unsupported_Dspace_Info() ;
761 void Gen_DimScale_VarAttr_Unsupported_Dtype_Info() ;
762 void add_ignored_info_page_header();
763 void add_ignored_info_obj_header();
766 void add_ignored_info_links_header();
767 void add_ignored_info_links(
const std::string& link_name);
768 void add_ignored_info_namedtypes(
const std::string&,
const std::string&);
769 void add_ignored_info_attrs(
bool is_grp,
const std::string & obj_path,
const std::string &attr_name);
770 void add_ignored_info_objs(
bool is_dim_related,
const std::string & obj_path);
771 void add_no_ignored_info();
772 bool ignored_dimscale_ref_list(
Var *var);
774 void add_ignored_var_longstr_info(
Var*var,
Attribute *attr) ;
775 void add_ignored_grp_longstr_info(
const std::string& grp_path,
const std::string& attr_name);
776 void add_ignored_droplongstr_hdr();
777 bool Check_VarDropLongStr(
const std::string &varpath,
const std::vector<Dimension *>&, H5DataType)
const;
779 void release_standalone_var_vector(std::vector<Var*>&
vars);
782 std::string Check_Grid_Mapping_VarName(
const std::string& attr_value,
const std::string& var_full_path);
783 std::string Check_Grid_Mapping_FullPath(
const std::string& attr_value);
786 File(
const char *h5_path, hid_t file_id) :
787 path(std::string(h5_path)), fileid(file_id), rootid(-1), unsupported_var_dtype(false), unsupported_attr_dtype(false), unsupported_var_dspace(
788 false), unsupported_attr_dspace(false), unsupported_var_attr_dspace(false), addeddimindex(0), check_ignored(
789 false), have_ignored(false), have_udim(false)
807 bool unsupported_var_dtype;
808 bool unsupported_attr_dtype;
810 bool unsupported_var_dspace;
811 bool unsupported_attr_dspace;
812 bool unsupported_var_attr_dspace;
814 std::set<std::string> dimnamelist;
816 std::map<std::string, hsize_t> dimname_to_dimsize;
819 std::map<std::string, bool> dimname_to_unlimited;
828 std::string ignored_msg;
835 GMFile(
const char*path, hid_t file_id, H5GCFProduct product, GMPattern gproduct_pattern);
838 H5GCFProduct getProductType()
const
843 const std::vector<GMCVar *>&getCVars()
const
848 const std::vector<GMSPVar *>&getSPVars()
const
854 virtual void Retrieve_H5_Info(
const char *path, hid_t file_id,
bool include_attr);
912 bool Is_Hybrid_EOS5();
913 void Handle_Hybrid_EOS5();
933 return check_ignored;
943 bool Check_And_Update_New_GPM_L3();
944 void Remove_OMPSNPP_InputPointers();
945 void Add_Dim_Name_GPM() ;
946 void Add_Dim_Name_Mea_SeaWiFS() ;
947 void Handle_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(
Var*) ;
948 void Add_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(
Var *,
Attribute*) ;
950 void Add_Dim_Name_Mea_Ozonel3z() ;
951 bool check_cv(
const std::string & varname)
const;
953 void Add_Dim_Name_Aqu_L3() ;
954 void Add_Dim_Name_OBPG_L3() ;
955 void Add_Dim_Name_OSMAPL2S() ;
956 void Add_Dim_Name_ACOS_L2S_OCO2_L1B() ;
958 void Add_Dim_Name_General_Product() ;
959 void Check_General_Product_Pattern() ;
960 bool Check_Dimscale_General_Product_Pattern() ;
961 bool Check_LatLon2D_General_Product_Pattern() ;
962 bool Check_LatLon2D_General_Product_Pattern_Name_Size(
const std::string& latname,
const std::string& lonname)
964 bool Check_LatLon1D_General_Product_Pattern() ;
965 bool Check_LatLon1D_General_Product_Pattern_Name_Size(
const std::string& latname,
const std::string& lonname)
968 bool Check_LatLon_With_Coordinate_Attr_General_Product_Pattern() ;
969 void Build_lat1D_latlon_candidate(
Var*,
const std::vector<Var*>&);
970 void Build_latg1D_latlon_candidate(
Var*,
const std::vector<Var*>&);
971 void Build_unique_latlon_candidate();
972 void Add_Dim_Name_LatLon1D_Or_CoordAttr_General_Product() ;
973 void Add_Dim_Name_LatLon2D_General_Product() ;
974 void Add_Dim_Name_Dimscale_General_Product() ;
975 void Handle_UseDimscale_Var_Dim_Names_General_Product(
Var*) ;
976 void Add_UseDimscale_Var_Dim_Names_General_Product(
Var*,
Attribute*) ;
979 void Update_M2DLatLon_Dimscale_CVs() ;
980 bool Check_1DGeolocation_Dimscale() ;
981 void Obtain_1DLatLon_CVs(std::vector<GMCVar*> &cvar_1dlat, std::vector<GMCVar*> &cvar_1dlon);
982 void Obtain_2DLatLon_Vars(std::vector<Var*> &var_2dlat, std::vector<Var*> &var_2dlon,
983 std::map<std::string, int>&latlon2d_path_to_index);
984 void Obtain_2DLLVars_With_Dims_not_1DLLCVars(std::vector<Var*> &var_2dlat, std::vector<Var*> &var_2dlon,
985 std::vector<GMCVar*> &cvar_1dlat, std::vector<GMCVar*> &cvar_1dlon, std::map<std::string, int>&latlon2d_path_to_index);
986 void Obtain_2DLLCVar_Candidate(std::vector<Var*> &var_2dlat, std::vector<Var*> &var_2dlon,
987 std::map<std::string, int>&latlon2d_path_to_index) ;
988 void Obtain_unique_2dCV(std::vector<Var*>&, std::map<std::string, int>&);
989 void Remove_2DLLCVar_Final_Candidate_from_Vars(std::vector<int>&) ;
991 void Handle_CVar_GPM_L1() ;
992 void Handle_CVar_GPM_L3() ;
993 void Handle_CVar_Mea_SeaWiFS() ;
994 void Handle_CVar_Aqu_L3() ;
995 void Handle_CVar_OBPG_L3() ;
996 void Handle_CVar_OSMAPL2S() ;
997 void Handle_CVar_Mea_Ozone() ;
998 void Handle_SpVar_ACOS_OCO2() ;
999 void Handle_CVar_Dimscale_General_Product() ;
1000 void Handle_CVar_LatLon2D_General_Product() ;
1001 void Handle_CVar_LatLon1D_General_Product() ;
1002 void Handle_CVar_LatLon_General_Product() ;
1004 void Adjust_Mea_Ozone_Obj_Name() ;
1005 void Adjust_GPM_L3_Obj_Name() ;
1007 void Handle_GMCVar_NameClashing(std::set<std::string> &) ;
1008 void Handle_GMCVar_AttrNameClashing() ;
1009 void Handle_GMSPVar_NameClashing(std::set<std::string> &) ;
1010 void Handle_GMSPVar_AttrNameClashing() ;
1011 template<
typename T>
void GMHandle_General_NameClashing(std::set<std::string>&objnameset, std::vector<T*>& objvec)
1014 virtual std::string get_CF_string(std::string s);
1017 bool Check_Var_2D_CVars(
Var*) ;
1018 bool Flatten_VarPath_In_Coordinates_Attr(
Var*) ;
1020 void Handle_LatLon_With_CoordinateAttr_Coor_Attr() ;
1021 bool Coord_Match_LatLon_NameSize(
const std::string & coord_values) ;
1022 bool Coord_Match_LatLon_NameSize_Same_Group(
const std::string & coord_values,
const std::string &var_path) ;
1023 void Add_VarPath_In_Coordinates_Attr(
Var*,
const std::string &);
1026 void Handle_GPM_l1_Coor_Attr() ;
1027 void Correct_GPM_L1_LatLon_units(
Var *var,
const std::string unit_value) ;
1028 void Add_GPM_Attrs() ;
1030 void Add_Aqu_Attrs() ;
1031 void Add_SeaWiFS_Attrs() ;
1032 void Create_Missing_CV(
GMCVar*,
const std::string &) ;
1034 bool Is_netCDF_Dimension(
Var *var) ;
1036 virtual void Gen_Unsupported_Dtype_Info(
bool);
1037 virtual void Gen_VarAttr_Unsupported_Dtype_Info() ;
1038 void Gen_GM_VarAttr_Unsupported_Dtype_Info();
1039 virtual void Gen_Unsupported_Dspace_Info() ;
1040 void Handle_GM_Unsupported_Dtype(
bool) ;
1041 void Handle_GM_Unsupported_Dspace(
bool) ;
1043 bool Remove_EOS5_Strings(std::string &);
1044 bool Remove_EOS5_Strings_NonEOS_Fields (std::string &);
1045 void release_standalone_GMCVar_vector(std::vector<GMCVar*> &tempgc_vars);
1048 H5GCFProduct product_type;
1049 GMPattern gproduct_pattern;
1050 std::vector<GMCVar *> cvars;
1051 std::vector<GMSPVar *> spvars;
1052 std::string gp_latname;
1053 std::string gp_lonname;
1054 std::set<std::string> grp_cv_paths;
1055 std::vector<struct Name_Size_2Pairs> latloncv_candidate_pairs;
1061 bool have_nc4_non_coord;
1069 point_lower(0.0), point_upper(0.0), point_left(0.0), point_right(0.0),
1070 eos5_pixelreg(HE5_HDFE_CENTER),
1071 eos5_origin(HE5_HDFE_GD_UL),
1072 eos5_projcode(HE5_GCTP_GEO),
1073 zone(-1), sphere(0),
1075 xdimsize(0), ydimsize(0),
1076 has_nolatlon(
true), has_1dlatlon(
false), has_2dlatlon(
false), has_g2dlatlon(
false)
1078 std::fill_n(param, 13, 0);
1086 void Update_Dimnamelist();
1093 EOS5GridPRType eos5_pixelreg;
1094 EOS5GridOriginType eos5_origin;
1095 EOS5GridPCType eos5_projcode;
1101 std::vector<std::string> dimnames;
1102 std::set<std::string> vardimnames;
1103 std::map<std::string, hsize_t> dimnames_to_dimsizes;
1106 std::map<std::string, bool> dimnames_to_unlimited;
1108 std::map<hsize_t, std::string> dimsizes_to_dimnames;
1111 std::map<std::string, std::string> dnames_to_1dvnames;
1127 addeddimindex(0), has_nolatlon(
true), has_1dlatlon(
false), has_2dlatlon(
false), has_g2dlatlon(
false)
1137 std::vector<std::string> dimnames;
1138 std::set<std::string> vardimnames;
1139 std::map<std::string, hsize_t> dimnames_to_dimsizes;
1142 std::map<std::string, bool> dimnames_to_unlimited;
1144 std::map<hsize_t, std::string> dimsizes_to_dimnames;
1147 std::map<std::string, std::string> dnames_to_geo1dvnames;
1171 std::vector<std::string> dimnames;
1172 std::set<std::string> vardimnames;
1173 std::map<std::string, hsize_t> dimnames_to_dimsizes;
1175 std::map<std::string, bool> dimnames_to_unlimited;
1177 std::map<hsize_t, std::string> dimsizes_to_dimnames;
1180 std::map<std::string, std::string> dnames_to_1dvnames;
1189 EOS5File(
const char*he5_path, hid_t file_id) :
1190 File(he5_path, file_id), iscoard(
false), grids_multi_latloncvs(
false), isaura(
false), aura_name(NOTAURA),
1205 virtual void Retrieve_H5_Info(
const char *path, hid_t file_id,
bool include_attr);
1284 return check_ignored;
1293 void Adjust_H5_Attr_Value(
Attribute *attr) ;
1295 void Adjust_EOS5Dim_List(std::vector<HE5Dim>&) ;
1296 void Condense_EOS5Dim_List(std::vector<HE5Dim>&) ;
1297 void Remove_NegativeSizeDims(std::vector<HE5Dim>&) ;
1298 void Adjust_EOS5DimSize_List(std::vector<HE5Dim>&,
const std::vector<HE5Var>&,
const EOS5Type,
const std::string & eos5objname);
1299 void Adjust_EOS5VarDim_Info(std::vector<HE5Dim>&, std::vector<HE5Dim>&,
const std::string &, EOS5Type) ;
1301 void EOS5Handle_nonlatlon_dimcvars(std::vector<HE5Var> & eos5varlist, EOS5Type, std::string groupname,
1302 std::map<std::string, std::string>& dnamesgeo1dvnames) ;
1303 template<
class T>
void EOS5SwathGrid_Set_LatLon_Flags(T* eos5gridswath, std::vector<HE5Var>& eos5varlist)
1306 void Obtain_Var_NewName(
Var*) ;
1307 EOS5Type Get_Var_EOS5_Type(
Var*) ;
1310 template<
class T>
bool Set_Var_Dims(T*,
Var*, std::vector<HE5Var>&,
const std::string&,
int, EOS5Type) ;
1311 template<
class T>
void Create_Unique_DimName(T*, std::set<std::string>&,
Dimension *,
int, EOS5Type) ;
1313 template<
class T>
bool Check_All_DimNames(T*, std::string &, hsize_t);
1314 std::string Obtain_Var_EOS5Type_GroupName(
Var*, EOS5Type) ;
1315 int Check_EOS5Swath_FieldType(
Var*) ;
1316 void Get_Unique_Name(std::set<std::string>&, std::string&) ;
1318 template<
class T> std::string Create_Unique_FakeDimName(T*, EOS5Type) ;
1319 template<
class T>
void Set_NonParse_Var_Dims(T*,
Var*, std::map<hsize_t, std::string>&,
int, EOS5Type) ;
1321 void Handle_Grid_CVar(
bool) ;
1322 void Handle_Augmented_Grid_CVar() ;
1323 template<
class T>
void Handle_Single_Augment_CVar(T*, EOS5Type) ;
1325 void Handle_Multi_Nonaugment_Grid_CVar() ;
1326 void Handle_Single_Nonaugment_Grid_CVar(
EOS5CFGrid*) ;
1327 bool Handle_Single_Nonaugment_Grid_CVar_OwnLatLon(
EOS5CFGrid *, std::set<std::string>&) ;
1328 bool Handle_Single_Nonaugment_Grid_CVar_EOS5LatLon(
EOS5CFGrid *, std::set<std::string>&) ;
1329 void Handle_NonLatLon_Grid_CVar(
EOS5CFGrid *, std::set<std::string>&) ;
1330 void Remove_MultiDim_LatLon_EOS5CFGrid() ;
1333 void Handle_Swath_CVar(
bool) ;
1334 void Handle_Single_1DLatLon_Swath_CVar(
EOS5CFSwath *cfswath,
bool is_augmented) ;
1335 void Handle_Single_2DLatLon_Swath_CVar(
EOS5CFSwath *cfswath,
bool is_augmented) ;
1336 void Handle_NonLatLon_Swath_CVar(
EOS5CFSwath *cfswath, std::set<std::string>& tempvardimnamelist) ;
1337 void Handle_Special_NonLatLon_Swath_CVar(
EOS5CFSwath *cfswath, std::set<std::string>&tempvardimnamelist) ;
1339 void Handle_Za_CVar(
bool) ;
1341 bool Check_Augmentation_Status() ;
1346 template<
class T>
bool Check_Augmented_Var_Candidate(T*,
Var*, EOS5Type) ;
1348 template<
class T>
void Adjust_Per_Var_Dim_NewName_Before_Flattening(T*,
bool,
int,
int,
int) ;
1349 void Adjust_SharedLatLon_Grid_Var_Dim_Name() ;
1351 void Adjust_Aura_Attr_Name() ;
1352 void Adjust_Aura_Attr_Value() ;
1353 void Handle_EOS5CVar_Unit_Attr() ;
1354 void Add_EOS5_Grid_CF_Attr() ;
1355 void Handle_Aura_Special_Attr() ;
1357 virtual std::string get_CF_string(std::string s);
1360 void Handle_EOS5CVar_NameClashing(std::set<std::string> &) ;
1361 void Handle_EOS5CVar_AttrNameClashing() ;
1362 template<
typename T>
void EOS5Handle_General_NameClashing(std::set<std::string>&objnameset, std::vector<T*>& objvec)
1364 template<
typename T>
void Create_Missing_CV(T*,
EOS5CVar*,
const std::string &, EOS5Type,
int) ;
1365 void Create_Added_Var_NewName_FullPath(EOS5Type,
const std::string&,
const std::string&, std::string &, std::string &) ;
1367 void Handle_EOS5_Unsupported_Dtype(
bool) ;
1368 void Handle_EOS5_Unsupported_Dspace(
bool) ;
1370 virtual void Gen_Unsupported_Dtype_Info(
bool);
1371 virtual void Gen_VarAttr_Unsupported_Dtype_Info() ;
1372 void Gen_EOS5_VarAttr_Unsupported_Dtype_Info() ;
1374 virtual void Gen_Unsupported_Dspace_Info() ;
1377 std::vector<EOS5CVar *> cvars;
1378 std::vector<EOS5CFGrid *> eos5cfgrids;
1379 std::vector<EOS5CFSwath *> eos5cfswaths;
1380 std::vector<EOS5CFZa *> eos5cfzas;
1381 std::map<std::string, std::string> eos5_to_cf_attr_map;
1383 bool grids_multi_latloncvs;
1385 EOS5AuraName aura_name;
1387 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 simulates an HDF-EOS5 Zonal average object.
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.
virtual const std::string & Get_Ignored_Msg()
Obtain the message that contains the ignored object info.
void Add_EOS5File_Info(HE5Parser *, bool)
Add HDF-EOS5 dimension and coordinate variable related info. to EOS5Grid,EOS5Swath etc.
virtual void Handle_Grid_Mapping_Vars()
Handle Grid Mapping Vars.
void Set_COARDS_Status()
Set COARDS flag.
virtual void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes for HDF-EOS5 products.
void Adjust_Var_Dim_NewName_Before_Flattening()
Adjust variable dimension names before the flattening for HDF-EOS5 files.
void Adjust_Attr_Info()
Adjust the attribute info for HDF-EOS5 products.
void Handle_Obj_NameClashing(bool)
Handle the object name clashing for HDF-EOS5 products.
virtual void Retrieve_H5_CVar_Supported_Attr_Values()
Retrieve coordinate variable attributes.
virtual bool Have_Grid_Mapping_Attrs()
Check if having Grid Mapping Attrs.
virtual void Adjust_Obj_Name()
This method is a no-op operation. Leave here since the method in the base class is pure virtual.
virtual void Handle_SpVar()
Handle special variables for HDF-EOS5 files.
virtual void Retrieve_H5_Info(const char *path, hid_t file_id, bool include_attr)
Retrieve DDS information from the HDF5 file; a real implementation for HDF-EOS5 products.
const std::vector< EOS5CVar * > & getCVars() const
Obtain coordinate variables for HDF-EOS5 products.
virtual void Handle_DimNameClashing()
virtual void Handle_CVar()
Handle coordinate variable for HDF-EOS5 files.
virtual void Handle_SpVar_Attr()
Handle special variables for HDF-EOS5 files.
virtual void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes for HDF-EOS5 products.
virtual void Handle_Coor_Attr()
Handle the coordinates attribute for HDF-EOS5 products.
void Adjust_Var_NewName_After_Parsing()
Adjust variable names for HDF-EOS5 files.
virtual void Add_Supplement_Attrs(bool)
Add the supplemental attributes for HDF-EOS5 products.
void Add_Dim_Name(HE5Parser *)
Add the dimension name for HDF-EOS5 files.
virtual void Handle_Unsupported_Others(bool)
Handle other unmapped objects/attributes for HDF-EOS5 products.
virtual void Flatten_Obj_Name(bool include_attr)
Flatten the object name for HDF-EOS5 files.
virtual void Adjust_Dim_Name()
Adjust the dimension name for HDF-EOS5 products.
virtual void Handle_Unsupported_Dspace(bool)
Handle unsupported HDF5 dataspaces for HDF-EOS5 products.
void Check_Aura_Product_Status()
Check if the HDF-EOS5 file is an Aura file. Special CF operations need to be used.
virtual bool Get_IgnoredInfo_Flag()
Obtain the flag to see if ignored objects should be generated.
virtual void Adjust_EOS5Dim_Info(HE5Parser *strmeta_info)
Adjust HDF-EOS5 dimension information.
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.
const std::string & getPath() const
Obtain the path of the file.
std::map< hsize_t, std::string > dimsize_to_fakedimname
Handle added dimension names.
virtual void Handle_Grid_Mapping_Vars()
Handle Grid Mapping Vars.
virtual const std::string & Get_Ignored_Msg()=0
Obtain the message that contains the ignored object info.
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.
const std::vector< Var * > & getVars() const
Public interface to obtain information of all variables.
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.
virtual void Handle_CVar()=0
Handle coordinate variables.
virtual void Adjust_Dim_Name()=0
Adjust dimension names based on different products.
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< Group * > & getGroups() const
Public interface to obtain all the group 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.
virtual void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes for general HDF5 products.
virtual void Adjust_Obj_Name()
Adjust object names based on different general NASA HDF5 products.
virtual void Retrieve_H5_CVar_Supported_Attr_Values()
Retrieve coordinate variable attributes.
void Add_Path_Coord_Attr()
Update the coordinate attribute to include path and also flatten.
virtual bool Have_Grid_Mapping_Attrs()
Check if having Grid Mapping Attrs.
virtual void Adjust_Dim_Name()
Adjust dimension name for general NASA HDF5 products.
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.
virtual 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.
virtual void Handle_SpVar()
Handle special variables for general NASA HDF5 products.
virtual bool Get_IgnoredInfo_Flag()
Obtain ignored info. flag.
void Adjust_H5_Attr_Value(Attribute *attr)
Adjust attribute values for general HDF5 products.
virtual void Handle_Unsupported_Dspace(bool)
Handle unsupported HDF5 dataspaces for general HDF5 products.
virtual void Handle_SpVar_Attr()
Handle special variable attributes for general NASA HDF5 products.
virtual void Handle_Unsupported_Others(bool)
Handle other unmapped objects/attributes for general HDF5 products.
virtual const std::string & Get_Ignored_Msg()
Get the message that contains the ignored obj. info.
void Remove_Unneeded_Objects()
Remove unneeded objects.
void Add_Dim_Name()
Add dimension name.
virtual void Flatten_Obj_Name(bool include_attr)
Flatten the object name for general NASA HDF5 products.
virtual void Handle_Grid_Mapping_Vars()
Handle Grid Mapping Vars.
virtual void Handle_DimNameClashing()
virtual void Handle_Coor_Attr()
Handle "coordinates" attributes for general HDF5 products.
void Rename_NC4_NonCoordVars()
Remove the _nc4_non_coord from the variable new names.
virtual void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes for general HDF5 products.
virtual void Add_Supplement_Attrs(bool)
Add supplemental attributes such as fullpath and original name for general NASA HDF5 products.
virtual void Handle_CVar()
Handle coordinate variables for general NASA HDF5 products.
This class is a derived class of Var. It represents a special general HDF5 product(currently ACOS and...
This class represents an HDF5 group. The group will be flattened according to the CF conventions.
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)
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.
int getCompRatio() const
Get the compression ratio of this dataset.
const std::string & getNewName() const
Get the new name of this variable.