SkyCircularAnnulus#
- class photutils.aperture.SkyCircularAnnulus(positions, r_in, r_out)[source]#
Bases:
SkyApertureA circular annulus aperture defined in sky coordinates.
The aperture has a single fixed size/shape, but it can have multiple positions (see the
positionsinput).- Parameters:
- Raises:
- TypeError
TypeError If either radius (
r_inorr_out) is not aQuantity.- ValueError
ValueError If the inner radius (
r_in) is not less than the outer radius (r_out).- ValueError
ValueError If either radius (
r_inorr_out) is not positive.
- TypeError
Examples
>>> from astropy.coordinates import SkyCoord >>> import astropy.units as u >>> from photutils.aperture import SkyCircularAnnulus >>> positions = SkyCoord(ra=[10.0, 20.0], dec=[30.0, 40.0], unit='deg') >>> aper = SkyCircularAnnulus(positions, 0.5*u.arcsec, 1.0*u.arcsec)
Attributes Summary
Whether the instance is scalar (i.e., a single position).
The center position(s) in sky coordinates.
The inner radius in angular units.
The outer radius in angular units.
The shape of the instance.
Methods Summary
copy()Make a deep copy of this object.
to_pixel(wcs, *[, as_ellipse])Convert the aperture to a
CircularAnnulusobject defined in pixel coordinates.Attributes Documentation
- isscalar#
Whether the instance is scalar (i.e., a single position).
- positions#
The center position(s) in sky coordinates.
- r_in#
The inner radius in angular units.
- r_out#
The outer radius in angular units.
- shape#
The shape of the instance.
Methods Documentation
- to_pixel(wcs, *, as_ellipse=False)[source]#
Convert the aperture to a
CircularAnnulusobject 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).- as_ellipsebool, optional
If
True, return the image of the circular annulus under the local linear WCS at the reference position, which is an elliptical annulus whenever the pixels are not square or the WCS is sheared. IfFalse(the default), return a circular annulus whose inner and outer radii are scaled by the isotropic mean pixel scale.
- Returns:
- aperture
CircularAnnulusorEllipticalAnnulus The pixel aperture. An
EllipticalAnnulusis returned ifas_ellipseisTrue.
- aperture
Notes
The aperture shape parameters are converted using the local WCS pixel scale 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.