Author: European XFEL Detector Group, Version: 2.0
Analyzes Jungfrau dark image data to deduce offset, noise and resulting bad pixel maps
%% Cell type:code id: tags:
``` python
in_folder='/gpfs/exfel/exp/SPB/202130/p900204/raw/'# folder under which runs are located, required
out_folder='/gpfs/exfel/data/scratch/ahmedk/test/remove'# path to place reports at, required
metadata_folder=''# Directory containing calibration_metadata.yml when run by xfel-calibrate
run_high=141# run number for G0 dark run, required
run_med=142# run number for G1 dark run, required
run_low=143# run number for G2 dark run, required
# Parameters used to access raw data.
karabo_da=['JNGFR01','JNGFR02','JNGFR03','JNGFR04','JNGFR05','JNGFR06','JNGFR07','JNGFR08']# list of data aggregators, which corresponds to different JF modules
karabo_id='SPB_IRDA_JF4M'# karabo_id (detector identifier) prefix of Jungfrau detector to process.
karabo_id_control=''# if control is on a different ID, set to empty string if it is the same a karabo-id
receiver_template='JNGFR{:02}'# inset for receiver devices
instrument_source_template='{}/DET/{}:daqOutput'# template for instrument 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)
# Parameters for calibration database and storing constants.
use_dir_creation_date=True# use dir creation date
cal_db_interface='tcp://max-exfl-cal001:8016#8045'# calibrate db interface to connect to
cal_db_timeout=300000# timeout on caldb requests
local_output=True# output constants locally
db_output=False# output constants to database
# Parameters affecting creating dark calibration constants.
badpixel_threshold_sigma=5.# bad pixels defined by values outside n times this std from median
offset_abs_threshold_low=[1000,10000,10000]# absolute bad pixel threshold in terms of offset, lower values
offset_abs_threshold_high=[8000,15000,15000]# absolute bad pixel threshold in terms of offset, upper values
max_trains=1000# Maximum trains to process darks. Set to 0 to process all available train images. 1000 trains is enough resolution to create the dark constants
min_trains=100# Minimum number of trains to process dark constants. Raise a warning if the run has fewer trains.
manual_slow_data=False# if true, use manually entered bias_voltage and integration_time values
time_limits=0.025# to find calibration constants later on, the integration time is allowed to vary by 0.5 us
# Parameters to be used for injecting dark calibration constants.
integration_time=1000# integration time in us, will be overwritten by value in file
gain_setting=0# 0 for dynamic, forceswitchg1, forceswitchg2, 1 for dynamichg0, fixgain1, fixgain2. Will be overwritten by value in file
gain_mode=0# 1 if medium and low runs are fixgain1 and fixgain2, otherwise 0. It will be overwritten by value in file, if manual_slow_data
bias_voltage=90# sensor bias voltage in V, will be overwritten by value in file
memory_cells=16# number of memory cells
# Parameters used for plotting
detailed_report=False
# TODO: this is used for only Warning check at AGIPD dark.
# Need to rethink if it makes sense to use it here as well.