CircularAperture

class photutils.CircularAperture[source]

Bases: photutils.CircularMaskMixin, photutils.PixelAperture

Circular aperture(s), defined in pixel coordinates.

Parameters:

positions : array_like or Quantity

Pixel coordinates of the aperture center(s) in one of the following formats:

  • single (x, y) tuple
  • list of (x, y) tuples
  • Nx2 or 2xN ndarray
  • Nx2 or 2xN Quantity in pixel units

Note that a 2x2 ndarray or Quantity is interpreted as Nx2, i.e. two rows of (x, y) coordinates.

r : float

The radius of the aperture(s), in pixels.

Raises:

ValueError : ValueError

If the input radius, r, is negative.

Attributes Summary

bounding_boxes

Methods Summary

area() Return the exact area of the aperture shape.
plot([origin, indices, ax, fill]) Plot the aperture(s) on a matplotlib Axes instance.
to_sky(wcs[, mode]) Convert the aperture to a SkyCircularAperture object defined in celestial coordinates.

Attributes Documentation

bounding_boxes

Methods Documentation

area()[source]

Return the exact area of the aperture shape.

Returns:

area : float

The aperture area.

plot(origin=(0, 0), indices=None, ax=None, fill=False, **kwargs)[source]

Plot the aperture(s) on a matplotlib Axes instance.

Parameters:

origin : array_like, optional

The (x, y) position of the origin of the displayed image.

indices : int or array of int, optional

The indices of the aperture(s) to plot.

ax : matplotlib.axes.Axes instance, optional

If None, then the current Axes instance is used.

fill : bool, optional

Set whether to fill the aperture patch. The default is False.

kwargs

Any keyword arguments accepted by matplotlib.patches.Patch.

to_sky(wcs, mode=u'all')[source]

Convert the aperture to a SkyCircularAperture object defined in celestial coordinates.

Parameters:

wcs : WCS

The world coordinate system (WCS) transformation to use.

mode : {‘all’, ‘wcs’}, optional

Whether to do the transformation including distortions ('all'; default) or only including only the core WCS transformation ('wcs').

Returns:

aperture : SkyCircularAperture object