xes#

TODO

class XesAnalysisAndPlots(*, parameters, time_resolved)#

Data analysis and plot generation for X-ray Emission Spectroscopy data.

This class stores all the information required to compute energy spectra from camera data frames, and analyze them. Additionally, the class stores all the information needed to generate and update plots that summarize the state of an X-ray Emission Spectroscopy experiment. Specifically the class generates plots showing the cumulative sum of all observed energy spectra, in raw and smoothed form, and a plot showing the cumulative sum of all recorded detector data frames.

For pump probe experiments, this class can compute separate spectral plots for pumped and dark events, and show their difference.

After the class has been initialized, data event information can be added, and the updated plots can be retrieved and sent to external programs for visualization.

Parameters:
  • parameters (XesParameters) – An object storing OM’s configuration parameters. The set of OM’s configuration parameters must include a parameter group called xes with the entries required to fine-tune the spectrum calculation. Please refer to the documentation of the [EnergySpectrumRetrieval][om.algorithms.xes.EnergySpectrumRetrieval] algorithm).

  • time_resolved (bool)

update_plots(*, detector_data, optical_laser_active)#

Updates and recovers the X-ray Emission Spectroscopy data plots.

This function uses the provided information to update all the X-ray Emission Spectroscopy data plots generated by this class. The function assumes that all the provided information refers to the same data event.

After updating the data plots, the function returns all the information needed to display the plots in a graphical interface, in the format of a tuple containing the following entries:

  • The cumulative sum of all observed energy spectra.

  • The cumulative sum of the smoothed versions of all observed energy spectra.

  • The cumulative sum of all observed data frames.

  • For pump-probe experiments, the cumulative sum of all observed energy spectra for events with an active optical laser. For non pump-probe experiments, this entry is just the value None.

  • For pump-probe experiments, the cumulative sum of all observed energy spectra for events without an active optical laser. For non pump-probe experiments, this entry is just the value None.

  • For pump-probe experiments, the the difference between the cumulative sum of all observed energy spectra observed for events with and without an active optical laser. For non pump-probe experiments, this entry is just the value None.

Parameters:
  • detector_data (ndarray[Any, dtype[float64 | int64]]) – The detector data frame to analyze and to use for updating the plots.

  • optical_laser_active (bool) – Whether the optical laser is active or not in the data event to which the provided information is associated. This information is only relevant for pump-probe experiments, and it is ignored otherwise.

Returns:

The information needed to display the plots in a graphical interface.

Return type:

tuple[ndarray[Any, dtype[float64 | int64]] | None, ndarray[Any, dtype[float64]] | None, ndarray[Any, dtype[float64 | int64]] | None, ndarray[Any, dtype[float64]] | None, ndarray[Any, dtype[float64]] | None, ndarray[Any, dtype[float64]] | None]