Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
python psana-cxif5315-r0169-cspad-ds2-NDArrDropletFinder.py

Example: get table of peaks for different regions

Image with peaks for separate and both regions can be plotted:

...

The 1st line in this file is a (commented) header with colon-titles.

 

Example: optimization of peak parameters

Peak selection parameters in module ImgAlgos.NDArrDropletFinder:

Code Block
[ImgAlgos.NDArrDropletFinder:Arc]
...
threshold_low  = 10
threshold_high = 150
peak_radius    = 3
...

 

Peak list selection parameters:

Code Block
nda_peaks_arc = peaks_filter(nda_droplets_arc, atot_thr=2000, npix_thr=20, npeaks_min=1, npeaks_max=10)  
Code Block
def peakIsSelected() :
    """Apply peak selection criteria to each peak from file
    """
    amax, atot, npix, x, y, r, phi = sp.amax, sp.atot, sp.npix, sp.x, sp.y, sp.r, sp.phi
    if amax<150  : return False
    if atot<2500 : return False
    if npix<30   : return False
    if r<434     : return False
    if r>444     : return False
    if phi<150 and phi>-150 : return False
    return True

 

 

 

ParameterSel.1 (rpeak5)Sel.2 (rpeak7)Sel.3 (rpeak3)
in module NDArrDropletFinder:Arc
threshold_low
101010
threshold_high
100100150
peak_radius
573
in method peaks_filter(...)
atot_thr
200020002000
npix_thr
204020
npeaks_min
111
npeaks_max
104010
peakIsSelected()
amax
150150150
atot
2500
2500
2500
npix
304020
rmin
434434434
rmax444444444
phi
<-150 & >150<-150 & >150<-150 & >150

 

Sel.1 (rpeak=5):

Image AddedImage AddedImage AddedImage AddedImage AddedImage AddedImage AddedImage Added

 

Sel.2 (rpeak=7):

Image AddedImage AddedImage AddedImage AddedImage AddedImage AddedImage AddedImage Added

Sel.3 (rpeak=3):

 

 

 

 

Remarks

  • Peak finder parameters - all parameters in the peak finder are set without optimization. They need to be tuned in two places;
    1.  in the configuration file for two modules ImgAlgos.NDArrDropletFinder(:Arc/:Equ), and
    2.  in the python script in calls of peaks_filter(...) method.
  • ROI for peakfinder is defined by combination of two mechanisms;
    1. mask - ndarray with values 1/0. Pixels masked by "0", are ignored.
    2. a set of rectangular windows on sensors, defined by the parameter windows in module ImgAlgos::NDArrDropletFinder.

...