CircularAperture

class photutils.aperture.CircularAperture(positions, r)[source]

Bases: photutils.aperture.CircularMaskMixin, photutils.aperture.PixelAperture

A circular aperture defined in pixel coordinates.

The aperture has a single fixed size/shape, but it can have multiple positions (see the positions input).

Parameters
positionsarray_like or Quantity

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

  • single (x, y) pair as a tuple, list, or ndarray

  • tuple, list, or ndarray of (x, y) pairs

  • Quantity instance of (x, y) pairs in pixel units

rfloat

The radius of the circle in pixels.

Raises
ValueErrorValueError

If the input radius, r, is negative.

Examples

>>> from photutils import CircularAperture
>>> aper = CircularAperture([10., 20.], 3.)
>>> aper = CircularAperture((10., 20.), 3.)
>>> pos1 = (10., 20.)  # (x, y)
>>> pos2 = (30., 40.)
>>> pos3 = (50., 60.)
>>> aper = CircularAperture([pos1, pos2, pos3], 3.)
>>> aper = CircularAperture((pos1, pos2, pos3), 3.)

Attributes Summary

area

Return the exact area of the aperture shape.

positions

Validate and set positions for pixel-based apertures.

r

Check that value is a strictly positive (>= 0) scalar.

Methods Summary

to_sky(wcs)

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

Attributes Documentation

area
positions

Validate and set positions for pixel-based apertures.

In all cases, pixel positions are converted to a 2D ndarray (without units).

r

Check that value is a strictly positive (>= 0) scalar.

Methods Documentation

to_sky(wcs)[source]

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

Parameters
wcsWCS object

A world coordinate system (WCS) transformation that supports the astropy shared interface for WCS (e.g., astropy.wcs.WCS, gwcs.wcs.WCS).

Returns
apertureSkyCircularAperture object

A SkyCircularAperture object.