Content
In this note In this note we show how peak finder versions v2,3,4 work on exp=cxif5315:run=169 data.
Test data
exp=cxif5315:run=169
Use of peak finders
See for detail
- Hit/Peak Finding Details - description of algorithms
- ImgAlgos.PyAlgos - interface methods
We work with peak finder versions v2,3,4. Data processing and peak finding is done in
cxif5315/proc-cxif5315-r0169-data-pfvn-2016-03-28.py
from ImgAlgos.PyAlgos import PyAlgos alg_arc = PyAlgos(windows=winds_arc, mask=mask_arc, pbits=2) alg_arc.set_peak_selection_pars(npix_min=4, npix_max=500, amax_thr=0, atot_thr=600, son_min=5) # for pfv2,4 #alg_arc.set_peak_selection_pars(npix_min=4, npix_max=500, amax_thr=0, atot_thr=600, son_min=10) # for pfv3 alg_equ = # all parameters are the same as for alg_arc peaks_arc = alg_arc.peak_finder_v2(nda, thr=10, r0=6, dr=0.5) # Flood-filling #peaks_arc = alg_arc.peak_finder_v3(nda, rank=6, r0=6, dr=0.5) # Ranker #peaks_arc = alg_arc.peak_finder_v4(nda, thr_low=10, thr_high=150, rank=5, r0=6, dr=0.5) # Droplet-finder
This script saves a
Peak list processing
For further peak list processing we use script:
cxif5315/proc-cxif5315-r0169-peaks-from-file-v4.py
which uses peak selectors.
Peak Selectors
In this section we list distribution of peak parameters right after peak finders and discuss parameter range for further selection stage in
and
We process Data of cxif5315-r0169 for peaks in ARC and Equatorial region separately. Each triplet of histograms represents peak finder v2, v3, v4, respectively.
peak_finder_v2, v3, v4: ARC
- Amax is only used in pfv4 as
thr_high=150
that helps to reduce a number of seed peaks
- Atot is used in all peak-finders as
atot_thr=600
if pk.atot<1200 : return False
most likely can be harmlessly increased to 1500-1800ADU
- rms is used in all peak-finders at processing in peak selector
if pk.rms>60 : return False
- bkgd is used in all peak-finders at processing in peak selector
if math.fabs(pk.bkgd)>20 : return False
- npix is used in all peak-finders in peak selector
npix_min=4, npix_max=500
if pk.npix>200 : return False
- S/N is used as
son_min=5 # for pfv2,4
son_min=10 # for pfv3
- Ranker - to eliminate large number of purely statistical seed peaks
- S/N evaluated for all pixels
if pk.sonc<5 : return False
if pk.r<435 : return False if pk.r>443 : return False
peak_finder_v2, v3, v4: EQU
- Amax is only used in pfv4 as
thr_high=150
- Atot is used in all peak-finders as
atot_thr=600
if pk.atot<1800 : return False
if pk.rms>60 : return False
- bkgd is used in all peak-finders at processing in peak selector
if math.fabs(pk.bkgd)>20 : return False
- npix is used in all peak finders in peak selector
npix_min=4, npix_max=500
if pk.npix>200 : return False
son_min=5
# for pfv2,4
son_min=10# for pfv3
- Ranker - to eliminate large number of purely statistical seed peaks
if pk.r<100 : return False
if pk.r>454 : return False
- Peak azimuthal angle is not used in selectors
Comparison of the pfv2 with Cheetah list of peaks
Code for comparison: cxif5315/peak-list-comp-cheetah.py
Peak lists for comparison:
- peakfinder:
pfv2-cxif5315-r0169-2016-03-28T15:02:47.txt
- cheetah: r0169-cheetah-peaks.txt - with unknown origin...
Comparison algorithm and conditions
Use pyimgalgos.TDFileContainer for both peakfinder and cheetah
fc_ch = TDFileContainer(fncheet, indhdr='frameNumber', objtype=TDCheetahPeakRecord) # , pbits=256) fc_pf = TDFileContainer(fnpeaks, indhdr='Evnum', objtype=TDPeakRecord) #, pbits=256)
- Loop over all groups (frames/events) in cheetah
- Find associated peak-finder group: gr_pf = fc_pf.group(evnum-1) # accounts for -1 offset in event numeration in Cheetah and pf.
- count cases when peak-finder group does not exist (peaks not found)
- discard frames if fidelity do not match
- discard frames with more than 5 peaks
- loop over cheetah peaks
- discard cheetah peaks outside ROI mask
- loop over pf-peaks and check that cheetah peak can be matched with one of them by location (s, r, c)
- if not-matched - print peak main features
Statistics for number of peaks:
- total in Cheetah: 14002
- matched: 10593
- not-matched: 3409
- fraction of matched: 0.757
Plots for number of peaks in peak-finder, Cheetah, and number of non-matched:matched Cheetah peaks.
Peak-finder number of peaks accounts for arc region.