From fe8c29188dd7b0d5e42cd349212e8f002d326734 Mon Sep 17 00:00:00 2001 From: Theo Steininger <theo.steininger@ultimanet.de> Date: Wed, 17 May 2017 02:01:34 +0200 Subject: [PATCH] Small corrections. --- nifty/plotting/plots/heatmaps/glmollweide.py | 6 +++--- nifty/plotting/plots/heatmaps/hpmollweide.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nifty/plotting/plots/heatmaps/glmollweide.py b/nifty/plotting/plots/heatmaps/glmollweide.py index 678a32aa0..d98d8b780 100644 --- a/nifty/plotting/plots/heatmaps/glmollweide.py +++ b/nifty/plotting/plots/heatmaps/glmollweide.py @@ -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 diff --git a/nifty/plotting/plots/heatmaps/hpmollweide.py b/nifty/plotting/plots/heatmaps/hpmollweide.py index 6b6cae0fd..34612693e 100644 --- a/nifty/plotting/plots/heatmaps/hpmollweide.py +++ b/nifty/plotting/plots/heatmaps/hpmollweide.py @@ -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) -- GitLab