"extra_dims = ['cell', 'row', 'col'] # labels for the DataArray dims after the first\n",
"extra_dims = ['cell', 'row', 'col'] # labels for the DataArray dims after the first\n",
"fit_func = 'CHARGE_SHARING' # function used to fit the single photon peak\n",
"fit_func = 'CHARGE_SHARING' # function used to fit the single photon peak\n",
"fit_h_range = (150, 350.) # range of the histogram in x-axis units used in fitting\n",
"fit_h_range = (150, 350.) # range of the histogram in x-axis units used in fitting\n",
"\n",
"chunk_size = 10\n",
"# parameters for the peak finder\n",
"# parameters for the peak finder\n",
"n_sigma = 5. # n of sigma above pedestal threshold\n",
"n_sigma = 5. # n of sigma above pedestal threshold\n",
"ratio = 0.99 # ratio of the next peak amplitude in the peak_finder\n",
"ratio = 0.99 # ratio of the next peak amplitude in the peak_finder\n",
...
...
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# Histogram of single photon spectra
# Histogram of single photon spectra
Author: European XFEL Detector Group, Version: 1.0
Author: European XFEL Detector Group, Version: 1.0
Creates histograms from flat fields and store it in HDF5 files then perform fitting based on the selecting `fit_func`.
Creates histograms from flat fields and store it in HDF5 files then perform fitting based on the selecting `fit_func`.
Histograms are on a pixel-by-pixel, memory cell by memory cell basis to save memory and space, histogram range are to be optimized around the desired peak.
Histograms are on a pixel-by-pixel, memory cell by memory cell basis to save memory and space, histogram range are to be optimized around the desired peak.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
in_folder='/gpfs/exfel/exp/SPB/202330/p900343/raw'# RAW data path, required
in_folder='/gpfs/exfel/exp/SPB/202330/p900343/raw'# RAW data path, required
out_folder='/gpfs/exfel/data/scratch/ahmedk/test/remove/JF4M_SPB_gain/r66/no_offset'# Output path for gain data, required
out_folder='/gpfs/exfel/data/scratch/ahmedk/test/remove/JF4M_SPB_gain/r66/no_offset'# Output path for gain data, 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
runs=[66]# can be a list of runs
runs=[66]# can be a list of runs
sensor_size=[512,1024]# size of the array in the 'row' and 'col' dimensions
sensor_size=[512,1024]# size of the array in the 'row' and 'col' dimensions
chunked_trains=1000# Number of trains per chunk.
chunked_trains=1000# Number of trains per chunk.
gains=[0,1,2]# gain bit values
gains=[0,1,2]# gain bit values
karabo_id="SPB_IRDA_JF4M"# karabo prefix of Jungfrau devices
karabo_id="SPB_IRDA_JF4M"# karabo prefix of Jungfrau devices
karabo_da=[""]# Detector's data aggregators. Leave empty to derive from CALCAT.
karabo_da=[""]# Detector's data aggregators. Leave empty to derive from CALCAT.
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"
# Parameter conditions
# Parameter conditions
bias_voltage=-1# bias voltage - Set to -1 to derive from CONTROL file.
bias_voltage=-1# bias voltage - Set to -1 to derive from CONTROL file.
integration_time=-1.# integration time - Set to -1 to derive from CONTROL file.
integration_time=-1.# integration time - Set to -1 to derive from CONTROL file.
gain_mode=0# number of memory cells - Set to -1 to derive from CONTROL file.
gain_mode=0# number of memory cells - Set to -1 to derive from CONTROL file.
gain_setting=-1# gain setting parameter conditions (High or low CDS) - Set to -1 to derive from CONTROL file.
gain_setting=-1# gain setting parameter conditions (High or low CDS) - Set to -1 to derive from CONTROL file.
memory_cells=-1# number of memory cells - Set to -1 to derive from CONTROL file.
memory_cells=-1# number of memory cells - Set to -1 to derive from CONTROL file.
sc_start=-1# storage cell start value - should be derived from CONTROL file.
sc_start=-1# storage cell start value - should be derived from CONTROL file.
h_bins_s=2# bin width in ADC units of the histogram
h_bins_s=2# bin width in ADC units of the histogram
h_range=(-50,450.)# histogram range in ADC units
h_range=(-50,450.)# histogram range in ADC units
block_size=[256,64]# dimension of the chunks in 'row' and 'col'
block_size=[256,64]# dimension of the chunks in 'row' and 'col'
control_src_template='{}/DET/CONTROL'
control_src_template='{}/DET/CONTROL'
extra_dims=['cell','row','col']# labels for the DataArray dims after the first
extra_dims=['cell','row','col']# labels for the DataArray dims after the first
fit_func='CHARGE_SHARING'# function used to fit the single photon peak
fit_func='CHARGE_SHARING'# function used to fit the single photon peak
fit_h_range=(150,350.)# range of the histogram in x-axis units used in fitting
fit_h_range=(150,350.)# range of the histogram in x-axis units used in fitting
chunk_size=10
# parameters for the peak finder
# parameters for the peak finder
n_sigma=5.# n of sigma above pedestal threshold
n_sigma=5.# n of sigma above pedestal threshold
ratio=0.99# ratio of the next peak amplitude in the peak_finder
ratio=0.99# ratio of the next peak amplitude in the peak_finder