Versions Compared

Key

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

Content

Table of Contents

 

This algorithm is intended to subtract background from "non-assembled" images with approximately angular-symmetric radial distribution of intensities.

For example, pure water ring background from exp=cxij4716:run=22 for single event has an angular symmetry as shown in the plot:

Image AddedImage Added

Code location

Class RadialBkgd resides in the package pyimgalgos.

Auto-generated documentation for class RadialBkgd

Initialization

Code Block
from pyimgalgos.RadialBkgd import RadialBkgd, polarization_factor
rb = RadialBkgd(xarr, yarr, mask=None, radedges=None, nradbins=100, phiedges=(0,360), nphibins=32)

See parameters' description in Auto-generated documentation for class RadialBkgd.

Input n-d arrays can be obtained through the Detector (AreaDetector) interface or directly through the class working with geometry. For example, 

Code Block
from PSCalib.GeometryAccess import GeometryAccess
geo = GeometryAccess(fname_geo)
xarr, yarr, zarr = geo.get_pixel_coords()
iX, iY = geo.get_pixel_coord_indexes()
mask = geo.get_pixel_mask(mbits=0377) # mask for 2x1 edges, two central columns, and unbound pixels with their neighbours 
...

 

Algorithm

Description

...

For example, pure water ring background from exp=cxij4716:run=22 for single event has an angular symmetry as shown in the plot:

Image RemovedImage Removed

To evaluate background n-d array of data is split for 2-d bins in polar coordinate frame. Total intensity and number of involved pixels are counted for each bin and converted to the average bin intensity. Then this averaged intensity is per-pixel subtracted from data n-d array. 

Input per-pixel coordinates passed as numpy n-d arrays xarr and yarr are used to evaluate per-pixel radial and polar angle coordinate arrays:

...

  • averaged over all 14636 events calibrated (pedestal, common mode) data 
  • polarization correction factor 
  • polarization-corrected data
  • radial-background subtracted data using single angular bin

    This image indicates on in-correct geometry; background center consistent with beam intersection does not coincide with detector origin (0,0). 
  • radial-background subtracted data using 8 angular bins
  • dynamically apply some geometry correction

    Code Block
        geo = GeometryAccess(fname_geo)
        geo.move_geo('CSPAD:V1', 0, 1600, 0, 0)
        geo.move_geo('QUAD:V1', 2, -100, 0, 0)

    and plot again radial-background subtracted data using single angular bin

    we get that "dish"-like shape disappears.

  • Interpolation (linear) between centers of the background bins could also help:

    Code Block
        bkgd  = rb.bkgd_nda_interpol(nda, method='linear') # method='nearest' 'cubic'
        cdata = rb.subtract_interpol(nda, method='linear')

    Interpolation for entire detector and for part of the image:

     

    Image is not as impressive as for polarization-corrected sample, but the residual intensity spread shrink down to RMS~3 ADU.

  • Subtraction of single Single angular bin interpolated background, data from exp=cxij4915:run=25
    Image Removedand its subtraction from data:
    Image AddedImage AddedImage Added

CSPAD "dopping" artifacts

References