data_sources_zmq#

ZMQ-based data sources.

This module contains Data Source classes that deal with data retrieved from ZMQ data streams.

class OmBaseZmqDataSourceMixin(*, data_source_name, parameters, additonal_info)#

Timestamp information from a Jungfrau 1M’s ZMQ data stream.

This class deals with the retrieval of timestamp information for Jungfrau 1M data events originating from a ZMQ stream broadcast by the detector.

This class implements the interface described by its base Protocol class. Please see the documentation of that class for additional information about the interface.

Parameters:
  • data_source_name (str) – A name that identifies the current data source. It is used, for example, for communication with the user or retrieval of initialization parameters.

  • monitor_parameters – An object storing OM’s configuration parameters.

  • parameters (DataSourceParameters)

  • additonal_info (dict[str, Any])

initialize_data_source()#

Initializes the Jungfrau 1M’s ZMQ stream timestamp data source.

Please see the documentation of the base Protocol class for additional information about this method.

No initialization is needed to retrieve timestamp information for Jungfrau 1M data events originating from a ZMQ stream, so this function actually does nothing.

Return type:

None

class TimestampJungfrau1MZmq(*, data_source_name, parameters, additonal_info)#

Timestamp information from a Jungfrau 1M’s ZMQ data stream.

This class deals with the retrieval of timestamp information for Jungfrau 1M data events originating from a ZMQ stream broadcast by the detector.

This class implements the interface described by its base Protocol class. Please see the documentation of that class for additional information about the interface.

Parameters:
  • data_source_name (str) – A name that identifies the current data source. It is used, for example, for communication with the user or retrieval of initialization parameters.

  • monitor_parameters – An object storing OM’s configuration parameters.

  • parameters (DataSourceParameters)

  • additonal_info (dict[str, Any])

get_data(*, event)#

Retrieves timestamp information from a Jungfrau 1M’s ZMQ data stream.

Please see the documentation of the base Protocol class for additional information about this method.

This function returns the timestamp information associated, in the ZMQ data stream broadcast by the detector, to the provided event.

Parameters:

event (dict[str, Any]) – A dictionary storing the event data.

Returns:

The timestamp for the data event.

Return type:

float64

class EventIdJungfrau1MZmq(*, data_source_name, parameters, additonal_info)#

Timestamp information from a Jungfrau 1M’s ZMQ data stream.

This class deals with the retrieval of timestamp information for Jungfrau 1M data events originating from a ZMQ stream broadcast by the detector.

This class implements the interface described by its base Protocol class. Please see the documentation of that class for additional information about the interface.

Parameters:
  • data_source_name (str) – A name that identifies the current data source. It is used, for example, for communication with the user or retrieval of initialization parameters.

  • monitor_parameters – An object storing OM’s configuration parameters.

  • parameters (DataSourceParameters)

  • additonal_info (dict[str, Any])

get_data(*, event)#

Retrieves an event identifier from a Jungfrau 1M’s ZMQ data stream.

Please see the documentation of the base Protocol class for additional information about this method.

This function returns the frame number associated, in the ZMQ data stream broadcast by the detector to the provided event.

Parameters:

event (dict[str, Any]) – A dictionary storing the event data.

Returns:

A unique event identifier.

Return type:

str

class Jungfrau1MZmq(*, data_source_name, parameters, additional_info)#

Detector data frames from Jungfrau 1M HDF5 files.

This class deals with the retrieval of Jungfrau 1M detector data frame from files written by the detector in HDF5 format.

This class implements the interface described by its base Protocol class. Please see the documentation of that class for additional information about the interface.

Parameters:
  • data_source_name (str) – A name that identifies the current data source. It is used, for example, in communications with the user or for the retrieval of a sensor’s initialization parameters.

  • parameters (DataSourceParameters) – An object storing OM’s configuration parameters.

  • additional_info (dict[str, Any])

get_data(*, event)#

Retrieves a Jungfrau 1M detector data frame from a ZMQ data stream.

Please see the documentation of the base Protocol class for additional information about this method.

This function retrieves the detector data frame associated with the provided ZMQ-based event. It returns the frame as a 2D array storing pixel information. Data is retrieved in calibrated or non-calibrated form depending on the value of the {data_source_name}_calibration entry in OM’s data_retrieval_layer configuration parameter group.

Parameters:

event (dict[str, Any]) – A dictionary storing the event data.

Returns:

A detector data frame.

Return type:

ndarray[Any, dtype[float64 | int64]]