libtcspc.PyAcquisitionReader

class libtcspc.PyAcquisitionReader[source]

Bases: ABC

Acquisition reader implemented in Python and supplied as an argument upon creation of the execution context.

See also

Acquire

Source processor that drives the reader.

AcquireAccess

Runtime access object providing halt().

abstractmethod __call__(buffer)[source]

Read acquired data into the given buffer.

The element type of the buffer will match that of the Acquire processor. An implementation of this method should read at most the number of elements that fit in buffer, and return the number read. If the end of the data stream has been reached, return None instead. To signal a read error, raise an exception; do not return None for error conditions.

Implementations must not store buffer; accessing it after returning will crash the Python interpreter (this dangerous behavior is a compromise for performance, to avoid copying the data unnecessarily).

Parameters:

buffer (ndarray)

Return type:

int | None