From 0a03767000dcb29e998d55c120e21f892e2288c3 Mon Sep 17 00:00:00 2001 From: bsimon Date: Thu, 9 Apr 2015 19:38:55 +0000 Subject: adding some backport changes I missed on the first time around git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci.sphere/trunk@38912 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: 5f708691fc28a7c2846cf110e5fe656cfeda8ee3 --- stsci/sphere/polygon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'stsci/sphere/polygon.py') diff --git a/stsci/sphere/polygon.py b/stsci/sphere/polygon.py index 449bd79..509cece 100644 --- a/stsci/sphere/polygon.py +++ b/stsci/sphere/polygon.py @@ -88,7 +88,7 @@ class _SingleSphericalPolygon(object): else: assert np.array_equal(points[0], points[-1]), 'Polygon is not closed' - self._points = np.asanyarray(points) + self._points = points = np.asanyarray(points) if inside is None: self._inside = self._find_new_inside(points) @@ -515,7 +515,7 @@ class _SingleSphericalPolygon(object): return inside # Fallback to the mean - return np.sum(points[:-1]) / (len(points) - 1) + return np.sum(points[:-1], axis=0) / (len(points) - 1) def intersection(self, other): """ @@ -691,7 +691,7 @@ class SphericalPolygon(object): Iterate over the inside point of each of the polygons. """ for polygon in self.iter_polygons_flat(): - yield polygon.points + yield polygon.inside @property def polygons(self): -- cgit