open_hdf5#
- gwpy.io.hdf5.open_hdf5( ) h5py.HLObject[source]#
Open a
h5py.Filefrom disk, gracefully handling corner cases.If
sourceis already an HDF5 object, it is simply returned. Otherwise, it is opened as an HDF5 file in the given mode.- Parameters:
- sourcefile-like,
h5py.Group,h5py.Dataset The file path or file-like object to open, or an existing HDF5 object to return as-is.
- mode
str The mode in which to open the file, default:
'r'.- kwargs
Any additional keyword arguments are passed directly to
h5py.File.
- sourcefile-like,
- Returns:
- h5obj
h5py.File,h5py.Group,h5py.Dataset The opened HDF5 file object, or the original object if it was already an HDF5 object.
- h5obj