EllipticalAnnulus

class photutils.aperture.EllipticalAnnulus(positions, a_in, a_out, b_out, b_in=None, theta=0.0)[source]

Bases: photutils.aperture.EllipticalMaskMixin, photutils.aperture.PixelAperture

An elliptical 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

a_infloat

The inner semimajor axis of the elliptical annulus in pixels.

a_outfloat

The outer semimajor axis of the elliptical annulus in pixels.

b_outfloat

The outer semiminor axis of the elliptical annulus in pixels.

b_inNone or float, optional

The inner semiminor axis of the elliptical annulus in pixels. If None, then the the inner semiminor axis is calculated as:

\[b_{in} = b_{out} \left(\frac{a_{in}}{a_{out}}\right)\]
thetafloat, optional

The rotation angle in radians of the ellipse semimajor axis from the positive x axis. The rotation angle increases counterclockwise. The default is 0.

Raises
ValueErrorValueError

If inner semimajor axis (a_in) is greater than outer semimajor axis (a_out).

ValueErrorValueError

If either the inner semimajor axis (a_in) or the outer semiminor axis (b_out) is negative.

Examples

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

Attributes Summary

a_in

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

a_out

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

area

Return the exact area of the aperture shape.

b_in

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

b_out

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

positions

Validate and set positions for pixel-based apertures.

theta

Check that value is a scalar.

Methods Summary

to_sky(wcs)

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

Attributes Documentation

a_in

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

a_out

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

area
b_in

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

b_out

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

positions

Validate and set positions for pixel-based apertures.

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

theta

Check that value is a scalar.

Methods Documentation

to_sky(wcs)[source]

Convert the aperture to a SkyEllipticalAnnulus 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
apertureSkyEllipticalAnnulus object

A SkyEllipticalAnnulus object.