Skip to content

Commit

Permalink
Merge pull request #193 from sushobhana/to_crtf
Browse files Browse the repository at this point in the history
radius conversion of ellipse in CRTF
  • Loading branch information
keflavich committed Jun 25, 2018
2 parents a44e24d + c2fcdd3 commit dba1b4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions regions/io/core.py
Expand Up @@ -190,6 +190,11 @@ def to_crtf(self, coordsys='fk5', fmt='.6f', radunit='deg'):
line = crtf_strings['text'].format(include, *coord, text=shape.meta['text'])
else:
line = crtf_strings['point'].format(include, *coord)
elif shape.region_type == 'ellipse':
coord[2:] = [x / 2 for x in coord[2:]]
if len(coord) % 2 == 1:
coord[-1] *= 2
line = crtf_strings['ellipse'].format(include, *coord)
else:
line = crtf_strings[shape.region_type].format(include, *coord)

Expand Down

0 comments on commit dba1b4a

Please sign in to comment.