From 5fe5d2f9b116cdc789e5f3f8e90fe96eaf645e40 Mon Sep 17 00:00:00 2001 From: mcara Date: Fri, 28 Feb 2014 00:36:01 +0000 Subject: Restored the old implementation of the SphericalPolygon.__init__(...) for the case of empty list of points which was designed to remove a RuntimeWarning at the first run of the code (see Ticket # 1079). For unknown reasons, this change was lost during last commit by Mike. Moved point vector-normalization from the add_node method to Node.__init__(...) in graph.py. Removed skyline.py from the 'sphere' module. The original implementation of skyline.py did not work correctly (see, e.g., tickets #1080, #1081, #1082) and overall it makes sense to separate image processing and statistical analysis from "pure" geometric operations handled by the 'sphere'. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@29976 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: 82f06f5b25c8cc262bfbc0b57e3e774d320bcf47 --- lib/graph.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/graph.py') diff --git a/lib/graph.py b/lib/graph.py index d0c91a7..d8ccf75 100644 --- a/lib/graph.py +++ b/lib/graph.py @@ -50,7 +50,7 @@ from . import great_circle_arc from . import vector # Set to True to enable some sanity checks -DEBUG = False +DEBUG = True class Graph: @@ -78,6 +78,8 @@ class Graph: source_polygon : `~sphere.polygon.SphericalPolygon` instance, optional The polygon(s) this node came from. Used for bookkeeping. """ + point = vector.normalize_vector(*point) + self._point = np.asanyarray(point) self._source_polygons = set(source_polygons) self._edges = weakref.WeakSet() @@ -267,7 +269,6 @@ class Graph: node : `~Graph.Node` instance The new node """ - point = vector.normalize_vector(*point) new_node = self.Node(point, source_polygons) # Don't add nodes that already exist. Update the existing @@ -661,7 +662,6 @@ class Graph: for j in intersection_indices: C = starts[j] D = ends[j] - CD = edges[j] E = intersections[j] -- cgit