"exposure_period = -1. # Detector exposure period, set to -1 to use value in raw file.\n",
"acquisition_rate = -1. # Detector acquisition rate (1.1/4.5), set to -1 to use value in raw file.\n",
"single_photon = -1 # Detector single photon mode (High/Low CDS), set to -1 to use value in raw file.\n",
"# This is used for the summary notebook\n",
"gh2_detector = \"\" # Specifies the GH2 detector type ('50um' or '25um'). This parameter can be used to manually set the detector type if the code cannot automatically determine it from the control data.\n",
"\n",
"# Parameters used for calculating calibration constants\n",
"bpix_noise_nitrs = 5 # number of maximum iterations to actively try to reach correct number of badpixels of NOISE_OUT_OF_THRESHOLD type. Leave -1 to keep iterating until finding maximum number of badpixels.\n",
Author: European XFEL Detector Group, Version: 1.0
The following is a processing for the dark constants (`Offset`, `Noise`, and `BadPixelsDark`) maps using dark images taken with Gotthard2 detector (GH2 50um or 25um).
All constants are evaluated per strip, per pulse, and per memory cell. The maps are calculated for each gain stage that is acquired in 3 separate runs.
The three maps are of shape (stripes, cells, gains): (1280, 2, 3). They can be injected to the database (`db_output`) and/or stored locally (`local_output`).
%% Cell type:code id:818e24e8 tags:
``` python
in_folder="/gpfs/exfel/exp/FXE/202231/p900298/raw"# the folder to read data from, required
out_folder="/gpfs/exfel/data/scratch/ahmedk/test/gotthard2/darks"# the folder to output to, required
metadata_folder=''# Directory containing calibration_metadata.yml when run by xfel-calibrate
run_high=7# run number for G0 dark run, required
run_med=8# run number for G1 dark run, required
run_low=9# run number for G2 dark run, required
# Parameters used to access raw data.
input_source_template="{karabo_id}/DET/RECEIVER{input_source_affixes}:daqOutput"# data source template used to read INSTRUMENT keys.
ctrl_source_template="{karabo_id_control}/DET/{control_template}"# template for control source name (filled with karabo_id_control)
karabo_id="FXE_XAD_G2XES"# karabo prefix of Gotthard-II devices
karabo_da=[""]# data aggregators
input_source_affixes=[""]# The affix to format into the input source template to be able to load the correct module's data.
control_template="CONTROL"# control template used to read CONTROL keys.
karabo_id_control=""# Control karabo ID. Set to empty string to use the karabo-id
# Parameters for the calibration database.
cal_db_interface="tcp://max-exfl-cal001:8020"# calibration DB interface to use
cal_db_timeout=300000# timeout on caldb requests
creation_time=""# To overwrite the measured creation_time. Required Format: YYYY-MM-DD HR:MN:SC e.g. "2022-06-28 13:00:00"
db_output=False# Output constants to the calibration database
local_output=True# Output constants locally
# Conditions used for injected calibration constants.
bias_voltage=-1# Detector bias voltage, set to -1 to use value in raw file.
exposure_time=-1.# Detector exposure time, set to -1 to use value in raw file.
exposure_period=-1.# Detector exposure period, set to -1 to use value in raw file.
acquisition_rate=-1.# Detector acquisition rate (1.1/4.5), set to -1 to use value in raw file.
single_photon=-1# Detector single photon mode (High/Low CDS), set to -1 to use value in raw file.
# This is used for the summary notebook
gh2_detector=""# Specifies the GH2 detector type ('50um' or '25um'). This parameter can be used to manually set the detector type if the code cannot automatically determine it from the control data.
# Parameters used for calculating calibration constants
bpix_noise_nitrs=5# number of maximum iterations to actively try to reach correct number of badpixels of NOISE_OUT_OF_THRESHOLD type. Leave -1 to keep iterating until finding maximum number of badpixels.
# Parameters used during selecting raw data trains.
min_trains=1# Minimum number of trains that should be available to process dark constants. Default 1.
max_trains=1000# Maximum number of trains to use for processing dark constants. Set to 0 to use all available trains.
badpixel_threshold_sigma=5.# bad pixels defined by values outside n times this std from median
# Don't delete! myMDC sends this by default.
operation_mode=''# Detector dark run acquiring operation mode, optional
"ctrl_source_template = '{karabo_id}/DET/{control_template}' # template for control source name (filled with karabo_id_control)\n",
"karabo_id_control = \"\" # Control karabo ID. Set to empty string to use the karabo-id\n",
"\n",
"gh2_detector = \"\" # Specifies the GH2 detector type ('50um' or '25um'). This parameter can be used to manually set the detector type if the code cannot automatically determine it from the control data.\n",
"\n",
"# Parameters to be used for injecting dark calibration constants.\n",
"local_output = True # Boolean indicating that local constants were stored in the out_folder\n",
"\n",
...
...
@@ -91,7 +93,11 @@
" karabo_id_control=karabo_id_control,\n",
" control_template=control_template\n",
" ))\n",
"gh2_detector = g2ctrl.get_det_type()\n",
"if not gh2_detector:\n",
" # Unfortunately we can't check if we can't validate this value\n",
" # as the notebook will have only one karabo_da anyway.\n",
" # Dark processing split nodes over each karabo_da\n",
Author: European XFEL Detector Department, Version: 1.0
Summary for process dark constants and a comparison with previously injected constants with the same conditions.
%% Cell type:code id: tags:
``` python
in_folder="/gpfs/exfel/exp/DETLAB/202330/p900326/raw"# the folder to read data from, required
out_folder="/gpfs/exfel/data/scratch/ahmedk/test/gotthard2"# path to output to, required
metadata_folder=""# Directory containing calibration_metadata.yml when run by xfel-calibrate.
run_high=20# run number for G0 dark run, required
run_med=21# run number for G1 dark run, required
run_low=22# run number for G2 dark run, required
# Parameters used to access raw data.
karabo_id="DETLAB_25UM_GH2"# detector identifier.
karabo_da=["DA01/1","DA01/2"]# list of data aggregators, which corresponds to different JF modules. This is only needed for the detectors of one module.
control_template="CONTROL"# control template used to read CONTROL keys.
ctrl_source_template='{karabo_id}/DET/{control_template}'# template for control source name (filled with karabo_id_control)
karabo_id_control=""# Control karabo ID. Set to empty string to use the karabo-id
gh2_detector=""# Specifies the GH2 detector type ('50um' or '25um'). This parameter can be used to manually set the detector type if the code cannot automatically determine it from the control data.
# Parameters to be used for injecting dark calibration constants.
local_output=True# Boolean indicating that local constants were stored in the out_folder
# Skip the whole notebook if local_output is false in the preceding notebooks.
ifnotlocal_output:
fromcal_tools.toolsimportexit_notebook
exit_notebook('No local constants saved. Skipping summary plots')