bes  Updated for version 3.20.10
h5commoncfdap.h
Go to the documentation of this file.
1 // This file is part of hdf5_handler: an HDF5 file handler for the OPeNDAP
2 // data server.
3 
4 // Copyright (c) 2011-2016 The HDF Group, Inc. and OPeNDAP, Inc.
5 //
6 // This is free software; you can redistribute it and/or modify it under the
7 // terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 2.1 of the License, or (at your
9 // option) any later version.
10 //
11 // This software is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
21 // You can contact The HDF Group, Inc. at 1800 South Oak Street,
22 // Suite 203, Champaign, IL 61820
23 
32 
33 #ifndef _H5COMMONCFDAP_H
34 #define _H5COMMONCFDAP_H
35 
36 #include <string>
37 
38 #include <libdap/DMR.h>
39 #include <libdap/DDS.h>
40 #include <libdap/DAS.h>
41 #include <libdap/D4Attributes.h>
42 #include "hdf5.h"
43 
44 #include "HDF5CF.h"
45 
46 
47 void gen_dap_onevar_dds(libdap::DDS &dds, const HDF5CF::Var*, const hid_t, const std::string &);
48 void gen_dap_oneobj_das(libdap::AttrTable*, const HDF5CF::Attribute*, const HDF5CF::Var*);
49 void gen_dap_onevar_dmr(libdap::D4Group*, const HDF5CF::Var*, const hid_t, const std::string &);
50 void map_cfh5_var_attrs_to_dap4(const HDF5CF::Var*var,libdap::BaseType*new_var);
51 void map_cfh5_grp_attr_to_dap4(libdap::D4Group*, const HDF5CF::Attribute*);
52 void map_cfh5_attr_container_to_dap4(libdap::D4Attribute *, const HDF5CF::Attribute*);
53 
54 
55 void add_cf_grid_mapping_attr(libdap::DAS &das, const std::vector<HDF5CF::Var*>& vars, const std::string& cf_projection,
56  const std::string & dim0name, hsize_t dim0size, const std::string &dim1name, hsize_t dim1size);
57 #if 0
58 void add_cf_grid_cv_attrs(DAS & das, const vector<HDF5CF::Var*>& vars, EOS5GridPCType cv_proj_code,
59  float cv_point_lower, float cv_point_upper, float cv_point_left, float cv_point_right,
60  const vector<HDF5CF::Dimension*>& dims,const vector<double>& params,const unsigned short);
61 #endif
62 void add_cf_grid_cv_attrs(libdap::DAS & das, const std::vector<HDF5CF::Var*>& vars, EOS5GridPCType cv_proj_code,
63  const std::vector<HDF5CF::Dimension*>& dims,const std::vector<double>& params,const unsigned short);
64 
65 void add_cf_projection_attrs(libdap::DAS &,EOS5GridPCType ,const std::vector<double> &,const std::string&);
66 void add_cf_grid_cvs(libdap::DDS & dds, EOS5GridPCType cv_proj_code, float cv_point_lower, float cv_point_upper,
67  float cv_point_left, float cv_point_right, const std::vector<HDF5CF::Dimension*>& dims);
68 
69 void add_cf_grid_mapinfo_var(libdap::DDS &dds,const EOS5GridPCType,const unsigned short);
70 bool need_special_attribute_handling(const HDF5CF::Attribute*, const HDF5CF::Var*);
71 void gen_dap_special_oneobj_das(libdap::AttrTable*, const HDF5CF::Attribute*, const HDF5CF::Var*);
72 bool is_fvalue_valid(H5DataType, const HDF5CF::Attribute*);
73 void gen_dap_str_attr(libdap::AttrTable*, const HDF5CF::Attribute *);
74 void add_ll_valid_range(libdap::AttrTable*, bool is_lat);
75 void map_cfh5_var_attrs_to_dap4_int64(const HDF5CF::Var*var,libdap::BaseType*new_var);
76 bool need_attr_values_for_dap4(const HDF5CF::Var*var);
77 void check_update_int64_attr(const std::string &, const HDF5CF::Attribute *);
78 void handle_coor_attr_for_int64_var(const HDF5CF::Attribute *, const std::string &,std::string&,bool);
79 libdap::D4Attribute *gen_dap4_attr(const HDF5CF::Attribute *);
80 std::string get_cf_string(std::string & s);
81 std::string get_cf_string_helper(std::string & s);
82 
83 void add_gm_spcvs(libdap::D4Group *d4_root, EOS5GridPCType cv_proj_code, float cv_point_lower, float cv_point_upper,
84  float cv_point_left, float cv_point_right, const std::vector<HDF5CF::Dimension*>& dims);
85 void add_gm_spcvs_attrs(libdap::BaseType *d4_var,const bool is_dim0);
86 
87 void add_cf_grid_cv_dap4_attrs(libdap::D4Group *d4_root, const std::string& cf_projection, const std::vector<HDF5CF::Dimension*>&dims);
88 
89 void add_gm_oneproj_var_dap4_attrs(libdap::BaseType *d4_var,EOS5GridPCType cv_proj_code,const std::vector<double> &eos5_proj_params);
90 
91 void add_var_dap4_attr(libdap::BaseType *d4_var,const std::string& attr_name, D4AttributeType attr_type, const std::string& attr_value);
92 
93 void add_grp_dap4_attr(libdap::D4Group *d4_grp,const std::string& attr_name, D4AttributeType attr_type, const std::string& attr_value);
94 
95 
96 
97 
98 #endif
This class specifies the core engineering of mapping HDF5 to DAP by following CF.
This class represents one attribute.
Definition: HDF5CF.h:189
This class represents one HDF5 dataset(CF variable)
Definition: HDF5CF.h:259