Versions Compared

Key

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

...

Peak finding algorithms locate regions of charge in an area detector.   psana-python represents In LCLS data all area detectors as numpy are represented by n-d arrays (typically a 2-dimensional array for image, or a 3-dimensional array for multi-panel detectors) so these python-callable algorithms will work on all area detectorsn-d arrays.

Additional documentation is here and examples are here.

Algorithms

All peak finders and a few other image processing algorithms are available in a single class suit supporting common infrastructure. All algorithms work with good pixels defined by the mask and inside specified rectangular windows. Both these mechanisms (windows and mask) can be used to describe a region of interest. By default, if mask or/and windows are not specified, all pixels are processed. A few versions of peak finder use different approach to the peak definition (finding group of pixels forming a peak) at first stage and the same algorithms at final stage for evaluation of peak parameters, as explained below. 

Peak Finder "V1"

This algorithm uses a "seed" threshold to start finding peaks, and then a lower "neighbor" threshold to add additional pixels to the peak .  A surrounding region can be specified as a background region to evaluate signal-over-noise.inside the square region defined by the radial parameter.  

Peak Finder "V2"

This is similar to the "V1" algorithm , but uses a single low threshold , and then joins regions of contiguous pixels with intensity above threshold using a "flood-fill" algorithm.  A surrounding region can be specified as a background region to evaluate signal-over-noise. 

Peak Finder "V3"

This algorithm finds the largest intensity pixel in a square region set by a "rank"-radial parameter .  The square extends from maxPixel-rank to maxPixel(local maximum for rank).  Peak candidate includes all pixels with intensity above zero in the square region spanning from −rank to +rank in both the x/y directions.  The total amplitude is evaluated as the sum of all pixels inside the square that are larger than zero.  The noise can also be evaluated in user-specified ring around the peak.  The row and column directions relative maximal intensity pixel.

At final stage all pixels associated with peak are used to evaluate peak maximum row and column, total intensity, center of gravity coordinates, limits of the peak region.  A surrounding user-specified ring-region of pixels around the peak is used to evaluate average background level, its rms spread, and signal-over-noise ratio. The user will typically reduce the number of peaks returned from this algorithm these algorithms by applying cuts to signal levels or signal-over-noise ratio.