CircularMaskMixin#
- class photutils.aperture.CircularMaskMixin(**kwargs)[source]#
Bases:
objectDeprecated since version 3.0: This function was deprecated in version 3.0 and will be removed in version 4.0.
Mixin class to create masks for circular and circular-annulus aperture objects.
Deprecated since version 3.0: This function was deprecated in version 3.0 and will be removed in version 4.0.
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. A pixel is included only if its center lies strictly inside the aperture. Pixel centers lying exactly on the outer aperture boundary are excluded (weight 0). For an annulus, pixel centers lying exactly on the inner boundary are included (weight 1).'subpixel': Approximates the overlap by averaging binary samples on a subgrid. The number of samples is set by thesubpixelsparameter. Weights are discrete in the range [0, 1]. A subpixel is included only if its center lies strictly inside the aperture. Subpixel centers lying exactly on the outer aperture boundary are excluded (weight 0). For an annulus, subpixel centers lying exactly on the inner boundary are included.
- subpixelsint, optional
The subsampling factor per axis used with the
'subpixel'method. Each pixel is divided into a grid ofsubpixels**2subpixels to approximate the overlap. This parameter is ignored for other methods.
- Returns:
- mask
ApertureMaskor list ofApertureMask A mask for the aperture. If the aperture is scalar then a single
ApertureMaskis returned, otherwise a list ofApertureMaskis returned.
- mask