The extra.calibration module helps you to find & load detector calibration
data stored in the Calibration Catalog.
This is used for most imaging detectors in use at European XFEL to record
and track datasets called calibration constants derived from characterization
measurements and used for data corrections.
To find constants by conditions for a particular point in time, create a
condition object for the relevant detector type and use
CalibrationData.from_condition:
from extra.calibration import CalibrationData, LPDConditions
lpd_cd = CalibrationData.from_condition(
LPDConditions(memory_cells=200, sensor_bias_voltage=250),
"FXE_DET_LPD1M-1",
event_at="2022-05-22T02:00:00",
)
# Load one constant for all found modules
offset = lpd_cd["Offset"].ndarray()You can also find a group of constants produced by one characterisation process by specifying a CalCat report, e.g. Report 3757:
from extra.calibration import CalibrationData
agipd_cd = CalibrationData.from_report(3757)In a Jupyter notebook, you can show the selected constants in a table:
agipd_cd.display_markdown_table()| Modules | BadPixelsDark | Noise | Offset | ThresholdsDark |
|---|---|---|---|---|
| 0 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 |
| 1 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 |
| 2 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 |
| ... | ||||
| 14 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 |
| 15 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 | 2023-07-29 19:34 |
::: extra.calibration.CalibrationData options: merge_init_into_class: false members_order: source group_by_category: false
::: extra.calibration.MultiModuleConstant
::: extra.calibration.SingleConstant
::: extra.calibration.AGIPDConditions
::: extra.calibration.DSSCConditions
::: extra.calibration.JUNGFRAUConditions
::: extra.calibration.LPDConditions
::: extra.calibration.ShimadzuHPVX2Conditions
Calibration data is associated with physical detector units (PDUs), with an actual detector consisting of one or more of these PDUs then generally called modules. PDUs can freely move between detectors of the same type in a process called mapping, and take their calibration data alongside with them.
This is automatically taken into account when using the CalibrationData APIs described
here, but you can also obtain the detector metadata and mapping information explicitly:
::: extra.calibration.DetectorData
::: extra.calibration.DetectorModule
The calibration pipeline produces masks along with corrected data, in keys
called image.mask or data.mask depending on the detector. Zeros in the mask
represent normal, good pixels, while any other value indicates one or more
reasons why the data may be atypical.
Most of these values indicate different kinds of 'bad' data. But it also
includes values like NON_STANDARD_SIZE for pixels, usually at sensor edges,
which are intentionally larger than most, and thus capture more photons.
::: extra.calibration.BadPixels options: show_if_no_docstring: true
::: extra.calibration.lpd_dark_consts_with_fallback