CircularAnnulus

class photutils.aperture.CircularAnnulus(positions, r_in, r_out)[source]

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

A circular annulus 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

r_infloat

The inner radius of the circular annulus in pixels.

r_outfloat

The outer radius of the circular annulus in pixels.

Raises
ValueErrorValueError

If inner radius (r_in) is greater than outer radius (r_out).

ValueErrorValueError

If inner radius (r_in) is negative.

Examples

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

Attributes Summary

area

Return the exact area of the aperture shape.

positions

Validate and set positions for pixel-based apertures.

r_in

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

r_out

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

Methods Summary

to_sky(wcs)

Convert the aperture to a SkyCircularAnnulus 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_in

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

r_out

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

Methods Documentation

to_sky(wcs)[source]

Convert the aperture to a SkyCircularAnnulus 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
apertureSkyCircularAnnulus object

A SkyCircularAnnulus object.