background

sofia_redux.instruments.forcast.background.background(data, section, header=None, stat=None, mask=None)[source]

Calculate the background of the image

Takes median or mode of good pixels in selected region

Parameters:
datanumpy.ndarray

(nimage, ncol, nrow)

sectiontuple of (int or float) or list of (int or float)

Data section to use. Should have the format (X0, Y0, XDIM, YDIM) where X0, Y0 is the center of the section and XDIM, YDIM is the dimension of the section.

headerastropy.io.fits.header.Header, optional

Input header array to be updated with NLINSLEV (containing the background levels) and HISTORY keyworks

statstr, optional

Statistic to use to calculate the background level (‘median’ or ‘mode’)

masknumpy.ndarray, optional

(col, row) Illumination mask to indicate regions of the image to use in calculating the image (True = good)

Returns:
numpy.ndarray

(nimage) containing background levels for each input frame