libtcspc.HistogramEvent

class libtcspc.HistogramEvent(numeric_traits=None)[source]

Bases: EventType

Event carrying a snapshot of a histogram after a bin increment.

Emitted by Histogram on each incoming bin increment, carrying a view of the current histogram.

Parameters:

numeric_traits (NumericTraits or None) – Set of integer types parameterising the C++ event. None (the default) uses NumericTraits defaults.

Notes

The corresponding C++ event has the field data_bucket, a tcspc::bucket of bin_type.

Can be delivered directly to a Python sink as an EventInstance whose data_bucket attribute reads as a read-only NumPy array, and constructed via value() (the bucket field accepts a 1-D array-like).

Receiving these events at a Python sink and reading the carried bucket as a NumPy array is an efficient bulk transfer intended for production use. Constructing an individual instance by hand via value(), on the other hand, is intended for debugging and learning only.

See also

tcspc::histogram_event

The underlying C++ event type.

ExtractBucket

Extract the carried bucket as a bare NumPy array (without the event wrapper).