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.
cal_db_interface=''# calibrate db interface to connect to # KEEP FOR THE WEBSERVICE
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.
skip_first_ntrains=0# Skip first number of trains and don't include them in dark processing.
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
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 to be used for injecting dark calibration constants.
integration_time=-1# Integration time in us. Set to -1 to overwrite by value in file.
exposure_timeout=-1# Exposure timeout. Set to -1 to overwrite by value in file.
gain_setting=-1# 0 for dynamic, forceswitchg1, forceswitchg2, 1 for dynamichg0, fixgain1, fixgain2. Set to overwrite by value in file.
gain_mode=-1# 1 if medium and low runs are fixgain1 and fixgain2, otherwise 0. Set to -1 to overwrite by value in file.
bias_voltage=-1# sensor bias voltage in V, will be overwritten by value in file
memory_cells=-1# 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.