EllipticalMaskMixin#
- class photutils.aperture.EllipticalMaskMixin[source]#
Bases:
object
Mixin class to create masks for elliptical and elliptical-annulus aperture objects.
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 overlap of the aperture on the pixel grid. Not all options are available for all aperture types. Note that the more precise methods are generally slower. The following methods are available:
'exact'
(default): The exact fractional overlap of the aperture and each pixel is calculated. The aperture weights will contain values between 0 and 1.'center'
: A pixel is considered to be entirely in or out of the aperture depending on whether its center is in or out of the aperture. The aperture weights will contain values only of 0 (out) and 1 (in).'subpixel'
: A pixel is divided into subpixels (see thesubpixels
keyword), each of which are considered to be entirely in or out of the aperture depending on whether its center is in or out of the aperture. Ifsubpixels=1
, this method is equivalent to'center'
. The aperture weights will contain values between 0 and 1.
- subpixelsint, optional
For the
'subpixel'
method, resample pixels by this factor in each dimension. That is, each pixel is divided intosubpixels**2
subpixels. This keyword is ignored unlessmethod='subpixel'
.
- Returns:
- mask
ApertureMask
or list ofApertureMask
A mask for the aperture. If the aperture is scalar then a single
ApertureMask
is returned, otherwise a list ofApertureMask
is returned.
- mask