CircularMaskMixin#

class photutils.aperture.CircularMaskMixin(**kwargs)[source]#

Bases: object

Deprecated since version 3.0: This function was deprecated in version 3.0 and will be removed in a future version.

Mixin class to create masks for circular and circular-annulus aperture objects.

Deprecated since version 3.0.

Deprecated since version 3.0: This function was deprecated in version 3.0 and will be removed in a future version.

Methods Summary

to_mask([method, subpixels])

Return a mask for the aperture.

Methods Documentation

to_mask(method='exact', subpixels=5)[source]#

Return a mask for the aperture.

Parameters:
method{‘exact’, ‘center’, ‘subpixel’}, optional

The method used to determine the pixel weights (the fraction of the pixel area covered by the aperture):

  • 'exact' (default): Calculates the exact geometric overlap area. Weights are continuous in the range [0, 1].

  • 'center': Binary weighting based on the pixel center. Weights are either 0 or 1.

  • 'subpixel': Approximates the overlap by averaging binary samples on a subgrid. The number of samples is set by the subpixels parameter. Weights are discrete in the range [0, 1].

subpixelsint, optional

The subsampling factor per axis used when method='subpixel'. Each pixel is divided into a grid of subpixels**2 subpixels to approximate the overlap. This parameter is ignored for other methods.

Returns:
maskApertureMask or list of ApertureMask

A mask for the aperture. If the aperture is scalar then a single ApertureMask is returned, otherwise a list of ApertureMask is returned.