Skip to content

Commit ceee7ea

Browse files
committed
correct icosahedron and install healpy
1 parent a6f17fb commit ceee7ea

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pygsp/graphs/nngraphs/sphereicosahedron.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class SphereIcosahedron(NNGraph):
2020
Examples
2121
--------
2222
>>> import matplotlib.pyplot as plt
23+
>>> from mpl_toolkits.mplot3d import Axes3D
2324
>>> G = graphs.SphereIcosahedron(level=1)
2425
>>> fig = plt.figure()
2526
>>> ax1 = fig.add_subplot(121)
@@ -44,7 +45,7 @@ def __init__(self, level=5, sampling='vertex', **kwargs):
4445
1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8,
4546
3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9,
4647
4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1]
47-
self.faces = np.reshape(faces, (20,3))-1
48+
self.faces = np.reshape(faces, (20, 3))
4849
self.level = level
4950
self.intp = None
5051

@@ -127,7 +128,7 @@ def normalize(self, radius=1):
127128

128129
def xyz2latlong(self):
129130
x, y, z = self.coords[:, 0], self.coords[:, 1], self.coords[:, 2]
130-
long = np.arctan2(y, x)
131+
long = np.arctan2(y, x) + np.pi
131132
xy2 = x**2 + y**2
132133
lat = np.arctan2(z, np.sqrt(xy2))
133134
return lat, long

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
# 'graph-tool', cannot be installed by pip
4040
# Construct patch graphs from images.
4141
'scikit-image',
42+
# Construct Sphere graph
43+
'healpy',
4244
# Approximate nearest neighbors for kNN graphs.
4345
'pyflann; python_version == "2.*"',
4446
'pyflann3; python_version == "3.*"',

0 commit comments

Comments
 (0)