find_dataset#

gwpy.io.hdf5.find_dataset(
h5o: File | Group | Dataset,
path: str | None = None,
) Dataset[source]#

Find and return the relevant dataset inside the given H5 object.

If path=None is given, and h5o contains a single dataset, that will be returned

Parameters:
h5oh5py.File, h5py.Group

the HDF5 object in which to search

pathstr, optional

the path (relative to h5o) of the desired data set

Returns:
dseth5py.Dataset

the recovered dataset object

Raises:
ValueError

if path=None and the HDF5 object contains multiple datasets

KeyError

if path is given but is not found within the HDF5 object