Skip to content

data_sources_zmq

ZMQ-based data sources.

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

Jungfrau1MZmq

Bases: OmDataSourceProtocol

See documentation of the __init__ function.

__init__(*, data_source_name, monitor_parameters)

Detector data frames from a Jungfrau 1M's ZMQ data stream.

This class deals with the retrieval of Jungfrau 1M detector data frames 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:

Name Type Description Default
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.

required
monitor_parameters MonitorParameters

An object storing OM's configuration parameters.

required

initialize_data_source()

Initializes the Jungfrau 1M's ZMQ stream detector frame data source.

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

This function retrieves from OM's configuration parameters all the information needed to initialize the data source. It looks at the parameter {data_source_name}_calibration in OM's data retrieval layer configuration parameter group to determine if calibrated data needs to be retrieved. In the affirmative case, it reads the names of the files containing the required calibration constants from the entries dark_filenames and gain_filenames in the calibration parameter group.

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:

Name Type Description Default
event Dict[str, Any]

A dictionary storing the event data.

required

Returns:

Type Description
Union[NDArray[numpy.float_], NDArray[numpy.int_]]

A detector data frame.

TimestampJungfrau1MZmq

Bases: OmDataSourceProtocol

See documentation of the __init__ function.

__init__(*, data_source_name, monitor_parameters)

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:

Name Type Description Default
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.

required
monitor_parameters MonitorParameters

An object storing OM's configuration parameters.

required

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.

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:

Name Type Description Default
event Dict[str, Any]

A dictionary storing the event data.

required

Returns:

Type Description
numpy.float64

The timestamp for the data event.

EventIdJungfrau1MZmq

Bases: OmDataSourceProtocol

See documentation of the __init__ function.

__init__(*, data_source_name, monitor_parameters)

Event identifiers from a Jungfrau 1M's ZMQ data stream..

This class deals with the retrieval of unique identifiers 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:

Name Type Description Default
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.

required
monitor_parameters MonitorParameters

An object storing OM's configuration parameters.

required

initialize_data_source()

Initializes the Jungfrau 1M's ZMQ stream event identifier data source.

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

No initialization is needed to retrieve event identifiers for Jungfrau 1M data events originating from a ZMQ stream broadcast by the detector, so this function actually does nothing.

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:

Name Type Description Default
event Dict[str, Any]

A dictionary storing the event data.

required

Returns:

Type Description
str

A unique event identifier.