diff options
author | mcara <mcara@stsci.edu> | 2014-02-27 19:36:01 -0500 |
---|---|---|
committer | mcara <mcara@stsci.edu> | 2014-02-27 19:36:01 -0500 |
commit | 5fe5d2f9b116cdc789e5f3f8e90fe96eaf645e40 (patch) | |
tree | d5bd3ee487126c66395d709771e0d30b5fa58f1f /lib/graph.py | |
parent | 90cf3598c6e74993e26fe8087bd54425106ed077 (diff) | |
download | stsci.sphere-5fe5d2f9b116cdc789e5f3f8e90fe96eaf645e40.tar.gz |
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
Diffstat (limited to 'lib/graph.py')
-rw-r--r-- | lib/graph.py | 6 |
1 files changed, 3 insertions, 3 deletions
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] |