regions.read_fits_region(filename, errors='strict')[source]

Reads a FITS region file and scans for any fits regions table and converts them into Region objects.

filename : str

The file path

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).

regions : list

Python list of regions.Region objects.


>>> from import get_pkg_data_filename
>>> from regions import read_fits_region
>>> file_read = get_pkg_data_filename('data/fits_region.fits',
...                                   package='')
>>> regions = read_fits_region(file_read)