nexxT.filters.hdf5 module

This module provides a generic disk reader and writer based on HDF5. To use it, you have to enable the “HDF5” feature during installation, i.e. pip install nexxT[HDF5]

class nexxT.filters.hdf5.Hdf5File(filename)[source]

Bases: GenericReaderFile

Adaptation of hdf5 file format

__init__(filename)[source]
allStreams()[source]

Returns the streams in this file.

Returns:

a list of strings

close()[source]

Closes the file.

Returns:

getNumberOfSamples(stream)[source]

Returns the number of samples in the given stream

Parameters:

stream – the name of the stream as a string

Returns:

the number of samples in the stream

getRcvTimestamp(stream, streamIdx)[source]

Returns the recevie timestamp of the given (stream, streamIdx) sample. The default implementation uses readSample(…). It may be replaced by a more efficient implementation.

Parameters:
  • stream – the name of the stream as a string

  • streamIdx – the stream index as an integer

Returns:

the timestamp as an integer (see also getTimestampResolution)

getTimestampResolution()[source]

Returns the resolution of the timestamps in ticks per second.

Returns:

ticks per second as an integer

readSample(stream, streamIdx)[source]

Returns the referenced sample as a tuple (content, dataType, dataTimestamp, rcvTimestamp).

Parameters:
  • stream – the stream

  • idx – the index of the sample in the stream

Returns:

(content: QByteArray, dataType: str, dataTimestamp: int, receiveTimestamp: int)

class nexxT.filters.hdf5.Hdf5Reader(env)[source]

Bases: GenericReader

Reader for the nexxT default file format based on hdf5.

getNameFilter()[source]

Returns the name filter associated with the input files.

Returns:

a list of strings, e.g. [”.h5”, “.hdf5”]

openFile(filename)[source]

Opens the given file and return an instance of GenericReaderFile.

Returns:

an instance of GenericReaderFile

staticMetaObject = PySide6.QtCore.QMetaObject("Hdf5Reader" inherits "GenericReader": )
class nexxT.filters.hdf5.Hdf5Writer(env)[source]

Bases: Filter

Generic nexxT filter for writing HDF5 files.

__init__(env)[source]

Filter Constructor.

Parameters:
  • dynInPortsSupported – Flag whether this filter supports dynamic input ports

  • dynOutPortsSupported – Flag whether this filter supports dynamic output ports

  • environment – FilterEnvironment instance which shall be passed through from the filter constructor.

onInit()[source]

This function can be overwritten for performing initialization tasks related to dynamic ports.

Returns:

None

onPortDataChanged(port)[source]

Called when new data arrives at a port.

Parameters:

port – the port where the new data is available.

Returns:

onStart()[source]

Registers itself to the recording control service

Returns:

onStop()[source]

De-registers itself from the recording control service

Returns:

startRecording(directory)[source]

Called on a recording start event.

Parameters:

directory – the directory where the recording is expected to be created.

Returns:

staticMetaObject = PySide6.QtCore.QMetaObject("Hdf5Writer" inherits "Filter": Methods:   #4 type=Signal, signature=statusUpdate(QString,double,qlonglong), parameters=QString, double, qlonglong )
statusUpdate
stopRecording()[source]

Called on a recording stop event.

Parameters:

directory – the directory where the recording is expected to be created.

Returns: