@io_hdf5.with_read_hdf5<EOL>def read_losc_hdf5_state(f, path='<STR_LIT>', start=None, end=None,<EOL>copy=False):
<EOL>dataset = io_hdf5.find_dataset(f, '<STR_LIT>' % path)<EOL>maskset = io_hdf5.find_dataset(f, '<STR_LIT>' % path)<EOL>nddata = dataset[()]<EOL>bits = [bytes.decode(bytes(b), '<STR_LIT:utf-8>') for b in maskset[()]]<EOL>epoch = dataset.attrs['<STR_LIT>']<EOL>try:<EOL><INDENT>dt = dataset.attrs['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>dt = Quantity(<NUM_LIT:1>, '<STR_LIT:s>')<EOL><DEDENT>else:<EOL><INDENT>xunit = parse_unit(dataset.attrs['<STR_LIT>'])<EOL>dt = Quantity(dt, xunit)<EOL><DEDENT>return StateVector(nddata, bits=bits, t0=epoch, name='<STR_LIT>',<EOL>dx=dt, copy=copy).crop(start=start, end=end)<EOL>
Read a `StateVector` from a LOSC-format HDF file.

    Parameters
    ----------
    f : `str`, `h5py.HLObject`
        path of HDF5 file, or open `H5File`

    path : `str`
        path of HDF5 dataset to read.

    start : `Time`, `~gwpy.time.LIGOTimeGPS`, optional
        start GPS time of desired data

    end : `Time`, `~gwpy.time.LIGOTimeGPS`, optional
        end GPS time of desired data

    copy : `bool`, default: `False`
        create a fresh-memory copy of the underlying array

    Returns
    -------
    data : `~gwpy.timeseries.TimeSeries`
        a new `TimeSeries` containing the data read from disk