aperture2regions#

jdaviz.core.region_translators.aperture2regions(aperture)[source]#

Convert a given photutils aperture to regions shape.

Parameters:
aperturephotutils.aperture.Aperture

An equivalent photutils aperture.

Returns:
region_shaperegions.Region

A supported regions shape.

Raises:
NotImplementedError

The given photutils aperture is not supported.

ValueError

Invalid inputs.

See also

regions2aperture

Examples

Translate a photutils.aperture.CircularAperture to regions.CirclePixelRegion:

>>> from photutils.aperture import CircularAperture
>>> from jdaviz.core.region_translators import aperture2regions
>>> aperture = CircularAperture((42, 43), 4.2)
>>> aperture2regions(aperture)
<CirclePixelRegion(center=PixCoord(x=42.0, y=43.0), radius=4.2)>