HDF5 Reader
- class gpype.backend.sources.hdf5_reader.HDF5Reader[source]
Bases:
RecordingReaderReplays a plain HDF5 (.h5) recording as if it were a live source.
Reads back what
HDF5Writerwrites – sampling rate, channel labels and roles from thegpype_metadocument, falling back to native HDF5 attributes and then to the recorded time column when metadata is absent, and to the caller’s ownsampling_ratewhen none of those can supply one – which is what lets this read a bare third-party HDF5 dataset as long as the rate is given. Markers, gaps and trust come back fromgpype_metatoo.- __init__(file_name, sampling_rate=None, frame_size=1, speed=1.0, loop=False, mode='realtime', variable_name='data', has_time_row=True, edge_id=None, **kwargs)[source]
Initialize the reader core.
- Parameters:
file_name (
str) – Path to the .h5 recording.sampling_rate (
Optional[float]) – The recording’s rate, if the file cannot say; one given must agree with a rate it records.frame_size (
int) – Samples emitted per cycle. In batch mode the frame is the whole recording.speed (
float) – Replay speed relative to real time.loop (
bool) – Start again at the end of the file.mode (
str) –realtimeorbatch.variable_name (
str) – Name of the datasetHDF5Writerwrote the recording under.has_time_row (
bool) – Whether the dataset’s first row is a time axis rather than a signal channel.edge_id (
Optional[str]) – Which edge runs this node, matched against the edge process’s –edge-id. None, the default, is every edge; ignored when the pipeline is not distributed.**kwargs – Additional arguments for the parent reader.
- Raises:
ImportError – If h5py is not installed.
ValueError – If no usable rate or dataset can be found, or a
sampling_rate,channel_countor batchframe_sizegiven by hand disagrees with the file.