kafka_dae_diagnostics.data

Data being served by this IOC.

Members

Data

A mutable object describing the data being served by this IOC.

FrameMetaData

Metadata associated with a set of neutron events.

class kafka_dae_diagnostics.data.Data(spectra: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]] = <factory>, callbacks: dict[str, ~collections.abc.Callable[[], None]] = <factory>, bin_boundaries: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.int32]] = <factory>, callbacks_lock: ~threading.RLock = <factory>, total_events: int = 0, total_event_messages: int = 0, total_event_megabytes: float = 0.0, largest_kafka_timestamp: float = 0.0, most_recent_kafka_timestamp: float = 0.0, start_time: float = 0.0, stop_time: float = 0.0, event_processing_lag: float = 0.0, frame_metadata: dict[int | None, ~kafka_dae_diagnostics.data.FrameMetaData] = <factory>, raw_frames_pd: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.int64]] = <factory>, good_frames_pd: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.int64]] = <factory>, raw_frames: int = 0, good_frames: int = 0, raw_uah_pd: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]] = <factory>, good_uah_pd: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]] = <factory>, raw_uah: float = 0.0, good_uah: float = 0.0, veto_mask: int = 65535)[source]

Bases: object

A mutable object describing the data being served by this IOC.

property average_data_rate: float

Average data rate of this run in MiB/s.

bin_boundaries: ndarray[tuple[Any, ...], dtype[int32]]

Time-bin boundaries (ns).

callbacks: dict[str, Callable[[], None]]

A list of callbacks to notify when data is updated.

callbacks_lock: RLock

Lock-object, must be taken when spectrum_updaters is iterated/mutated. :meta private:

property count_rate: float

Average count rate during this run in MEv/h.

Includes good counts only.

property duration: float

Run duration in seconds.

event_processing_lag: float = 0.0

Estimated time difference between an event being recorded in electronics and processed in KDAEDIAG IOC.

frame_metadata: dict[int | None, FrameMetaData]

Metadata for the current frame, keyed by Kafka partition ID.

good_frames: int = 0

Number of good (non-vetoed) frames seen in the current run.

good_frames_pd: ndarray[tuple[Any, ...], dtype[int64]]

Array of good frames collected in each period.

good_uah: float = 0.0

Good uAh collected in the current run.

good_uah_pd: ndarray[tuple[Any, ...], dtype[float64]]

Array of good uAh collected in each period.

property histogram_megabytes: float

Size of histogram array in MiB.

largest_kafka_timestamp: float = 0.0

Largest timestamp seen in an ev44, pu00 or pl72 message since the beginning of this run. Seconds since epoch.

property mev: float

Number of counts (in millions of events).

property mev_per_hour: float

Number of counts per hour (in millions of events).

most_recent_kafka_timestamp: float = 0.0

Timestamp in the most recently-processed ev44, pu00 or pl72 message. Seconds since epoch.

property num_periods: int

Number of periods in histogram.

property num_spectra: int

Number of spectra in histogram.

property num_time_channels: int

Number of time channels in histogram.

raw_frames: int = 0

Number of raw frames seen in the current run.

raw_frames_pd: ndarray[tuple[Any, ...], dtype[int64]]

Array of raw frames collected in each period.

raw_uah: float = 0.0

Raw uAh collected in the current run (including vetoed frames).

raw_uah_pd: ndarray[tuple[Any, ...], dtype[float64]]

Array of raw uAh collected in each period.

spectra: ndarray[tuple[Any, ...], dtype[float64]]

An array describing counts since last run start.

Has shape (n_periods, n_detectors, n_timechannels).

start_time: float = 0.0

Timestamp of the most recent pl72 run-start message. Seconds since epoch.

stop_time: float = 0.0

Timestamp of the most recent 6s4t run-stop message. Seconds since epoch.

total_event_megabytes: float = 0.0

Megabytes of event messages processed in this run.

total_event_messages: int = 0

Total number of ev44 event messages in this run.

total_events: int = 0

Total number of non-vetoed neutron events in this run.

veto_mask: int = 65535

Integer mask of enabled vetoes.

class kafka_dae_diagnostics.data.FrameMetaData(vetoes: int = 0, proton_charge: float = 0.0, period: int = 0)[source]

Bases: object

Metadata associated with a set of neutron events.

period: int = 0

Period into which this data was collected

proton_charge: float = 0.0

Proton charge, in uAh per frame

vetoes: int = 0

Integer mask of active vetoes in this frame.