Page History
...
Test of the NDArrCalib module for pnCCD.
Module ImgAlgos::NDArrDropletFinder
Finds "droplets" (wide peaks) in data ndarray and saves their list in output ndarray. This is a re-implementation of algorithm ImgPeakFinder for ndarray 2-d segments:
1. Select the pixels in the windows rowmin
, rowmax
, colmin
, colmax
with amplitudes above the threshold_low
.
2. Optionally smears image for selected pixels, using 2-d matrix of weights over pixels from -smear_radius
to +smear_radius
around each smeared pixel amplitude. The matrix of weights is defined by the 2-d Gaussian function of width sigma
. If sigma=0
smearing is not applied.
3. Find peaks as pixels with absolute-maximal amplitude above the threshold_high
in the center of the matrix -peak_radius
to +peak_radius
.
4. Put the vector or ndarray of found peaks in the event with key peaksKey
or peaks_nda
respectively. Each entry of this vector has an object of the struct Peak
, containing x, y positions, peak pixel amplitude, the total amplitude in the matrix, defined by the peak_radius
, and the number of pixels in the matrix above threshold_low
:
Anchor | ||||
---|---|---|---|---|
|
Code Block | ||
---|---|---|
| ||
struct Droplet{
unsigned seg;
double row;
double col;
double ampmax; // amplitude in the peak maximum
double amptot; // total amplitude in the range of {{peak_radius}}
unsigned npix; // number of pixels in the range of {{peak_radius}}
};
|
parameter | default value | description |
---|---|---|
| "DetInfo()" | source of data |
|
| key for input data ndarray, default is empty - raw data |
| key for output list of peaks as std::vector<Peak> (default is empty - do not save) | |
| 10 | low threshold on pixel amplitude |
| 100 | high threshold on pixel amplitude |
| 1.5 | width of the Gaussian for smearing; =0-no smearing |
| 3 | radius in pixel for smearing - radial size of matrix of weights |
| 3 | radius in pixel for peak finding - radial size of the region to search for local maximum |
|
| list of windows, each window is defined by 5 parameters; segment-index, rowmin, rowmax,colmin,colmax, separated by space. Default is empty - process all segments |
| 0 | event number for test purpose |
| 0 | module verbosity:
|
Remarks:
- if
print_bits
is not zero - warning messages will be printed. - Saves table of droplets/peaks as ndarray<float,2> with shape=[ndroplets,6] (see Struct Droplet) if key
peaks_droplets
is non-empty.
See also Example for Module ImgAlgos::NDArrDropletFinder
Module ImgAlgos::PixCoordsProducer
Functionality
...