bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
h5dmr.h File Reference

Data structure and retrieval processing header for the default option. More...

#include <unordered_map>
#include <unordered_set>
#include <map>
#include <H5Gpublic.h>
#include <H5Fpublic.h>
#include <H5Ipublic.h>
#include <H5Tpublic.h>
#include <H5Spublic.h>
#include <H5Apublic.h>
#include <H5public.h>
#include <libdap/DDS.h>
#include <libdap/D4Group.h>
#include <libdap/D4Attributes.h>
#include <HE5Grid.h>
#include <HE5Var.h>
#include <HE5GridPara.h>
Include dependency graph for h5dmr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  eos5_cname_info_t
 
struct  eos5_dim_info_t
 
struct  eos5_dname_info_t
 
struct  eos5_grid_info_t
 
struct  link_info_t
 

Enumerations

enum class  HE5_TYPE { SW , GD , ZA }
 

Functions

void add_coord_maps (libdap::D4Group *, libdap::Array *, std::vector< std::string > &coord_name, std::unordered_map< std::string, libdap::Array * > &coname_array_maps, std::unordered_set< std::string > &)
 
void add_dap4_coverage_default (libdap::D4Group *d4_grp, const std::vector< std::string > &handled_coord_names)
 Add DAP4 coverage.
 
void add_dap4_coverage_default_internal (libdap::D4Group *d4_grp, std::unordered_map< std::string, libdap::Array * > &, std::unordered_map< std::string, libdap::Array * > &)
 
void add_dimscale_maps (libdap::Array *, std::unordered_map< std::string, libdap::Array * > &dc_array_maps, const std::unordered_set< std::string > &handled_dim_names)
 
void add_eos5_grid_vars_geo (libdap::D4Group *d4_grp, const eos5_grid_info_t &eg_info)
 
void add_eos5_grid_vars_non_geo (libdap::D4Group *d4_grp, eos5_dim_info_t &eos5_dim_info, const eos5_grid_info_t &eg_info)
 
void add_lamaz_cf_grid_mapping_attrs (libdap::BaseType *dummy_proj_cf, const eos5_grid_info_t &)
 
void add_possible_eos5_grid_vars (libdap::D4Group *, eos5_dim_info_t &)
 
void add_possible_var_cv_info (libdap::BaseType *, const eos5_dim_info_t &eos5_dim_info)
 
void add_ps_cf_grid_mapping_attrs (libdap::BaseType *dummy_proj_cf, const eos5_grid_info_t &)
 
bool breadth_first (hid_t, hid_t, const char *, libdap::D4Group *par_grp, const char *, bool, bool, std::vector< link_info_t > &, eos5_dim_info_t &, std::vector< std::string > &)
 
void build_gd_info (const HE5Grid &gd, std::unordered_map< std::string, eos5_grid_info_t > &gridname_to_info)
 
void build_grp_dim_path (const std::string &eos5_obj_name, const std::vector< HE5Dim > &dim_list, std::unordered_map< std::string, std::vector< HE5Dim > > &grppath_to_dims, HE5_TYPE eos5_type)
 
void build_var_dim_path (const std::string &eos5_obj_name, const std::vector< HE5Var > &var_list, std::unordered_map< std::string, std::vector< std::string > > &varpath_to_dims, HE5_TYPE eos5_type, bool is_geo)
 
bool check_soft_external_links (libdap::D4Group *par_grp, hid_t pid, int &slinkindex, const char *gname, const std::vector< char > &oname, bool handle_softlink)
 
std::string get_hardlink_dmr (hid_t, const std::string &)
 
void get_softlink (libdap::D4Group *par_grp, hid_t, const std::string &, int, size_t)
 
int get_strmetadata_num (const string &meta_str)
 
void handle_absolute_path_cv (const libdap::D4Group *, std::string &coord_name)
 
void handle_actual_dataset (libdap::D4Group *par_grp, hid_t pid, const string &full_path_name, const string &fname, bool use_dimscale, bool is_eos5, eos5_dim_info_t &eos5_dim_info)
 
void handle_child_grp (hid_t file_id, hid_t pid, const char *gname, libdap::D4Group *par_grp, const char *fname, bool use_dimscale, bool is_eos5, std::vector< link_info_t > &hdf5_hls, eos5_dim_info_t &eos5_dim_info, std::vector< std::string > &handled_cv_names, const std::vector< char > &oname)
 
void handle_eos5_datasets (libdap::D4Group *par_grp, const char *gname, eos5_dim_info_t &eos5_dim_info)
 
void handle_pure_dimension (libdap::D4Group *par_grp, hid_t pid, const std::vector< char > &oname, bool is_eos5, const std::string &full_path_name)
 
void handle_relative_path_cv (const libdap::D4Group *, std::string &coord_name)
 
void handle_relative_path_cvname_internal (const libdap::D4Group *d4_grp, std::string &coord_name, unsigned short sep_count)
 
bool is_eos5_grid_grp (libdap::D4Group *, const eos5_dim_info_t &eos5_dim_info, eos5_grid_info_t &)
 
void make_attributes_to_cf (libdap::BaseType *, const eos5_dim_info_t &eos5_dim_info)
 
void make_coord_names_fpath (libdap::D4Group *, std::vector< std::string > &coord_names)
 
void map_h5_attrs_to_dap4 (hid_t oid, libdap::D4Group *d4g, libdap::BaseType *d4b, libdap::Structure *d4s, int flag)
 A function that maps HDF5 attributes to DAP4.
 
void map_h5_dset_hardlink_to_d4 (hid_t h5_objid, const std::string &full_path, libdap::BaseType *d4b, libdap::Structure *d4s, int flag)
 
void map_h5_varpath_to_dap4_attr (libdap::D4Group *d4g, libdap::BaseType *d4b, libdap::Structure *d4s, const std::string &, short flag)
 A function that maps HDF5 object full path as an attribute to DAP4.
 
bool no_eos5_grid_vars_in_grp (libdap::D4Group *d4_group, const eos5_grid_info_t &eg_info)
 
void obtain_coord_names (libdap::Array *, std::vector< std::string > &coord_names)
 
void obtain_ds_name_array_maps (libdap::D4Group *, std::unordered_map< std::string, libdap::Array * > &, const std::vector< std::string > &handled_coord_names)
 
void obtain_ds_name_array_maps_internal (libdap::BaseType *v, std::unordered_map< string, libdap::Array * > &dsn_array_maps, const std::vector< std::string > &handled_all_cv_names)
 
bool obtain_eos5_dim (const std::string &varname, const std::unordered_map< std::string, vector< std::string > > &varpath_to_dims, vector< std::string > &dimnames)
 
void obtain_eos5_dims (hid_t fileid, eos5_dim_info_t &)
 
bool obtain_eos5_grp_dim (const std::string &varname, const std::unordered_map< std::string, vector< HE5Dim > > &grppath_to_dims, vector< std::string > &dimnames)
 
void obtain_handled_dim_names (libdap::Array *, std::unordered_set< std::string > &handled_dim_names)
 
void obtain_hdf5_object_name (hid_t pid, hsize_t obj_index, const char *gname, std::vector< char > &oname)
 
void obtain_multi_string_coord_names (libdap::D4Attribute *d4_attr, std::vector< std::string > &coord_names)
 
std::string obtain_new_varname (const std::string &varname, bool use_dimscale, bool is_eos5)
 
bool obtain_no_path_cv (libdap::D4Group *, std::string &coord_name)
 
void obtain_struct_metadata_info (hid_t ecs_grp_id, std::vector< std::string > &s_oname, std::vector< bool > &smetatype, int &strmeta_num_total, bool &strmeta_no_suffix, hsize_t nelems)
 
int obtain_struct_metadata_value (hid_t ecs_grp_id, const std::vector< std::string > &s_oname, const std::vector< bool > &smetatype, hsize_t nelems, std::vector< std::string > &strmeta_value, std::string &total_strmeta_value)
 
int obtain_struct_metadata_value_internal (hid_t ecs_grp_id, const vector< string > &s_oname, vector< string > &strmeta_value, string &total_strmeta_value, const string &finstr, hsize_t i)
 
hsize_t obtain_unlim_pure_dim_size (hid_t pid, const std::string &dname)
 
hsize_t obtain_unlim_pure_dim_size_internal (hid_t dset_id, const std::string &dname, const std::string &reference_name)
 
hsize_t obtain_unlim_pure_dim_size_internal_value (hid_t dset_id, hid_t attr_id, hid_t atype_id, const std::string &reference_name, const std::string &dname)
 
void read_objects (libdap::D4Group *d4_grp, hid_t, const std::string &varname, const std::string &filename, hid_t, bool, bool, eos5_dim_info_t &)
 
void read_objects_base_type (libdap::D4Group *d4_grp, hid_t, const std::string &varname, const std::string &filename, hid_t, bool, bool, eos5_dim_info_t &)
 
void read_objects_basetype_attr_hl (const std::string &varname, libdap::BaseType *bt, hid_t dset_id, bool is_eos5)
 
void read_objects_structure (libdap::D4Group *d4_grp, const std::string &varname, const std::string &filename, hid_t, bool, bool)
 
void read_objects_structure_arrays (libdap::D4Group *d4_grp, libdap::Structure *structure, const std::string &varname, const std::string &newvarname, const std::string &filename, hid_t dset_id, bool is_eos5)
 
void read_objects_structure_scalar (libdap::D4Group *d4_grp, libdap::Structure *structure, const std::string &varname, hid_t dset_id, bool is_eos5)
 
string read_struct_metadata (hid_t s_file_id)
 EOS5 handling.
 
void remove_empty_coord_names (std::vector< std::string > &)
 
void reorder_vars (libdap::D4Group *, const std::map< std::string, libdap::Array * > &coname_array_maps, const std::map< std::string, libdap::Array * > &dc_array_maps)
 
void reorder_vars_internal (libdap::D4Group *d4_grp, const std::vector< int > &cv_pos, const std::vector< libdap::BaseType * > &cv_obj_ptr, int stop_index)
 
void reorder_vars_internal_final_phase (libdap::D4Group *d4_grp, const std::vector< int > &mov_cv_pos, const std::vector< int > &mov_front_pos, const std::vector< libdap::BaseType * > &mov_front_vptr, const std::vector< libdap::BaseType * > &mov_cv_ptr)
 

Detailed Description

Data structure and retrieval processing header for the default option.

This file is part of h5_dap_handler, A C++ implementation of the DAP handler for HDF5 data.

It defines functions that describe and retrieve group/dataset from HDF5 files.

Author
Hyo-Kyung Lee hyokl.nosp@m.ee@h.nosp@m.dfgro.nosp@m.up.o.nosp@m.rg
Kent Yang myang.nosp@m.6@hd.nosp@m.fgrou.nosp@m.p.or.nosp@m.g

Definition in file h5dmr.h.

Enumeration Type Documentation

◆ HE5_TYPE

enum class HE5_TYPE
strong

Definition at line 79 of file h5dmr.h.

Function Documentation

◆ add_dap4_coverage_default()

void add_dap4_coverage_default ( libdap::D4Group * d4_grp,
const std::vector< std::string > & handled_coord_names )

Add DAP4 coverage.

Definition at line 1937 of file h5dmr.cc.

◆ add_dimscale_maps()

void add_dimscale_maps ( libdap::Array * var,
std::unordered_map< std::string, libdap::Array * > & dc_array_maps,
const std::unordered_set< std::string > & handled_dim_names )

Definition at line 2379 of file h5dmr.cc.

◆ add_eos5_grid_vars_geo()

void add_eos5_grid_vars_geo ( libdap::D4Group * d4_grp,
const eos5_grid_info_t & eg_info )

Definition at line 2652 of file h5dmr.cc.

◆ add_eos5_grid_vars_non_geo()

void add_eos5_grid_vars_non_geo ( libdap::D4Group * d4_grp,
eos5_dim_info_t & eos5_dim_info,
const eos5_grid_info_t & eg_info )

Definition at line 2721 of file h5dmr.cc.

◆ add_lamaz_cf_grid_mapping_attrs()

void add_lamaz_cf_grid_mapping_attrs ( libdap::BaseType * dummy_proj_cf,
const eos5_grid_info_t & eg_info )

Definition at line 3057 of file h5dmr.cc.

◆ add_possible_eos5_grid_vars()

void add_possible_eos5_grid_vars ( libdap::D4Group * d4_grp,
eos5_dim_info_t & eos5_dim_info )

Definition at line 2609 of file h5dmr.cc.

◆ add_possible_var_cv_info()

void add_possible_var_cv_info ( libdap::BaseType * var,
const eos5_dim_info_t & eos5_dim_info )

Definition at line 3095 of file h5dmr.cc.

◆ add_ps_cf_grid_mapping_attrs()

void add_ps_cf_grid_mapping_attrs ( libdap::BaseType * dummy_proj_cf,
const eos5_grid_info_t & eg_info )

Definition at line 2998 of file h5dmr.cc.

◆ breadth_first()

bool breadth_first ( hid_t file_id,
hid_t pid,
const char * gname,
D4Group * par_grp,
const char * fname,
bool use_dimscale,
bool is_eos5,
vector< link_info_t > & hdf5_hls,
eos5_dim_info_t & eos5_dim_info,
vector< string > & handled_cv_names )

bool breadth_first(const hid_t file_id,hid_t pid, const char gname, D4Group par_grp, const char *fname,bool use_dimscale,bool is_eos5, vector<link_info_t> & hdf5_hls, eos5_dim_info_t & eos5_dim_info, vector<string> & handled_cv_names)

Parameters
file_idfile_id(this is necessary for searching the hardlinks of a dataset)
pidgroup id
gnamegroup name (the absolute path from the root group)
par_grpDAP4 parent group
fnamethe HDF5 file name( necessary parameters for HDF5 Arrays)
use_dimscalewhether dimension scales are used.
is_eos5whether this is an HDF-EOS5 file.
hdf5_hlsthe vector to save all the hardlink info.
eos5_dim_infoin/out the struct to save the HDF-EOS5 dimension info.
handled_cv_namesin/out the vector to remember the handled cv names(for the use of DAP4 coverage support)
Returns
true,
Remarks
hard link is treated as a dataset.
will return error message to the DAP interface.
The reason to use breadth_first is that the DMR representation
needs to show the dimension names and the variables under the group before showing the group names. So we use this search. This is for the default option.
See also
depth_first(hid_t pid, char *gname, DDS & dds, const char *fname) in h5dds.cc

To keep track of soft links.

Definition at line 116 of file h5dmr.cc.

◆ build_gd_info()

void build_gd_info ( const HE5Grid & gd,
std::unordered_map< std::string, eos5_grid_info_t > & gridname_to_info )

Definition at line 2931 of file h5dmr.cc.

◆ build_grp_dim_path()

void build_grp_dim_path ( const std::string & eos5_obj_name,
const std::vector< HE5Dim > & dim_list,
std::unordered_map< std::string, std::vector< HE5Dim > > & grppath_to_dims,
HE5_TYPE eos5_type )

Definition at line 1588 of file h5dmr.cc.

◆ build_var_dim_path()

void build_var_dim_path ( const std::string & eos5_obj_name,
const std::vector< HE5Var > & var_list,
std::unordered_map< std::string, std::vector< std::string > > & varpath_to_dims,
HE5_TYPE eos5_type,
bool is_geo )

Definition at line 1637 of file h5dmr.cc.

◆ check_soft_external_links()

bool check_soft_external_links ( libdap::D4Group * par_grp,
hid_t pid,
int & slinkindex,
const char * gname,
const std::vector< char > & oname,
bool handle_softlink )

Definition at line 252 of file h5dmr.cc.

◆ get_hardlink_dmr()

std::string get_hardlink_dmr ( hid_t h5obj_id,
const std::string & oname )

Definition at line 1127 of file h5dmr.cc.

◆ get_softlink()

void get_softlink ( D4Group * par_grp,
hid_t h5obj_id,
const string & oname,
int index,
size_t val_size )

will put softlink information into DAP4.

Parameters
par_grpDAP4 group
h5_obj_idobject id
onameobject name: absolute name of a group
indexLink index
val_sizevalue size
Returns
void
Remarks
In case of error, it throws an exception

Definition at line 1069 of file h5dmr.cc.

◆ handle_absolute_path_cv()

void handle_absolute_path_cv ( const libdap::D4Group * d4_grp,
std::string & coord_name )

Definition at line 2163 of file h5dmr.cc.

◆ handle_child_grp()

void handle_child_grp ( hid_t file_id,
hid_t pid,
const char * gname,
libdap::D4Group * par_grp,
const char * fname,
bool use_dimscale,
bool is_eos5,
std::vector< link_info_t > & hdf5_hls,
eos5_dim_info_t & eos5_dim_info,
std::vector< std::string > & handled_cv_names,
const std::vector< char > & oname )

Definition at line 384 of file h5dmr.cc.

◆ handle_eos5_datasets()

void handle_eos5_datasets ( libdap::D4Group * par_grp,
const char * gname,
eos5_dim_info_t & eos5_dim_info )

Definition at line 343 of file h5dmr.cc.

◆ handle_pure_dimension()

void handle_pure_dimension ( libdap::D4Group * par_grp,
hid_t pid,
const std::vector< char > & oname,
bool is_eos5,
const std::string & full_path_name )

Definition at line 306 of file h5dmr.cc.

◆ handle_relative_path_cv()

void handle_relative_path_cv ( const libdap::D4Group * d4_grp,
std::string & coord_name )

Definition at line 2175 of file h5dmr.cc.

◆ handle_relative_path_cvname_internal()

void handle_relative_path_cvname_internal ( const libdap::D4Group * d4_grp,
std::string & coord_name,
unsigned short sep_count )

Definition at line 2208 of file h5dmr.cc.

◆ is_eos5_grid_grp()

bool is_eos5_grid_grp ( libdap::D4Group * d4_group,
const eos5_dim_info_t & eos5_dim_info,
eos5_grid_info_t & eg_info )

Definition at line 2877 of file h5dmr.cc.

◆ make_coord_names_fpath()

void make_coord_names_fpath ( libdap::D4Group * d4_grp,
std::vector< std::string > & coord_names )

Definition at line 2112 of file h5dmr.cc.

◆ map_h5_attrs_to_dap4()

void map_h5_attrs_to_dap4 ( hid_t oid,
libdap::D4Group * d4g,
libdap::BaseType * d4b,
libdap::Structure * d4s,
int flag )

A function that maps HDF5 attributes to DAP4.

◆ map_h5_varpath_to_dap4_attr()

void map_h5_varpath_to_dap4_attr ( libdap::D4Group * d4g,
libdap::BaseType * d4b,
libdap::Structure * d4s,
const std::string & ,
short flag )

A function that maps HDF5 object full path as an attribute to DAP4.

◆ no_eos5_grid_vars_in_grp()

bool no_eos5_grid_vars_in_grp ( libdap::D4Group * d4_group,
const eos5_grid_info_t & eg_info )

Definition at line 2897 of file h5dmr.cc.

◆ obtain_eos5_dims()

void obtain_eos5_dims ( hid_t fileid,
eos5_dim_info_t & eos5_dim_info )

Definition at line 1497 of file h5dmr.cc.

◆ obtain_hdf5_object_name()

void obtain_hdf5_object_name ( hid_t pid,
hsize_t obj_index,
const char * gname,
std::vector< char > & oname )

Definition at line 228 of file h5dmr.cc.

◆ obtain_new_varname()

std::string obtain_new_varname ( const std::string & varname,
bool use_dimscale,
bool is_eos5 )

Definition at line 791 of file h5dmr.cc.

◆ obtain_no_path_cv()

bool obtain_no_path_cv ( libdap::D4Group * d4_grp,
std::string & coord_name )

Definition at line 2132 of file h5dmr.cc.

◆ obtain_struct_metadata_info()

void obtain_struct_metadata_info ( hid_t ecs_grp_id,
std::vector< std::string > & s_oname,
std::vector< bool > & smetatype,
int & strmeta_num_total,
bool & strmeta_no_suffix,
hsize_t nelems )

Definition at line 1243 of file h5dmr.cc.

◆ obtain_struct_metadata_value()

int obtain_struct_metadata_value ( hid_t ecs_grp_id,
const std::vector< std::string > & s_oname,
const std::vector< bool > & smetatype,
hsize_t nelems,
std::vector< std::string > & strmeta_value,
std::string & total_strmeta_value )

Definition at line 1337 of file h5dmr.cc.

◆ obtain_unlim_pure_dim_size()

hsize_t obtain_unlim_pure_dim_size ( hid_t pid,
const std::string & dname )

Definition at line 1737 of file h5dmr.cc.

◆ obtain_unlim_pure_dim_size_internal()

hsize_t obtain_unlim_pure_dim_size_internal ( hid_t dset_id,
const std::string & dname,
const std::string & reference_name )

Definition at line 1764 of file h5dmr.cc.

◆ obtain_unlim_pure_dim_size_internal_value()

hsize_t obtain_unlim_pure_dim_size_internal_value ( hid_t dset_id,
hid_t attr_id,
hid_t atype_id,
const std::string & reference_name,
const std::string & dname )

Definition at line 1792 of file h5dmr.cc.

◆ read_objects()

void read_objects ( libdap::D4Group * d4_grp,
hid_t pid,
const std::string & varname,
const std::string & filename,
hid_t dset_id,
bool use_dimscale,
bool is_eos5,
eos5_dim_info_t & eos5_dim_info )

Definition at line 478 of file h5dmr.cc.

◆ read_objects_base_type()

void read_objects_base_type ( D4Group * d4_grp,
hid_t pid,
const string & varname,
const string & filename,
hid_t dset_id,
bool use_dimscale,
bool is_eos5,
eos5_dim_info_t & eos5_dim_info )

const string & filename,hid_t dset_id, bool use_dimscale bool is_eos5, eos5_dim_info_t eos5_dim_info)

Definition at line 576 of file h5dmr.cc.

◆ read_objects_structure()

void read_objects_structure ( D4Group * d4_grp,
const string & varname,
const string & filename,
hid_t dset_id,
bool use_dimscale,
bool is_eos5 )

fills in information of a structure dataset (name, data type, data space) into a DAP4 group. HDF5 compound datatype will map to DAP structure.

Parameters
d4_grpDAP4 group
varnameAbsolute name of structure
filenameThe HDF5 file name that maps to the DDS dataset name.
dset_idHDF5 dataset ID
use_dimscaleboolean that indicates if dimscale is used.
is_eos5boolean that indicates if this is an HDF-EOS5 file.
Exceptions
errora string of error message to the dods interface.

Definition at line 696 of file h5dmr.cc.

◆ read_objects_structure_arrays()

void read_objects_structure_arrays ( libdap::D4Group * d4_grp,
libdap::Structure * structure,
const std::string & varname,
const std::string & newvarname,
const std::string & filename,
hid_t dset_id,
bool is_eos5 )

Definition at line 720 of file h5dmr.cc.

◆ read_objects_structure_scalar()

void read_objects_structure_scalar ( libdap::D4Group * d4_grp,
libdap::Structure * structure,
const std::string & varname,
hid_t dset_id,
bool is_eos5 )

Definition at line 779 of file h5dmr.cc.

◆ read_struct_metadata()

string read_struct_metadata ( hid_t s_file_id)

EOS5 handling.

Definition at line 1177 of file h5dmr.cc.

◆ remove_empty_coord_names()

void remove_empty_coord_names ( std::vector< std::string > & coord_names)

Definition at line 2243 of file h5dmr.cc.