" print(f\"Gain mode is {gain_mode} ({ctrl_data.run_mode})\")\n",
" print(f\"Gain mode is {gain_mode} ({ctrl_data.run_mode})\")\n",
" # JF corrections in burst mode are only supported when no gain switching occurs.\n",
" # Always retrieve fixed gain constant for burst mode.\n",
" if gain_mode == 0 and mem_cells > 1:\n",
" print(\"By default fixed gain constant will be retrieved for burst mode data,\"\n",
" \" even for dynamic gain data.\")\n",
" gain_mode = 1\n",
"else:\n",
"else:\n",
" print(f\"Gain mode is manually set to {gain_mode}.\")\n",
" print(f\"Gain mode is manually set to {gain_mode}.\")\n",
"\n",
"\n"
"# JF corrections in burst mode are only supported when no gain switching occurs.\n",
"# Always retrieve fixed gain constant for burst mode.\n",
"if gain_mode == 1 and mem_cells > 1:\n",
" print(\"By default fixed gain constant will be retrieved for burst mode data,\"\n",
" \" even for dynamic gain data.\")\n",
" gain_mode = 1"
]
]
},
},
{
{
...
...
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# Jungfrau Offline Correction #
# Jungfrau Offline Correction #
Author: European XFEL Detector Group, Version: 2.0
Author: European XFEL Detector Group, Version: 2.0
Offline Calibration for the Jungfrau Detector
Offline Calibration for the Jungfrau Detector
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
in_folder="/gpfs/exfel/exp/FXE/202301/p003279/raw"# the folder to read data from, required
in_folder="/gpfs/exfel/exp/FXE/202301/p003279/raw"# the folder to read data from, required
out_folder="/gpfs/exfel/data/scratch/kluyvert/jf-corr-p3279-r275"# the folder to output to, required
out_folder="/gpfs/exfel/data/scratch/kluyvert/jf-corr-p3279-r275"# the folder to output to, required
run=275# run to process, required
run=275# run to process, required
metadata_folder=""# Directory containing calibration_metadata.yml when run by xfel-calibrate
metadata_folder=""# Directory containing calibration_metadata.yml when run by xfel-calibrate
sequences=[-1]# sequences to correct, set to [-1] for all, range allowed
sequences=[-1]# sequences to correct, set to [-1] for all, range allowed
sequences_per_node=1# number of sequence files per cluster node if run as slurm job, set to 0 to not run SLURM parallel
sequences_per_node=1# number of sequence files per cluster node if run as slurm job, set to 0 to not run SLURM parallel
# Parameters used to access raw data.
# Parameters used to access raw data.
karabo_id="FXE_XAD_JF500K"# karabo prefix of Jungfrau devices
karabo_id="FXE_XAD_JF500K"# karabo prefix of Jungfrau devices
karabo_da=['JNGFR03']# data aggregators
karabo_da=['JNGFR03']# data aggregators
receiver_template="JNGFR{:02d}"# Detector receiver template for accessing raw data files. e.g. "JNGFR{:02d}"
receiver_template="JNGFR{:02d}"# Detector receiver template for accessing raw data files. e.g. "JNGFR{:02d}"
instrument_source_template='{}/DET/{}:daqOutput'# template for source name (filled with karabo_id & receiver_id). e.g. 'SPB_IRDA_JF4M/DET/JNGFR01:daqOutput'
instrument_source_template='{}/DET/{}:daqOutput'# template for source name (filled with karabo_id & receiver_id). e.g. 'SPB_IRDA_JF4M/DET/JNGFR01:daqOutput'
ctrl_source_template='{}/DET/CONTROL'# template for control source name (filled with karabo_id_control)
ctrl_source_template='{}/DET/CONTROL'# template for control source name (filled with karabo_id_control)
karabo_id_control=""# if control is on a different ID, set to empty string if it is the same a karabo-id
karabo_id_control=""# if control is on a different ID, set to empty string if it is the same a karabo-id
# Parameters for calibration database.
# Parameters for calibration database.
cal_db_interface="tcp://max-exfl-cal001:8017#8025"# the database interface to use
cal_db_interface="tcp://max-exfl-cal001:8017#8025"# the database interface to use
cal_db_timeout=180000# timeout on caldb requests
cal_db_timeout=180000# 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"
creation_time=""# To overwrite the measured creation_time. Required Format: YYYY-MM-DD HR:MN:SC e.g. "2022-06-28 13:00:00"
# Parameters affecting corrected data.
# Parameters affecting corrected data.
relative_gain=True# do relative gain correction.
relative_gain=True# do relative gain correction.
strixel_sensor=False# reordering for strixel detector layout.
strixel_sensor=False# reordering for strixel detector layout.
strixel_double_norm=2.0# normalization to use for double-size pixels, only applied for strixel sensors.
strixel_double_norm=2.0# normalization to use for double-size pixels, only applied for strixel sensors.
limit_trains=0# ONLY FOR TESTING. process only first N trains, Use 0 to process all.
limit_trains=0# ONLY FOR TESTING. process only first N trains, Use 0 to process all.
chunks_ids=32# HDF chunk size for memoryCell and frameNumber.
chunks_ids=32# HDF chunk size for memoryCell and frameNumber.
chunks_data=1# HDF chunk size for pixel data in number of frames.
chunks_data=1# HDF chunk size for pixel data in number of frames.
# Parameters for retrieving calibration constants
# Parameters for retrieving calibration constants
integration_time=-1# integration time in us. set to -1 to overwrite by value in file.
integration_time=-1# integration time in us. set to -1 to overwrite by value in file.
gain_setting=-1# 0 for dynamic gain, 1 for dynamic HG0. set to -1 to overwrite by value in file.
gain_setting=-1# 0 for dynamic gain, 1 for dynamic HG0. set to -1 to overwrite by value in file.
gain_mode=-1# 0 for runs with dynamic gain setting, 1 for fixed gain. Set to -1 to overwrite by value in file.
gain_mode=-1# 0 for runs with dynamic gain setting, 1 for fixed gain. Set to -1 to overwrite by value in file.
mem_cells=-1# Set mem_cells to -1 to automatically use the value stored in RAW data.
mem_cells=-1# Set mem_cells to -1 to automatically use the value stored in RAW data.
bias_voltage=-1# Bias Voltage. Set to -1 to overwrite by value in file.
bias_voltage=-1# Bias Voltage. Set to -1 to overwrite by value in file.
# Parameters for plotting
# Parameters for plotting
skip_plots=False# exit after writing corrected files
skip_plots=False# exit after writing corrected files
plot_trains=500# Number of trains to plot for RAW and CORRECTED plots. Set to -1 to automatically plot all trains.
plot_trains=500# Number of trains to plot for RAW and CORRECTED plots. Set to -1 to automatically plot all trains.
cell_id_preview=15# cell Id used for preview in single-shot plots
cell_id_preview=15# cell Id used for preview in single-shot plots
# Parameters for ROI selection and reduction
# Parameters for ROI selection and reduction
roi_definitions=[-1]# List with groups of 6 values defining ROIs, e.g. [3, 120, 180, 200, 550, -2] for module 3 (JNGFR03), slice 120:180, 200:550, average along axis -2 (slow scan, or -1 for fast scan)
roi_definitions=[-1]# List with groups of 6 values defining ROIs, e.g. [3, 120, 180, 200, 550, -2] for module 3 (JNGFR03), slice 120:180, 200:550, average along axis -2 (slow scan, or -1 for fast scan)
roi_threshold=2.# Corrected pixels below the threshold will be excluded from ROI projections. Set to -1 to include all pixels.
roi_threshold=2.# Corrected pixels below the threshold will be excluded from ROI projections. Set to -1 to include all pixels.