Content
Analysis of cxif5315
New peakfinder
New peakfinder peak_finder_v2
from class ImgAlgos.PyAlgos is used in this analysis with functionality as follows
- raw detector data is corrected for pedestals, background, and common mode,
- algorithm works in windows for good pixels defined in mask,
each group of connected pixels above threshold thr are considered as a peak candidate, which parameters are evaluated and saved in the text file along with experiment, run, event time stamp information
# Exp Run Date Time time(sec) time(nsec) fiduc Evnum Reg Seg Row Col Npix Amax Atot rcent ccent rsigma csigma rmin rmax cmin cmax bkgd rms son imrow imcol x[um] y[um] r[um] phi[deg]
Example of peakfinder in the data processing script:
# initialization winds_arc = [ (s, 0, 185, 0, 388) for s in (0,1,7,8,9,15,16,17,23,24,25,31)] alg_arc = PyAlgos(windows=winds_arc, mask=mask_arc, pbits=0) alg_arc.set_peak_selection_pars(npix_min=5, npix_max=500, amax_thr=0, atot_thr=1000, son_min=6) ... # in the event loop: peaks_arc = alg_arc.peak_finder_v2(nda, thr=20, r0=5, dr=0.05) #similar for EQUatorial region: peaks_equ = alg_equ.peak_finder_v2(nda, thr=20, r0=5, dr=0.05)
Background subtraction algorithm
Averaged n-d array for (data) cxif5315-r0169 is used as a background. Normalization between data and background is done in four rectangular windows, highlighted in the plot:
from pyimgalgos.GlobalUtils import subtract_bkgd # use part of segments 4 and 20 to subtr bkgd winds_bkgd = [ (s, 10, 100, 270, 370) for s in (4,12,20,28)] #calibration of raw data nda = np.array(nda_raw, dtype=np.float32, copy=True) nda -= nda_peds nda = subtract_bkgd(nda, nda_bkgd, mask=nda_smask, winds=winds_bkgd, pbits=0) nda *= nda_smask det.common_mode_apply(evt, nda)
Scripts
Data processing script uses direct access to data. Example is available since release ana-0.16.1 in
ImgAlgos/examples/ex_peakfinder_cspad.py
Results
Arc region
Peak data processing script is under development. Results for ARC region:
Plots for all peaks found by peakfinder in ARC region before selection:
Good peaks are selected as
def peakIsSelectedArc() : """Apply peak selection criteria to each peak from file """ if sp.sonc<9 : return False if sp.atot<1800 : return False if sp.r<434 : return False if sp.r>442 : return False return True
where all threshold parameters were optimized to select maximum signal events at minimal background in two-peak distance distribution.
Plots for selected peaks
Single-peak events:
Two-peak events:
New peakfinder more than doubles the number of signal events in the distance distribution.
Equ region
Peak selection in equatorial region:
def peakIsSelectedEqu() : """Apply peak selection criteria to each peak from file """ if sp.sonc<9 : return False if sp.atot<1800 : return False if sp.r<100 : return False if sp.r>450 : return False return True
Event selection:
def eventIsSelected() : """Apply selection criteria to entire event, based on list of peaks """ sp.event_is_selected = False if sp.count_arc_pks_sel > 2 : return False if sp.count_equ_pks_sel > 5 : return False #if sp.count_equ_pks_sel < 0 : return False sp.event_is_selected = True return True
Plots:
References
- class ImgAlgos.PyAlgos - collection of n-d array processing algorithms
- class Detector.PyDetector - direct access to detector data and calibration n-d arrays