crtf_objects_to_string

regions.crtf_objects_to_string(regions, coordsys='fk5', fmt='.6f', radunit='deg')[source]

Converts a list of Region to CRTF region string.

Parameters:
regions : list

List of Region objects

coordsys : str, optional

Astropy Coordinate system that overrides the coordinate system frame for all regions. Default is ‘fk5’.

fmt : str, optional

A python string format defining the output precision. Default is .6f, which is accurate to 0.0036 arcseconds.

radunit : str, optional

This denotes the unit of the radius. Default is deg (degrees)

Returns:
region_string : str

CRTF region string

Examples

>>> from astropy import units as u
>>> from astropy.coordinates import SkyCoord
>>> from regions import CircleSkyRegion, crtf_objects_to_string
>>> reg_sky = CircleSkyRegion(SkyCoord(1 * u.deg, 2 * u.deg), 5 * u.deg)
>>> print(crtf_objects_to_string([reg_sky]))
#CRTF
circle[[1.000007deg, 2.000002deg], 5.000000deg], coord=FK5,