33 #include <InternalErr.h>
52 string eos5_check_group =
"/HDFEOS INFORMATION";
53 string eos5_check_attr =
"HDFEOSVersion";
54 string eos5_dataset =
"StructMetadata.0";
55 htri_t has_eos_group = -1;
57 has_eos_group = H5Lexists(file_id,eos5_check_group.c_str(),H5P_DEFAULT);
59 if (has_eos_group > 0){
61 hid_t eos_group_id = -1;
62 htri_t has_eos_attr = -1;
65 if((eos_group_id = H5Gopen(file_id, eos5_check_group.c_str(),H5P_DEFAULT))<0) {
67 string msg =
"cannot open the HDF5 group ";
68 msg += eos5_check_group;
70 throw InternalErr(__FILE__, __LINE__, msg);
74 has_eos_attr = H5Aexists(eos_group_id, eos5_check_attr.c_str());
76 if (has_eos_attr >0) {
80 htri_t has_eos_dset = -1;
83 has_eos_dset = H5Lexists(eos_group_id,eos5_dataset.c_str(),H5P_DEFAULT);
86 else if(0 == has_eos_dset)
89 string msg =
"Fail to determine if the HDF5 dataset ";
92 H5Gclose(eos_group_id);
94 throw InternalErr(__FILE__, __LINE__, msg);
97 else if(0 == has_eos_attr)
100 string msg =
"Fail to determine if the HDF5 attribute ";
101 msg += eos5_check_attr;
103 H5Gclose(eos_group_id);
105 throw InternalErr(__FILE__, __LINE__, msg);
108 else if( 0 == has_eos_group)
111 string msg =
"Fail to determine if the HDF5 group ";
112 msg += eos5_check_group;
115 throw InternalErr(__FILE__, __LINE__, msg);
bool check_eos5(hid_t file_id)
bool check_jpss(hid_t fileid)
static class NCMLUtil overview
H5CFModule check_module(hid_t fileid)
This class describes the different categories of HDF5 products for the CF option. ...