data_sources_files#
File-based data sources.
This module contains Data Source classes that deal with data stored in files.
- class OmBaseFileDataSourceMixin(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- 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 PilatusSingleFrameFiles(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves an Eiger 16M detector data frame from files.
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 file-based 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]]
- class Eiger16MFiles(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves an Eiger 16M detector data frame from files.
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 file-based 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[int64]]
- class RayonixMccdSingleFrameFiles(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves a Rayonix MX340-HS detector data frame from files.
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 file-based 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[int64]]
- class Lambda1M5Files(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves a Lambda 1.5M detector data frame from files.
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 file-based 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:
Detector data frame.
- Return type:
ndarray[Any, dtype[float64 | int64]]
- class TimestampFromFileModificationTime(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves timestamp information from the modification date of a file.
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 file-based event. It uses as timestamp the last modification time of the file attached to the event.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
The timestamp of the data event.
- Return type:
float64
- class TimestampJungfrau1MFiles(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves the timestamp information for a Jungfrau 1M data event from files.
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 file-based event. It computes the timestamp using the last modification time of the file attached to the event, modified by the internal clock reading of the frame associated to the event.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
The timestamp for the Jungfrau 1M data event.
- Return type:
float64
- class EventIdFromFilePath(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves the event identifier from the full path of a file.
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 file-based event, using as identifier the full path of the file attached to the event.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
A unique event identifier.
- Return type:
str
- class EventIdJungfrau1MFiles(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves the event identifier for a Jungfrau 1M data event.
Please see the documentation of the base Protocol class for additional information about this method.
This function constructs the event identifier for the provided file-based event by joining the following elements in a single string, with the “//” symbol placed between them.
The full path to the HDF5 file attached to the event.
The index, within the file, of the frame being processed.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
A unique event identifier.
- Return type:
str
- class EventIdEiger16MFiles(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves the event identifier for an Eiger 16M data event.
Please see the documentation of the base Protocol class for additional information about this method.
This function constructs the event identifier for the provided file-based event by joining the following elements in a single string, with the “//” symbol placed between them.
The full path to the HDF5 file attached to the provided event.
The index, within the file, of the frame being processed.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
A unique event identifier.
- Return type:
str
- class EventIdLambda1M5Files(*, data_source_name, parameters, additional_info)#
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.
additional_info (dict[str, Any])
- get_data(*, event)#
Retrieves the event identifier for an Lambda 1.5M data event.
Please see the documentation of the base Protocol class for additional information about this method.
This function constructs the event identifier for the provided file-based event by joining the following elements in a single string, with the “//” symbol placed between them.
The full path to the HDF5 file attached to the event and written by the first detector module,
The index, within the file, of the frame being processed.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
A unique event identifier.
- Return type:
str
- class Jungfrau1MFiles(*, 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 file-based event.
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 file-based event, and returns the detector frame as a 2D array storing pixel information. The data is retrieved in calibrated or non-calibrated form depending on the value of the {source_protocols_name}_calibration entry in OM’s data_retrieval_layer configuration parameter group.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
One detector data frame.
- Return type:
ndarray[Any, dtype[float64 | int64]]