background#

astropop.photometry.background(data, box_size=64, filter_size=3, mask=None, bkg_method='mode', rms_method='std', sigma_clip=3.0, global_bkg=True)#

Estimate the background and noise values in a image.

The used algorithm is described by photutils.background.Background2D. It splits the image into boxes of size box_size and calculate the background and noise in each box. The final background and noise values are interpolated using filter_size neighboring boxes.

Parameters:
data: array_like

2D array containing the image to extract the background.

box_size: `int` (optional)

Size of background boxes in pixels. Default: 64

filter_size: `int` (optional)

Filter size in boxes unit. Default: 3

mask: array_like (optional)

Boolean mask where 1 pixels are masked out in the background calculation. Default: None

sigma_clip: `float` or `tuple` (optional)

Sigma clipping value. If a tuple is given, the first value is the lower sigma and the second is the upper sigma.

bkg_method: ``’mode’``, ``’mean’``, ``’median’`` (optional)

Method to calculate the background. By 'mode' it uses the SExtractorBackground algorithm. 'mean' and 'median' uses MeanBackground and MedianBackground respectively. Default: 'mode'

rms_method: ``’std’``, ``’mad_std’`` (optional)

Method to calculate the rms. 'std' uses the standard deviation and 'mad_std' uses the median absolute deviation. Default: 'std'

global_bkg: `bool`

If True, the algorithm returns a single value for background and rms, else, a 2D image with local values will be returned. The global value is computed as the median of the 2D local values. Default: True

Returns:
background: float or ndarray

Background value or image.

rms: float or ndarray

RMS value or image.