summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormdroe <mdroe@stsci.edu>2014-06-12 14:17:42 -0400
committermdroe <mdroe@stsci.edu>2014-06-12 14:17:42 -0400
commit67295d20a80e14927559c91ad48fba3c441f76dc (patch)
treefb14010def244aec3359b6e38561bde925e02084
parente5eed42a4d4e13af2a77d878475697110fb1395d (diff)
downloadstsci.sphere-67295d20a80e14927559c91ad48fba3c441f76dc.tar.gz
Handle empty polygons in Polygon.to_ra_dec
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci.sphere/trunk@32438 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: 7e37d7cfb676faa51c4a29708c8f1ae9656245e3
-rw-r--r--stsci/sphere/polygon.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/stsci/sphere/polygon.py b/stsci/sphere/polygon.py
index 0406402..f7c44be 100644
--- a/stsci/sphere/polygon.py
+++ b/stsci/sphere/polygon.py
@@ -133,6 +133,8 @@ class SphericalPolygon(object):
List of *ra* and *dec* in degrees corresponding
to `points`.
"""
+ if len(self.points) == 0:
+ return np.array([])
return vector.vector_to_radec(self.points[:,0], self.points[:,1],
self.points[:,2], degrees=True)