xes
Algorithms for the processing of x-ray emission spectroscopy data.
This module contains algorithms that perform data processing operations for X-ray Emission Spectroscopy.
EnergySpectrumRetrieval
See documentation of the __init__
function.
__init__(*, parameters)
Beam energy spectrum retrieval.
This algorithm stores all the parameters needed to extract energy spectra from camera data frames.
After the algorithm has been initialized, it can be invoked to calculate an energy spectrum from a data frame.
Warning
This algorithm is designed to be applied to camera frames, rather than data frames from multi-panel area detectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters |
Dict[str, Any]
|
A set of OM configuration parameters collected together in a parameter group. The parameter group must contain the following entries:
|
required |
calculate_spectrum(*, data)
Calculates beam energy spectrum information from a camera data frame.
This function extracts energy spectrum information from a provided camera data frame. It returns the raw spectrum information, plus a smoother, filtered version of it.
The function initially rotates the camera image to align the spectrum information with the vertical axis of the camera data frame. It then computes the beam energy spectrum by integrating the region where the energy is recorded along the horizontal axis of the data frame.
Optionally, the algorithm can apply an ADU threshold can to the camera data. If a threshold is provided when the algorithm is initialized, this function excludes from the spectrum calculation all the pixels below the threshold.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Union[NDArray[numpy.float_], NDArray[numpy.int_]]
|
The camera data frame from which the spectrum information must be extracted. |
required |
Returns:
Type | Description |
---|---|
Dict[str, NDArray[numpy.float_]]
|
A dictionary storing the spectrum information extracted from the camera frame.
|