Versions Compared

Key

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

...

  • ImgIntForBins uses the source and key_in parameters to get the input image (as ndarray<T,2> object), where T stands for uint16_t, int, float, uint8_t, or double,
  • gets the pixel-bin indexes from files fname_map_bins, which has a size of image,
  • calculates average per pixel intensity for each of number_of_bins bin (from 0 to number_of_bins-1),
  • saves the 2-D array of <I>(event, bin) in file fname_int_bins.

...

parameter

default value

description

source

...

"DetInfo(:Camera)"

...

source of data

...

key_in

...

 

key for input image

...

fname_map_bins

...

 

input file name for map of bin indexes

...

fname_int_bins

...

 

output file name for intensity(bin,event)

...

number_of_bins

...

10

number of bins for output intensities, if map has bins \>=number_of_bins they will be ignored

...

print_bits

...

0

verbosity:

  • =0 - print nothing

...

  • +1 - input pars

...

  • +2 - time stamp for each event

...

  • +4 - detailed info about input file pars

...

  • +8 - the first 100 chars of the output intensity string
  • +32 - info about open/close output file

Module ImgAlgos::ImgRadialCorrection

This module averages the image pixel amplitude in r-phi bins, normalizes it per single pixel and subtracts the average amplitude from each pixel. Image is obtained from event by its source and inkey values. The output corrected image is saved in the event with outkey keyword. Carthesian to polar coordinate transformation is done with respect to center coordinates xcenter, ycenter. The central region (r<rmin) and edges of the image (r>rmax) pixels can be removed from further consideration by setting rmin and rmax. The number of radial bins is defined as an int(rmax-rmin). The number of angular bins is set by n_phi_bins.

Module configuration parameters:

...

parameter

default value

description

source

"DetInfo()"

...

input source of data

...

inkey

...

 

key for input data, by default use raw data

...

outkey

...

"rad_corrected"

...

output key for further image processing

...

xcenter

...

850

x coordinate of the image center

...

ycenter

...

850

y coordinate of the image center

...

rmin

...

10

radius minimal image is not processed for r<rmin

...

rmax

...

1000

radius maximal image is not processed for r>rmax

...

n_phi_bins

...

12

number of angular sectors for the background averaging

...

event

...

0

test event for print/save

...

print_bits

...

0

module verbosity:

  • =0 - print nothing,
  • +1 - input pars,
  • +2 - summary,
  • +4 - event ID,
  • +8 - info about input image type (ndarray<double,2> or Image2D<double>)

...

See also Example for Module ImgAlgos::ImgRadialCorrection.

...

The algorithm performance was tested for CSPad images. This algorithm consumes up to 15 ms/event on psana0205 for full CSPad (1650x1650) window size. For smaller window consumed time is negligible, comparing to the image reconstruction time, which is ~70 ms/event (for cspad_mod.CsPadCalib and CSPadPixCoords::CSPadImageProducer) on psana0205.Module configuration parameters:

parameter

default value

description

source

...

"DetInfo(:Cspad)"

...

source of data

...

key

...

"Image2D"

...

key for input image data

...

threshold

...

10

minimal threshold on pixel amplitude

...

numPixMin

...

100

minimal number of pixels with amplitude above the threshold

...

filterIsOn

...

true

On/Off the filter

...

xmin

...

0

minimal column number

...

xmax

...

100000

maximal column number

...

ymin

...

0

minimal row number

...

ymax

...

100000

maximal row number

...

print_bits

...

0

verbosity:

  • =0 - print nothing,
  • +1 - input pars,
  • +2 - summary,
  • +4 - per event number of pixels above the threshold,
  • +8 - the same as previous, but for each 100's event,
  • +16 - event ID

...

Remarks:

  • The default key ("Image2D") stands for the CSPadPixCoords::Image2D<double> image object. Other key names work for the ndarray<double,2> image object.
  • The xmin, xmax, ymin, ymax (in pixels) defines the window in the image for pixel counting. Default values means the entire image range.
  • The threshold, numPixMin, and the window extents have to be adjusted for particular experiment.

...

Code Block
bgColor#F7F7ED
struct Peak{
   double x;
   double y;
   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}}
} ;

Module configuration parameters:

...

parameter

default value

description

source

"DetInfo()"

...

source of data

key

...

 

key for input image data

peaksKey

...

"peaks"

...

key for output list of peaks

threshold_low

...

10

low threshold on pixel amplitude

threshold_high

...

100

high threshold on pixel amplitude

sigma

...

1.5

...

width of the Gaussian for smearing; =0-no smearing

smear_radius

...

3

radius in pixel for smearing - radial size of matrix of weights

peak_radius

...

3

radius in pixel for peak finding - radial size of the region to search for local maximum

xmin

...

0

minimal column number

xmax

...

100000

maximal column number

ymin

...

0

minimal row number

ymax

...

100000

maximal row number

testEvent

...

0

event number to save images and print info for test purpose

finderIsOn

...

true

On/Off algorithm

print_bits

...

0

module verbosity:

  • =0 - print nothing,
  • +1 - input pars,
  • +2 - summary,
  • +4 - number of peaks in the event,
  • +8 - per event each peak parameters,
  • +16- info about input image format

...

Remarks:

  • This algorithm consumes ~15 ms/event on psana0101 for full Opal1000 (1024x1024) camera image.
  • Smearing algorithm use a "safety margin" which is currently set to 10 pixels (offset from each boarder of the full image size).

...