data_sources_psana2#
Psana-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).
This module contains Data Source classes that deal with data retrieved from the psana software framework (used at the LCLS facility).
- class OmDetectorInterfacePsana2DataSourceMixin(*, data_source_name, parameters, additional_info)#
Area data frames from psana at the LCLS facility.
This class deals with the retrieval of area detector data frames from the psana software framework. Classes dealing with the retrieval of data frames from specific area detector should inherit from this base class
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 psana event identifier data source.
Please see the documentation of the base Protocol class for additional information about this method.
No initialization is required to retrieve event identifiers for psana-based data events, so this function actually does nothing.
- Return type:
None
- class AssembledDetectorPsana2(*, data_source_name, parameters, additional_info)#
Area data frames from psana at the LCLS facility.
This class deals with the retrieval of area detector data frames from the psana software framework. Classes dealing with the retrieval of data frames from specific area detector should inherit from this base class
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 assembled detector data frame from psana.
Please see the documentation of the base Protocol class for additional information about this method.
This function retrieves from psana the assembled detector data frame associated with the provided event. It returns the frame as a 2D array storing pixel information.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
An assembled detector data frame.
- Raises:
OmDataExtractionError – Raised when data cannot be retrieved from psana.
- Return type:
ndarray[Any, dtype[float64]]
- class EpicsVariablePsana2(*, data_source_name, parameters, additional_info)#
Area data frames from psana at the LCLS facility.
This class deals with the retrieval of area detector data frames from the psana software framework. Classes dealing with the retrieval of data frames from specific area detector should inherit from this base class
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 Epics variable’s value from psana.
Please see the documentation of the base Protocol class for additional information about this method.
This function retrieves from psana the value of the requested Epics variable associated with the provided event.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
The value of the Epics variable.
- Return type:
Any
- class BeamEnergyFromEpicsVariablePsana2(*, data_source_name, parameters, additional_info)#
Beam energy information from psana at the LCLS facility.
This class deals with the retrieval of beam energy information from the psana software framework.
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.
monitor_parameters – An object storing OM’s configuration parameters.
parameters (dict[str, Any])
additional_info (dict[str, Any])
- initialize_data_source()#
Initializes the psana beam energy data source.
Please see the documentation of the base Protocol class for additional information about this method.
This function initializes the psana Detector interface for the retrieval of beam energy information.
- Return type:
None
- get_data(*, event)#
Retrieves beam energy information from psana using an Epics variable.
Please see the documentation of the base Protocol class for additional information about this method.
This function retrieves from psana the value of the beam energy associated to the provided event. It calculates the beam energy from the value of the SIOC:SYS0:ML00:AO192 Epics variable attached to the event.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
The beam energy in eV.
- Raises:
OmDataExtractionError – Raised when data cannot be retrieved from psana.
- Return type:
float
- class AreaDetectorPsana2(*, data_source_name, parameters, additional_info)#
Area data frames from psana at the LCLS facility.
This class deals with the retrieval of area detector data frames from the psana software framework. Classes dealing with the retrieval of data frames from specific area detector should inherit from this base class
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 (dict[str, Any]) – An object storing OM’s configuration parameters.
additional_info (dict[str, Any])
- initialize_data_source()#
Initializes the psana event identifier data source.
Please see the documentation of the base Protocol class for additional information about this method.
No initialization is required to retrieve event identifiers for psana-based data events, so this function actually does nothing.
- Return type:
None
- get_data(*, event)#
Retrieves a Jungfrau 4M detector data frame from psana. Please see the documentation of the base Protocol class for additional information about this method.
This function retrieves from psana the detector data frame associated with the provided 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 {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:
A detector data frame.
- Raises:
OmDataExtractionError – Raised when data cannot be retrieved from psana.
- Return type:
ndarray[Any, dtype[float64 | int64]]
- class TimestampPsana2(*, data_source_name, parameters, additional_info)#
Timestamp information from psana at the LCLS facility.
This class deals with the retrieval of timestamp information from the psana software framework.
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.
monitor_parameters – An object storing OM’s configuration parameters.
parameters (dict[str, Any])
additional_info (dict[str, Any])
- initialize_data_source()#
Initializes the psana 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 from psana, so this function actually does nothing.
- Return type:
None
- get_data(*, event)#
Retrieves timestamp information from psana.
Please see the documentation of the base Protocol class for additional information about this method.
This function retrieves from psana the timestamp information for the provided event. Psana provides this information with nanosecond precision.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
The timestamp for the data event.
- Return type:
int
- class EventIdPsana2(*, data_source_name, parameters, additional_info)#
Data event identifiers from psana at the LCLS facility.
This class deals with the retrieval of unique event identifiers for psana-based data events.
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.
monitor_parameters – An object storing OM’s configuration parameters.
parameters (dict[str, Any])
additional_info (dict[str, Any])
- initialize_data_source()#
Initializes the psana event identifier data source.
Please see the documentation of the base Protocol class for additional information about this method.
No initialization is required to retrieve event identifiers for psana-based data events, so this function actually does nothing.
- Return type:
None
- get_data(*, event)#
Retrieves an event identifier from psana.
Please see the documentation of the base Protocol class for additional information about this method.
This function retrieves from psana a unique identifier for the provided event. The psana software framework provides timestamp information with nanosecond-level precision for each event, plus a specific fiducial string for more detailed identification. The identifier is generated by combining the timestamp and fiducial information that psana provides for the event. It has the following format: {timestamp: seconds}-{timestamp: nanoseconds}-{fiducial_string}.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
A unique event identifier.
- Return type:
str
- class BeamEnergyPsana2(*, data_source_name, parameters, additional_info)#
Beam energy information from psana at the LCLS facility.
This class deals with the retrieval of beam energy information from the psana software framework.
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.
monitor_parameters – An object storing OM’s configuration parameters.
parameters (dict[str, Any])
additional_info (dict[str, Any])
- initialize_data_source()#
Initializes the psana beam energy data source.
Please see the documentation of the base Protocol class for additional information about this method.
This function initializes the psana Detector interface for the retrieval of beam energy information.
- Return type:
None
- get_data(*, event)#
Retrieves beam energy information from psana.
Please see the documentation of the base Protocol class for additional information about this method.
This function retrieves from psana the beam energy information for the provided event.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
The beam energy.
- Return type:
float
- class EvrCodelistPsana2(*, data_source_name, parameters, additional_info)#
EVR event codes from psana at the LCLS facility.
This class deals with the retrieval EVR event codes from the psana software framework.
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.
monitor_parameters – An object storing OM’s configuration parameters.
parameters (DataSourceParameters)
additional_info (dict[str, Any])
- initialize_data_source()#
Initializes the psana EVR event code data source.
Please see the documentation of the base Protocol class for additional information about this method.
This function initializes the data retrieval for the EVR event code number specified by the {data_source_name}_evr_code entry in OM’s Data Retrieval Layer configuration parameter group. The EVR event source to monitor for the emission of the event is instead determined by the psana_evr_source_name entry in the same parameter group.
- Return type:
None
- get_data(*, event)#
Retrieves EVR events code information from psana.
Please see the documentation of the base Protocol class for additional information about this method.
This function checks whether the event code attached to the Data Source has been emitted, for the provided event, by the monitored EVR source.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
Whether the required event code has been emitted for the provided event.
- Raises:
OmDataExtractionError – Raised when data cannot be retrieved from psana.
- Return type:
ndarray[Any, dtype[int64]]