34#include <libdap/InternalErr.h>
36#include <libdap/mime_util.h>
37#include "config_hdf5.h"
43void read_cfdds(DDS&,
const string&,hid_t);
44void read_cfdas(DAS&,
const string&,hid_t);
45void read_cfdmr(DMR*,
const string&,hid_t);
47void read_cfdds(DDS & dds,
const string &filename,hid_t myfile_id) {
49 BESDEBUG(
"h5",
"Coming to CF DDS read function read_cfdds "<<endl);
52 dds.set_dataset_name(name_path(filename));
54 hid_t fileid = myfile_id;
55 H5CFModule moduletype;
58 fileid = H5Fopen(filename.c_str(),H5F_ACC_RDONLY,H5P_DEFAULT);
61 "h5_cf_dds handler: Cannot open the HDF5 file ";
63 throw InternalErr(__FILE__, __LINE__, msg);
67 moduletype = check_module(fileid);
68 if (moduletype == HDF_EOS5) {
69 map_eos5_cfdds(dds,fileid, filename);
72 map_gmh5_cfdds(dds,fileid, filename);
78void read_cfdas(DAS & das,
const string &filename,hid_t myfile_id) {
80 BESDEBUG(
"h5",
"Coming to CF DAS read function read_cfdas "<<endl);
81 hid_t fileid = myfile_id;
82 H5CFModule moduletype;
85 fileid = H5Fopen(filename.c_str(),H5F_ACC_RDONLY,H5P_DEFAULT);
88 "h5_cf_das handler: Cannot open the HDF5 file ";
90 throw InternalErr(__FILE__, __LINE__, msg);
94 moduletype = check_module(fileid);
95 if (moduletype == HDF_EOS5) {
96 map_eos5_cfdas(das,fileid, filename);
99 map_gmh5_cfdas(das,fileid, filename);
104void read_cfdmr(DMR* dmr,
const string &filename,hid_t fileid) {
106 BESDEBUG(
"h5",
"Coming to CF DMR read function read_cfdmr "<<endl);
107 H5CFModule moduletype;
108 dmr->set_name(name_path(filename));
109 dmr->set_filename(name_path(filename));
110 D4Group *d4_root = dmr->root();
111 moduletype = check_module(fileid);
112 if (moduletype == HDF_EOS5)
113 map_eos5_cfdmr(d4_root,fileid, filename);
115 map_gmh5_cfdmr(d4_root,fileid, filename);
117 BESDEBUG(
"h5",
"Coming to CF DMR read function read_cfdmr "<<endl);
The main wrapper of headers of the HDF5 OPeNDAP handler for the CF option.