Versions Compared

Key

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

...

Background subtraction examples

Subtract background shape evaluated in run 192

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)

	        # windows for background normalization
        winds_bkgd = [(s, 10, 100, 270, 370) for s in (4,12,20,28)] # use part of segments 4,12,20,28 to subtr bkg

        # 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

Radial background subtraction

...

Note

Background shape was evaluated WITH common mode correction. Central ; central 2x1s got offset due to non-uniform water background shape.

...

  • masked pixels contributes to peak at 0
  • 1-, 2- and 3- photon peaks are seen
  • common mode correction before background subtraction does not work well in this data sample due to significant fraction of 1-photon peak next to noise peak, which makes an offset due to illumination.
  • common mode correction after background subtraction does not work - it moves noise peak to 0 and destroys background subtraction results.

 

 

...



Note

Any Potentially any non-dark data spectra potentially can be used to calibrate pixel gain.

 

 

...

References