Page History
...
Only listed segments are highlighted on plots:
Background
Averaged background shape
Background shape evaluated in exp=cxif5315:run=162
...
Background shape evaluated with common mode correction - central segments got offset to higher intensity
...
Background shape evaluated evaluated in exp=cxif5315:run=162 without common mode correction - common mode offsets averaged out to zero and image represents true background shape.
...
Radial background subtraction
For some reason polarization correction does not work well in this experiment for entire image.
Comparison of the 2-d interpolated radial background subtraction
- nbins (rad:500, phi:1)
- nbins (rad:500, phi:32)
...
polarization correction factor map orientation should be consistent with geometry file - in cxif5315 it should be rotated by 90°.
Code Block |
---|
from pyimgalgos.RadialBkgd import RadialBkgd, polarization_factor
X, Y, Z = geo.get_pixel_coords()
rb = RadialBkgd(X, Y, mask, nradbins=500, nphibins=1)
pf = polarization_factor(rb.pixel_rad(), rb.pixel_phi()+phi_pf, 91.33e3)
# in event loop:
nda, title = rb.subtract_bkgd_interpol(arr * pf) * mask |
For example we apply this algorithm to the water background averaged sample from exp=cxif5315:run=162:
Radial background fails to work in the region of shadow, where image miss symmetry. This region can be removed by constraining the range of angles phiedges=(40, 325).
In the next plot the radial range is also constrained as radedges=(5000,100000) for the purpose of example:
Code Block |
---|
# the same as in previous case, but
rb = RadialBkgd(X, Y, mask, nradbins=500, nphibins=1, phiedges=(40, 325), radedges=(5000,100000)) |
SIngle angular bin still works fine in our ROI defined by both masks.
Background subtraction examples
Code Block |
---|
from pyimgalgos.GlobalUtils import subtract_bkgd
# once per run:
sp.nda_peds = sp.det.pedestals(runnum)
sp.nda_bkgd = sp.det.bkgd(runnum) # get n-d array with averaged background from calib/.../pixel_bkgd
sp.nda_smask = sp.det.mask(evt, calib=False, status=True, edges=True, central=True, unbond=True, unbondnbrs=True)
# in the event loop
nda_raw = sp.det.raw(evt)
if nda_raw is not None :
nda = np.array(nda_raw, dtype=np.float32, copy=True)
nda -= sp.nda_peds
# Subtract background shape averaged for pure water
nda = subtract_bkgd(nda, sp.nda_bkgd, mask=sp.nda_smask, winds=sp.winds_bkgd, pbits=0) |
Subtract background shape evaluated in run 192
...