SkyEllipticalAnnulus#
- class photutils.aperture.SkyEllipticalAnnulus(positions, a_in, a_out, b_out, b_in=None, theta=<Quantity 0. deg>)[source]#
Bases:
SkyApertureAn elliptical 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.
- a_inscalar
Quantity The inner semimajor axis in angular units.
- a_outscalar
Quantity The outer semimajor axis in angular units.
- b_outscalar
Quantity The outer semiminor axis in angular units.
- b_inscalar
QuantityorNone, optional The inner semiminor axis in angular units. If
None, then the inner semiminor axis is calculated as:\[b_{in} = b_{out} \left(\frac{a_{in}}{a_{out}}\right)\]- thetascalar
Quantity, optional The position angle (in angular units) of the ellipse semimajor axis, measured from North (PA=0) toward East. This is counterclockwise on an image displayed with North up and East to the left. North and East are the directions of increasing latitude and longitude in the coordinate frame of
positions(e.g., ICRS or Galactic). When the aperture is converted to pixels with a WCS whose celestial frame differs from that frame, the angle is converted to the equivalent angle in the WCS frame, so the aperture keeps the same orientation on the sky.
- positions
- Raises:
- TypeError
TypeError If any of the axes (
a_in,a_out,b_in, orb_out) is not aQuantity.- ValueError
ValueError If the inner semimajor axis (
a_in) is not less than the outer semimajor axis (a_out), or if the inner semiminor axis (b_in), when given, is not less than the outer semiminor axis (b_out).- ValueError
ValueError If any of the axes (
a_in,a_out,b_in, orb_out) is not positive.
- TypeError
Examples
>>> from astropy.coordinates import SkyCoord >>> import astropy.units as u >>> from photutils.aperture import SkyEllipticalAnnulus >>> positions = SkyCoord(ra=[10.0, 20.0], dec=[30.0, 40.0], unit='deg') >>> aper = SkyEllipticalAnnulus(positions, 0.5*u.arcsec, 2.0*u.arcsec, ... 1.0*u.arcsec)
Attributes Summary
The inner semimajor axis in angular units.
The outer semimajor axis in angular units.
The inner semiminor axis in angular units.
The outer semiminor axis 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 ellipse semimajor axis.
Methods Summary
copy()Make a deep copy of this object.
to_pixel(wcs)Convert the aperture to an
EllipticalAnnulusobject defined in pixel coordinates.Attributes Documentation
- a_in#
The inner semimajor axis in angular units.
- a_out#
The outer semimajor axis in angular units.
- b_in#
The inner semiminor axis in angular units.
- b_out#
The outer semiminor axis 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 ellipse semimajor axis.
Methods Documentation
- to_pixel(wcs)[source]#
Convert the aperture to an
EllipticalAnnulusobject 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
EllipticalAnnulusobject An
EllipticalAnnulusobject.
- 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.
Only the outer ellipse is converted with the WCS. The inner axes are the converted outer axes scaled by the input ratios
a_in / a_outandb_in / b_out, so the inner axes always remain smaller than the outer axes and the inner shape is recovered exactly by the inverse conversion. The annulus has a single rotation angle, which is that of the converted outer ellipse. If the WCS is sheared and the inner aspect ratio differs from the outer one, the inner ellipse of the returned annulus is an approximation of the converted inner ellipse, which would have a different orientation.