scopesim.effects.psfs.psf_base.get_bkg_level

Contents

scopesim.effects.psfs.psf_base.get_bkg_level#

scopesim.effects.psfs.psf_base.get_bkg_level(obj, bg_w)#

Determine the background level of image or cube slices.

Returns a scalar if obj is a 2d image or a vector if obj is a 3D cube (one value for each plane). The method for background determination is decided by self.meta[“bkg_width”]: If 0, the background is returned as zero (implying no background subtraction). If -1, the background is estimated as the median of the entire image (or cube plane). If positive, the background is estimated as the median of a frame of width bkg_width around the edges.