SkyRectangularAnnulus#
- class photutils.aperture.SkyRectangularAnnulus(positions, w_in, w_out, h_out, h_in=None, theta=<Quantity 0. deg>)[source]#
Bases:
SkyApertureA rectangular annulus aperture defined in sky coordinates.
The aperture has a single fixed size/shape, but it can have multiple positions (see the
positionsinput).- Parameters:
- positions
SkyCoord The celestial coordinates of the aperture center(s). This can be either scalar coordinates or an array of coordinates.
- w_inscalar
Quantity The inner full width of the rectangular annulus in angular units. For
theta=0the width side is along the North-South axis.- w_outscalar
Quantity The outer full width of the rectangular annulus in angular units. For
theta=0the width side is along the North-South axis.- h_outscalar
Quantity The outer full height of the rectangular annulus in angular units.
- h_in
Noneor scalarQuantity The inner full height of the rectangular annulus in angular units. If
None, then the inner full height is calculated as:\[h_{in} = h_{out} \left(\frac{w_{in}}{w_{out}}\right)\]For
theta=0the height side is along the East-West axis.- thetascalar
Quantity, optional The position angle (in angular units) of the rectangle “width” side. For a right-handed world coordinate system, the position angle increases counterclockwise from North (PA=0).
- positions
Examples
>>> from astropy.coordinates import SkyCoord >>> import astropy.units as u >>> from photutils.aperture import SkyRectangularAnnulus >>> positions = SkyCoord(ra=[10.0, 20.0], dec=[30.0, 40.0], unit='deg') >>> aper = SkyRectangularAnnulus(positions, 3.0*u.arcsec, 8.0*u.arcsec, ... 5.0*u.arcsec)
Attributes Summary
The inner full height in angular units.
The outer full height in angular units.
Whether the instance is scalar (i.e., a single position).
The center position(s) in sky coordinates.
The shape of the instance.
The position angle (in angular units) of the rectangle "width" side.
The inner full width in angular units.
The outer full width in angular units.
Methods Summary
copy()Make a deep copy of this object.
to_pixel(wcs)Convert the aperture to a
RectangularAnnulusobject defined in pixel coordinates.Attributes Documentation
- h_in#
The inner full height in angular units.
- h_out#
The outer full height in angular units.
- isscalar#
Whether the instance is scalar (i.e., a single position).
- positions#
The center position(s) in sky coordinates.
- shape#
The shape of the instance.
- theta#
The position angle (in angular units) of the rectangle “width” side.
- w_in#
The inner full width in angular units.
- w_out#
The outer full width in angular units.
Methods Documentation
- to_pixel(wcs)[source]#
Convert the aperture to a
RectangularAnnulusobject defined in pixel 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
RectangularAnnulusobject A
RectangularAnnulusobject.
- aperture
Notes
The aperture shape parameters are converted using the local WCS properties (pixel scale, rotation angle) evaluated at the first aperture position. Because aperture objects require scalar shape parameters, only a single reference position is used for the conversion. For apertures with multiple positions used with a WCS that has spatially-varying distortions, this may produce inaccurate results for positions far from the first position.