Page History
...
- See Module ImgAlgos::NDArrCalib, Module ImgAlgos::NDArrAverage
The
NDArrCalib
module in combination with PnccdNDArrProducer (or any other device NDArrProducer) can be used for evaluation of averaged pedestals or background using dedicated runs.
Typical configuration file may looks like this:files are shown below.
Example of ImgAlgos::NDArrCalib for pnCCD
Code Block |
---|
[psana] files = exp=amoa1214:run=7 #skip-events = 100 events = 5 modules = ImgAlgos.Tahometer \ ImgAlgos.PnccdNDArrProducer \ ImgAlgos.NDArrCalib \ ImgAlgos.PnccdImageProducer \ ImgAlgos.ImgSaveInFile # ImgAlgos.NDArrAverage \ [ImgAlgos.PnccdNDArrProducer] source = DetInfo(Camp.0:pnCCD.0) key_in = key_out = pnccd-ndarr outtype = asdata print_bits = 13 [ImgAlgos.NDArrCalib] source = DetInfo(Camp.0:pnCCD.0) key_in = pnccd-ndarr key_out = calibrated do_peds = yes do_cmod = yes do_stat = no do_mask = no do_bkgd = no do_gain = no do_nrms = no do_thre = no fname_mask = fname_bkgd = masked_value = 0 threshold_nrms = 3 threshold = 100 below_thre_value = 0 bkgd_ind_min = 0 bkgd_ind_max = 1000 bkgd_ind_inc = 10 print_bits = 255 [ImgAlgos.PnccdImageProducer] source = DetInfo(Camp.0:pnCCD.0) #inkey = pnccd-ndarr inkey = calibrated outimgkey = pnccd-img gap_size = 20 gap_value = 0 print_bits = 1 [ImgAlgos.ImgSaveInFile] source = DetInfo(Camp.0:pnCCD.0) key = pnccd-img fname = pnccd-img-from-arr ftype = txt saveAll = true print_bits = 31 [ImgAlgos.Tahometer] dn = 100 print_bits = 7 |
Example of ImgAlgos::NDArrCalib for CSPAD
Code Block |
---|
[psana]
files = exp=cxi83714:run=136
events = 100
modules = ImgAlgos.Tahometer \
CSPadPixCoords.CSPadNDArrProducer \
ImgAlgos.NDArrCalib \
ImgAlgos.NDArrAverage
[CSPadPixCoords.CSPadNDArrProducer]
source = DetInfo(CxiDs1.0:Cspad.0)
inkey =
outkey = cspad_ndarr
outtype = float
is_fullsize = yes
print_bits = 3
[ImgAlgos.NDArrCalib]
source = DetInfo(CxiDs1.0:Cspad.0)
key_in = cspad_ndarr
key_out = calibrated
do_peds = yes
do_cmod = yes
do_stat = yes
do_mask = no
do_bkgd = no
do_gain = no
do_nrms = no
do_thre = no
fname_mask =
fname_bkgd =
masked_value = -10
threshold_nrms = 4
threshold = 7
below_thre_value = 0
bkgd_ind_min = 0
bkgd_ind_max = 1000
bkgd_ind_inc = 10
print_bits = 3
[ImgAlgos.NDArrAverage]
source = DetInfo(CxiDs1.0:Cspad.0)
key = calibrated
avefile = cspad-ave
rmsfile = cspad-rms
#maskfile = cspad-msk
#hotpixfile = cspad-hot
thr_rms_ADU = 10
thr_min_ADU = 4
thr_max_ADU = 10000
print_bits = 29
[ImgAlgos.Tahometer]
dn = 10
print_bits = 7 |
For test purpose we use exp=cxi83714:run=136 and loop over 100 exents.
Case 1: raw, non-calibrated images
do_peds = no; 50-60 ms/event
plots for average and rms value distribution for all pixels
Case 2: images with subtracted pedestals and applied status mask
do_peds = yes; 60-70 ms/event
do_stat = yes
Case 2: The same as 2 with common mode subtracted
do_cmod = yes; 107-117 ms/event
For common mode correction Andy's algorithm for CSPAD with minor adaptive modifications is applied with parameters
/reg/d/psdm/cxi/cxi83714/calib/CsPad::CalibV1/CxiDs1.0:Cspad.0/common_mode/135-136.data
1 10 10 100 - algorithm mode, allowed peak mean, allowed peak rms, threshold on number of pixels in ADU bin.
Conclusion: common mode correction shrinks the width of averaged amplitudes from 0.60 to 0.54, and rms from 3.78 to 3.27.
Algorithm is quite time expensive, it takes 40-40ms/event.
Example for module ImgAlgos::ImgAverage
...