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.

RunState

Enum describing the possible run-states.

class kafka_dae_diagnostics.data.Data(stale_event_timeout_s: float = 5.0, vetoing_percentage: float = 50.0, 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, most_recent_event_processing_timestamp: float = <factory>, 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, veto_diagnostics: ~kafka_dae_diagnostics.veto_diagnostics.VetoDiagnostics = <factory>, veto_names_array: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.str_]] = <factory>, current_period: int = 0)[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.

current_period: int = 0

The zero-indexed period into which the most recent data was received.

property duration: float

Run duration in seconds.

property enabled_vetos_array: ndarray[tuple[Any, ...], dtype[int32]]

Array describing whether each of the 32 veto bits is currently enabled.

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_event_processing_timestamp: float

The computer timestamp at which the most recent event message was processed by this IOC.

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.

property run_state: RunState

The current run state.

  • SETUP: the electronics is currently idle, not performing a run.

  • PROCESSING: the electronics should be running, but we have not received

    event messages from Kafka recently. This is a fault condition.

  • VETOING: the electronics has sent us frames, but more than 50% of the recent

    frames have been vetoed.

  • RUNNING: the electronics has sent us frames, less than 50% of the recent

    frames have been vetoed.

property seconds_since_last_event_message: float

The number of seconds elapsed since the last event message was processed by this IOC.

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

An array describing counts since last run start.

Has shape (n_periods, n_detectors, n_timechannels).

stale_event_timeout_s: float = 5.0

The time interval (seconds) in which we call the system ‘PROCESSING’ if we have not received new event messages.

start_time: float = 0.0

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

property start_time_str: str

The time of the most recent run-start message, formatted as a string.

stop_time: float = 0.0

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

property stop_time_str: str

The time of the most recent run-stop message, formatted as a string.

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_diagnostics: VetoDiagnostics

Veto diagnostics.

veto_mask: int = 65535

Integer mask of enabled vetoes.

veto_names_array: ndarray[tuple[Any, ...], dtype[str_]]

Veto names, as a numpy array of strings.

vetoing_percentage: float = 50.0

The minimum percentage at which the DAE is considered ‘vetoing’ rather than ‘running’.

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.

class kafka_dae_diagnostics.data.RunState(*values)[source]

Bases: IntEnum

Enum describing the possible run-states.