ESRF logo

hdf5plugin¶

hdf5plugin packages a set of HDF5 compression filters (namely: blosc, bitshuffle, lz4, FCIDECOMP, ZFP, Zstandard) and makes them usable from the Python programming language through h5py.

h5py is a thin, pythonic wrapper around HDF5.

 

 

Presenter: Thomas VINCENT

European HDF Users Group Summer 2021, July 7-8, 2021

In [1]:
from h5glance import H5Glance  # Browsing HDF5 files
H5Glance("data.h5")
Out[1]:
    • compressed_data_bitshuffle_lz4 [📋]: 1969 × 2961 entries, dtype: uint8
    • copyright [📋]: scalar entries, dtype: UTF-8 string
    • data [📋]: 1969 × 2961 entries, dtype: uint8
In [4]:
import h5py  # Pythonic HDF5 wrapper: https://docs.h5py.org/

h5file = h5py.File("data.h5", mode="r")  # Open HDF5 file in read mode
data = h5file["/data"][()]               # Access HDF5 dataset "/data"
plt.imshow(data); plt.colorbar()         # Display data
Out[4]:
<matplotlib.colorbar.Colorbar at 0x11410d198>