FITSRegionParser

class regions.FITSRegionParser(table, errors='strict')[source]

Bases: object

Parses a FITS Region table.

Parameters:
table: `~astropy.table.Table` object

A fits region table

errors : warn, ignore, strict

The error handling scheme to use for handling parsing errors. The default is ‘strict’, which will raise a FITSRegionParserError. warn` will raise a FITSRegionParserWarning, and ignore will do nothing (i.e., be silent).

Examples

>>> from regions import FITSRegionParser
>>> from astropy.table import Table
>>> from astropy.utils.data import get_pkg_data_filename
>>> filename = get_pkg_data_filename('data/fits_region.fits',
...                                  package='regions.io.fits.tests')
>>> table = Table.read(filename)
>>> parser = FITSRegionParser(table)
>>> shapes = parser.shapes
>>> regions = shapes.to_regions()
>>> regions[5]
<PointPixelRegion(center=PixCoord(x=341.0, y=345.0))>

Attributes Summary

shapes
valid_columns

Methods Summary

parse_table(self)

Attributes Documentation

shapes
valid_columns = ['X', 'Y', 'SHAPE', 'COMPONENT', 'R', 'ROTANG']

Methods Documentation

parse_table(self)[source]