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
centerPixCoord

The position of the center of the annulus.

inner_radiusfloat

The inner radius of the annulus in pixels.

outer_radiusfloat

The outer radius of the annulus in pixels.

metaRegionMeta, optional

A dictionary that stores the meta attributes of this region.

visualRegionVisual, optional

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

Examples

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

fig, ax = plt.subplots(1, 1)

reg = CircleAnnulusPixelRegion(PixCoord(x=6, y=6),
                               inner_radius=5.5,
                               outer_radius=8.0)
patch = reg.plot(ax=ax, facecolor='none', edgecolor='red', lw=2,
                 label='Circle Annulus')

ax.legend(handles=(patch,), loc='upper center')
ax.set_xlim(-5, 20)
ax.set_ylim(-5, 20)
ax.set_aspect('equal')

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

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

Attributes Summary

center

The center pixel position as a PixCoord.

inner_radius

The inner radius in pixels as a float.

outer_radius

The outer radius in pixels as a float.

Methods Summary

to_sky(wcs)

Return a region defined in sky coordinates.

Attributes Documentation

center

The center pixel position as a PixCoord.

inner_radius

The inner radius in pixels as a float.

outer_radius

The outer radius in pixels as a float.

Methods Documentation

to_sky(wcs)[source]

Return a region defined in sky coordinates.

Parameters
wcsWCS

The world coordinate system transformation to use to convert from pixels to sky coordinates.

Returns
sky_regionSkyRegion

The sky region.