Reference/API

regions Package

This is an in-development package for region handling based on Astropy.

The goal is to merge the functionality from pyregion and photutils apertures and then after some time propose this package for inclusion in the Astropy core.

Functions

crtf_objects_to_string(regions[, coordsys, …]) Converts a list of Region to CRTF region string.
ds9_objects_to_string(regions[, coordsys, …]) Converts a list of Region to DS9 region string.
fits_region_objects_to_table(regions) Converts list of regions to FITS region table.
make_example_dataset([data, config]) Make example dataset.
read_crtf(filename[, errors]) Reads a CRTF region file and returns a list of region objects.
read_ds9(filename[, errors]) Read a DS9 region file in as a list of Region objects.
read_fits_region(filename[, errors]) Reads a FITS region file and scans for any fits regions table and converts them into Region objects.
test([package, test_path, args, plugins, …]) Run the tests using py.test.
to_crtf_meta(shape_meta) Makes the meta data CRTF compatible by filtering and mapping the valid keys
to_ds9_meta(shape_meta) Makes the meta data DS9 compatible by filtering and mapping the valid keys
to_shape_list(region_list[, coordinate_system]) Converts a list of regions into a regions.ShapeList object.
write_crtf(regions, filename[, coordsys, …]) Converts a list of Region to CRTF string and write to file.
write_ds9(regions, filename[, coordsys, …]) Converts a list of Region to DS9 string and write to file.
write_fits_region(filename, regions[, header]) Converts list of regions to FITS region table and write to a file.

Classes

BoundingBox(ixmin, ixmax, iymin, iymax) A rectangular bounding box in integer (not float) pixel indices.
CRTFParser(region_string[, errors]) Parses a CRTF string.
CRTFRegionParser(global_meta, include, …) Parse a CRTF region string
CRTFRegionParserError A generic error class for CRTF region parsing
CRTFRegionParserWarning A generic warning class for CRTF region parsing
CircleAnnulusPixelRegion(center, …[, …]) A circular annulus in pixel coordinates.
CircleAnnulusSkyRegion(center, inner_radius, …) A circular annulus in sky coordinates.
CirclePixelRegion(center, radius[, meta, visual]) A circle defined using pixel coordinates.
CircleSkyRegion(center, radius[, meta, visual]) A circle defined using sky coordinates.
CompoundPixelRegion(region1, region2, operator) Represents the logical combination of two regions in pixel coordinates.
CompoundSkyRegion(region1, region2, operator) Represents the logical combination of two regions in sky coordinates.
CoordinateParser Helper class to structure coordinate parser
DS9Parser(region_string[, errors]) Parse a DS9 string
DS9RegionParser(coordsys, include, …) Parse a DS9 region string
DS9RegionParserError A generic error class for DS9 region parsing
DS9RegionParserWarning A generic warning class for DS9 region parsing inherited from astropy’s warnings
EllipseAnnulusPixelRegion(center, …[, …]) A elliptical annulus in pixel coordinates.
EllipseAnnulusSkyRegion(center, inner_width, …) A elliptical annulus in SkyCoord coordinates.
EllipsePixelRegion(center, width, height[, …]) An ellipse in pixel coordinates.
EllipseSkyRegion(center, width, height[, …]) An ellipse defined using sky coordinates.
FITSRegionParser(table[, errors]) Parses a FITS Region table.
FITSRegionParserError A generic error class for FITS region parsing
FITSRegionParserWarning A generic warning class for FITS region parsing
FITSRegionRowParser(row, unit[, errors]) Parses a single row of the FITS region table
LinePixelRegion(start, end[, meta, visual]) A line in pixel coordinates.
LineSkyRegion(start, end[, meta, visual]) A line in sky coordinates.
PixCoord(x, y) Pixel coordinates.
PixelRegion Base class for all regions defined in pixel coordinates
PointPixelRegion(center[, meta, visual]) A point position in pixel coordinates.
PointSkyRegion(center[, meta, visual]) A pixel region in sky coordinates.
PolygonPixelRegion(vertices[, meta, visual]) A polygon in pixel coordinates.
PolygonSkyRegion(vertices[, meta, visual]) A polygon defined using vertices in sky coordinates.
RectangleAnnulusPixelRegion(center, …[, …]) A rectangular annulus in pixel coordinates.
RectangleAnnulusSkyRegion(center, …[, …]) A rectangular annulus in SkyCoord coordinates.
RectanglePixelRegion(center, width, height) A rectangle in pixel coordinates.
RectangleSkyRegion(center, width, height[, …]) A rectangle in sky coordinates.
Region Base class for all regions.
RegionMask(data, bbox) Class for a region mask.
RegionMeta([seq]) A python dictionary subclass which holds the meta attributes of the region.
RegionVisual([seq]) A python dictionary subclass which holds the visual attributes of the region.
Shape(coordsys, region_type, coord, meta, …) Helper class to represent a DS9/CRTF Region.
ShapeList List of Shape
SkyRegion Base class for all regions defined in celestial coordinates
TextPixelRegion(center, text[, meta, visual]) A Text string in pixel coordinates
TextSkyRegion(center, text[, meta, visual]) A Text string in sky coordinates