Read HDF5 file with python
.HDF5 file format
.HDF5 is a file format in which data are stored like a file system.
In HDF5 Data Model, we have groups and datasets. Every HDF5 file contains a root group (denoted as ‘/’) that contains other groups and datasets consists of metadata and data. Metadata is a collection of datatypes, dataspaces, properties and (optional) attributes that describe a dataset.
A general structure of a .hdf5 file is shown as
/(root group)
| |/group_1
| | |/dataset_1_1
| | | /Data values
| | | /Metadata
| | | /datatypes
| | | /dataspaces
| | | /properties
| | | /attributes
| | |/dataset_1_2
| | | /Data values
| | | /Metadata
| | | /datatypes
| | | /dataspaces
| | | /properties
| | | /attributes
| | |...
| |/group_2
| | |/dataset_2_1
| | | /Data values
| | | /Metadata
| | | /datatypes
| | | /dataspaces
| | | /properties
| | | /attributes
| | |/dataset_2_2
| | | /Data values
| | | /Metadata
| | | /datatypes
| | | /dataspaces
| | | /properties
| | | /attributes
| |...
Read and write HDF5 file with h5py
h5py is a python package that can read and write HDF5 files.