data_sources_asapo#

ASAP::O-related data sources.

This module contains Data Source classes that deal with data retrieved from the ASAP::O software framework (used at the PETRA III facility).

class OmBaseAsapoDataSourceMixin(*, data_source_name, parameters)#

Detector data frames from Pilatus single-frame CBF files.

This class deals with the retrieval of Pilatus detector data frames from single-frame files written by the detector in CBF 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.

initialize_data_source()#

Initializes CBF file-based Pilatus detector data source.

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

No initialization is needed to retrieve detector data frames from single-frame CBF files, so this function actually does nothing.

Return type:

None

class DetectorDataAsapo(*, data_source_name, parameters)#

Detector data frames from Pilatus single-frame CBF files.

This class deals with the retrieval of Pilatus detector data frames from single-frame files written by the detector in CBF 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.

get_data(*, event)#

Retrieves a detector data frame from ASAP::O.

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

This function retrieves from ASAP::O the detector data frame associated with the provided event, and returns the detector frame as a 2D array storing pixel information.

Parameters:

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

Returns:

A detector data frame.

Return type:

ndarray[Any, dtype[float64 | int64]]

class EventIdAsapo(*, data_source_name, parameters)#

Detector data frames from Pilatus single-frame CBF files.

This class deals with the retrieval of Pilatus detector data frames from single-frame files written by the detector in CBF 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.

get_data(*, event)#

Retrieves an event identifier from ASAP::O.

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

This function retrieves a unique event identifier for the provided event. Since an ASAP::O-based OM data event corresponds to the content of a single ASAP::O event, the function constructs the event identifier by joining the following elements in a single string, with the “//” symbol placed between them:

  • The name of the ASAP::O stream.

  • The ID of the ASAP::O event in the stream.

Parameters:

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

Returns:

A unique event identifier.

Return type:

str

class BeamEnergyAsapo(*, data_source_name, parameters)#

Detector data frames from Pilatus single-frame CBF files.

This class deals with the retrieval of Pilatus detector data frames from single-frame files written by the detector in CBF 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.

get_data(*, event)#

Retrieves beam energy information from ASAP::O.

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

This function retrieves from ASAP::O the beam energy information associated with the provided event.

Parameters:

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

Returns:

The beam energy.

Return type:

float

class DetectorDistanceAsapo(*, data_source_name, parameters)#

Detector data frames from Pilatus single-frame CBF files.

This class deals with the retrieval of Pilatus detector data frames from single-frame files written by the detector in CBF 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.

get_data(*, event)#

Retrieves detector distance information from ASAP::O.

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

This function retrieves from ASAP::O the detector distance information associated with the provided event.

Parameters:

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

Returns:

The beam energy.

Return type:

float

class TimestampAsapo(*, data_source_name, parameters)#

Detector data frames from Pilatus single-frame CBF files.

This class deals with the retrieval of Pilatus detector data frames from single-frame files written by the detector in CBF 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.

initialize_data_source()#

Initializes CBF file-based Pilatus detector data source.

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

No initialization is needed to retrieve detector data frames from single-frame CBF files, so this function actually does nothing.

Return type:

None

get_data(*, event)#

Retrieves timestamp information from ASAP::O.

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

This function retrieves from ASAP::O the timestamp information associated with the provided event.

Parameters:

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

Returns:

The timestamp for the data event.

Return type:

float64