PyNE C++
Classes | Functions
h5wrap Namespace Reference

Wrapper for standard HDF5 operations. More...

Classes

class  FileNotHDF5
 Custom exception for when an existing file is not in a valid HDF5 format. More...
 
class  GroupNotFound
 Custom exception for when a group cannot be found in an HDF5 file. More...
 
class  HDF5BoundsError
 Custom exception for HDF5 indexing errors. More...
 
class  HomogenousTypeTable
 
class  PathNotFound
 Custom exception for when a path is not found in an HDF5 file. More...
 

Functions

template<typename T >
get_array_index (hid_t dset, int n, hid_t dtype=H5T_NATIVE_DOUBLE)
 
template<typename T >
std::set< T > h5_array_to_cpp_set (hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
 
template<typename T >
std::vector< T > h5_array_to_cpp_vector_1d (hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
 
template<typename T >
std::vector< std::vector< T > > h5_array_to_cpp_vector_2d (hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
 
template<typename T >
std::vector< std::vector< std::vector< T > > > h5_array_to_cpp_vector_3d (hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
 
hid_t _get_PYTABLES_COMPLEX128 ()
 
bool path_exists (hid_t h5file, std::string path)
 

Detailed Description

Wrapper for standard HDF5 operations.

Function Documentation

◆ _get_PYTABLES_COMPLEX128()

hid_t h5wrap::_get_PYTABLES_COMPLEX128 ( )
inline

Create an HDF5 data type for complex 128 bit data, which happens to match the complex data type that is used by PyTables ^_~.

◆ get_array_index()

template<typename T >
template double h5wrap::get_array_index ( hid_t  dset,
int  n,
hid_t  dtype = H5T_NATIVE_DOUBLE 
)

Retrieves the nth index out of the dataset dset (which has an HDF5 datatype dtype). The value is returned as the C/C++ type given by T.

◆ h5_array_to_cpp_set()

template<typename T >
std::set<T> h5wrap::h5_array_to_cpp_set ( hid_t  h5file,
std::string  data_path,
hid_t  dtype = H5T_NATIVE_DOUBLE 
)

Reads in data from an HDF5 file as a C++ set. T should roughly match dtype.

Parameters
h5fileHDF5 file id for an open file.
data_pathpath to the data in the open file.
dtypeHDF5 data type for the data set at data_path.
Returns
an in memory set of type T.

◆ h5_array_to_cpp_vector_1d()

template<typename T >
std::vector<T> h5wrap::h5_array_to_cpp_vector_1d ( hid_t  h5file,
std::string  data_path,
hid_t  dtype = H5T_NATIVE_DOUBLE 
)

Reads in data from an HDF5 file as a 1 dimiensional vector. T should roughly match dtype.

Parameters
h5fileHDF5 file id for an open file.
data_pathpath to the data in the open file.
dtypeHDF5 data type for the data set at data_path.
Returns
an in memory 1D vector of type T.

◆ h5_array_to_cpp_vector_2d()

template<typename T >
std::vector< std::vector<T> > h5wrap::h5_array_to_cpp_vector_2d ( hid_t  h5file,
std::string  data_path,
hid_t  dtype = H5T_NATIVE_DOUBLE 
)

Reads in data from an HDF5 file as a 2 dimiensional vector. T should roughly match dtype.

Parameters
h5fileHDF5 file id for an open file.
data_pathpath to the data in the open file.
dtypeHDF5 data type for the data set at data_path.
Returns
an in memory 2D vector of type T.

◆ h5_array_to_cpp_vector_3d()

template<typename T >
std::vector< std::vector< std::vector<T> > > h5wrap::h5_array_to_cpp_vector_3d ( hid_t  h5file,
std::string  data_path,
hid_t  dtype = H5T_NATIVE_DOUBLE 
)

Reads in data from an HDF5 file as a 3 dimiensional vector. T should roughly match dtype.

Parameters
h5fileHDF5 file id for an open file.
data_pathpath to the data in the open file.
dtypeHDF5 data type for the data set at data_path.
Returns
an in memory 3D vector of type T.

◆ path_exists()

bool h5wrap::path_exists ( hid_t  h5file,
std::string  path 
)
inline

Determines if a path exists in an hdf5 file.

Parameters
h5fileHDF5 file id for an open file.
pathpath to the data in the open file.
Returns
true or false