From 67295d20a80e14927559c91ad48fba3c441f76dc Mon Sep 17 00:00:00 2001 From: mdroe Date: Thu, 12 Jun 2014 18:17:42 +0000 Subject: 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 --- stsci/sphere/polygon.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stsci/sphere/polygon.py') 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) -- cgit