Commit fe8c2918 authored by Theo Steininger's avatar Theo Steininger

Small corrections.

parent 2f17dc3e
Pipeline #12556 passed with stage
in 7 minutes and 43 seconds
......@@ -22,6 +22,7 @@ class GLMollweide(Heatmap):
data = self._mollview(data, nlat, nlon)
super(GLMollweide, self).__init__(data, color_map, webgl, smoothing)
@staticmethod
def _find_closest(A, target):
# A must be sorted
idx = A.searchsorted(target)
......@@ -33,15 +34,14 @@ class GLMollweide(Heatmap):
def _mollview(self, x, nlat, nlon, xsize=800):
f = pylab.figure(None, figsize=(8.5, 5.4))
extent = (0.02, 0.05, 0.96, 0.9)
x = np.reshape(x, (nlon, nlat))
ra = np.linspace(-np.pi, np.pi, xsize)
dec = np.linspace(-np.pi/2, np.pi/2, xsize/2)
X, Y = np.meshgrid(ra, dec)
gllat = pyHealpix.GL_thetas(nlat)-0.5*np.pi
gllon = np.arange(nlon+1)*(2*np.pi/nlon)
ilat = _find_closest(gllat, dec-0.5*np.pi)
ilon = _find_closest(gllon, np.pi+ra)
ilat = self._find_closest(gllat, dec-0.5*np.pi)
ilon = self._find_closest(gllon, np.pi+ra)
for i in range(ilon.size):
if (ilon[i] == nlon):
ilon[i] = 0
......
......@@ -24,7 +24,6 @@ class HPMollweide(Heatmap):
def _mollview(self, x, xsize=800):
f = pylab.figure(None, figsize=(8.5, 5.4))
extent = (0.02, 0.05, 0.96, 0.9)
nside = int(np.sqrt(x.size//12))
base = pyHealpix.Healpix_Base(nside, "RING")
ra = np.linspace(-np.pi, np.pi, xsize)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment