# RectangularAnnulus¶

class photutils.aperture.RectangularAnnulus(positions, w_in, w_out, h_out, h_in=None, theta=0.0)[source]

A rectangular 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:

w_infloat

The inner full width of the rectangular annulus in pixels. For theta=0 the width side is along the x axis.

w_outfloat

The outer full width of the rectangular annulus in pixels. For theta=0 the width side is along the x axis.

h_outfloat

The outer full height of the rectangular annulus in pixels.

h_inNone or float

The inner full height of the rectangular annulus in pixels. If None, then the inner full height is calculated as:

$h_{in} = h_{out} \left(\frac{w_{in}}{w_{out}}\right)$

For theta=0 the height side is along the y axis.

thetafloat, optional

The rotation angle in radians of the rectangle “width” side from the positive x axis. The rotation angle increases counterclockwise. The default is 0.

Raises
ValueErrorValueError

If inner width (w_in) is greater than outer width (w_out).

ValueErrorValueError

If either the inner width (w_in) or the outer height (h_out) is negative.

Examples

>>> from photutils.aperture import RectangularAnnulus
>>> aper = RectangularAnnulus([10., 20.], 3., 8., 5.)
>>> aper = RectangularAnnulus((10., 20.), 3., 8., 5., theta=np.pi)

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


Attributes Summary

 area The exact area of the aperture shape. h_in The inner full height in pixels. h_out The outer full height in pixels. positions The center pixel position(s). theta The counterclockwise rotation angle in radians of the rectangle “width” side from the positive x axis. w_in The inner full width in pixels. w_out The outer full width in pixels.

Methods Summary

 to_sky(wcs) Convert the aperture to a SkyRectangularAnnulus object defined in celestial coordinates.

Attributes Documentation

area
h_in

The inner full height in pixels.

h_out

The outer full height in pixels.

positions

The center pixel position(s).

theta

The counterclockwise rotation angle in radians of the rectangle “width” side from the positive x axis.

w_in

The inner full width in pixels.

w_out

The outer full width in pixels.

Methods Documentation

to_sky(wcs)[source]

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

A SkyRectangularAnnulus object.