CircleAnnulusPixelRegion

class regions.CircleAnnulusPixelRegion(center, inner_radius, outer_radius, meta=None, visual=None)[source]

Bases: regions.shapes.annulus.AnnulusPixelRegion

A circular annulus in pixel coordinates.

Parameters:
center : PixCoord

The position of the center of the annulus.

inner_radius : float

The inner radius of the annulus

outer_radius : float

The outer radius of the annulus

meta : RegionMeta object, optional

A dictionary which stores the meta attributes of this region.

visual : RegionVisual object, optional

A dictionary which stores the visual meta attributes of this region.

Examples

from regions import PixCoord, CircleAnnulusPixelRegion
import matplotlib.pyplot as plt

x, y = 6, 6
inner_radius = 5.5
outer_radius = 8
fig, ax = plt.subplots(1, 1)

center = PixCoord(x=x, y=y)
reg = CircleAnnulusPixelRegion(center=center, inner_radius=inner_radius,
                               outer_radius=outer_radius)
patch = reg.as_artist(facecolor='none', edgecolor='red', lw=2)
ax.add_patch(patch)

plt.xlim(-5, 20)
plt.ylim(-5, 20)
ax.set_aspect('equal')

(Source code, png, hires.png, pdf)

../_images/regions-CircleAnnulusPixelRegion-1.png

Attributes Summary

center Descriptor class for PixelRegion which takes a scalar PixCoord object.
inner_radius Descriptor class for PixelRegion which takes a scalar python/numpy number.
outer_radius Descriptor class for PixelRegion which takes a scalar python/numpy number.

Methods Summary

to_sky(self, wcs) Returns a region defined in sky coordinates.

Attributes Documentation

center

Descriptor class for PixelRegion which takes a scalar PixCoord object.

inner_radius

Descriptor class for PixelRegion which takes a scalar python/numpy number.

outer_radius

Descriptor class for PixelRegion which takes a scalar python/numpy number.

Methods Documentation

to_sky(self, wcs)[source]

Returns a region defined in sky coordinates.

Parameters:
wcs : WCS instance

The world coordinate system transformation to assume

Returns:
sky_region : SkyRegion object.