data_sources_http#

HTTP-based data sources.

This module contains Data Source classes that deal with data retrieved from the HTTP/REST interface of detectors manufactured by the company Dectris.

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

Detector data frames from Eiger 16M’s HTTP/REST interface.

This class deals with the retrieval of Eiger 16M detector data frames from the detector’s HTTP/REST interface.

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])

initialize_data_source()#

Initializes the Eiger 16M’s HTTP/REST 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 the Eiger 16M’S HTTP/REST- interface, so this function actually does nothing.

Return type:

None

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

Detector data frames from Eiger 16M’s HTTP/REST interface.

This class deals with the retrieval of Eiger 16M detector data frames from the detector’s HTTP/REST interface.

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 an Eiger 16M detector data frame.

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

This function extracts the detector data frame stored in the provided HTTP/REST-based event. It 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 TimestampEiger16MHttp(*, data_source_name, parameters, additional_info)#

Detector data frames from Eiger 16M’s HTTP/REST interface.

This class deals with the retrieval of Eiger 16M detector data frames from the detector’s HTTP/REST interface.

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 timestamp information from an Eiger 16M’S HTTP/REST interface.

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

This function retrieves the timestamp information associated with the provided HTTPS/REST-based event.

Parameters:

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

Returns:

The timestamp of the Jungfrau 1M data event.

Return type:

float64

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

Detector data frames from Eiger 16M’s HTTP/REST interface.

This class deals with the retrieval of Eiger 16M detector data frames from the detector’s HTTP/REST interface.

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 an event identifier from the HTTP/REST interface of an Eiger 16M.

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

A data event retrieved from the HTTP-REST interface of an Eiger 16M contains detector frame data in the format of a TIFF image. The combination of the series_id and frame_id tags retrieved from the header of the TIFF image are used to generate an event identifier, with the format: <series_id>_<frame_id>.

Parameters:

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

Returns:

A unique event identifier.

Return type:

str