[yt-svn] commit/yt: MatthewTurk: Fixing a few issues with the HEALpix camera

Bitbucket commits-noreply at bitbucket.org
Wed Aug 1 19:57:37 PDT 2012


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/34d5336c01e5/
changeset:   34d5336c01e5
branch:      yt
user:        MatthewTurk
date:        2012-08-02 04:57:28
summary:     Fixing a few issues with the HEALpix camera
affected #:  1 file

diff -r 3c09edcdbd786c368f89461e3f152ac042cc9526 -r 34d5336c01e5019173e31395e2a66fd7676cfa23 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -823,14 +823,14 @@
             # This assumes Density; this is a relatively safe assumption.
             import matplotlib.figure
             import matplotlib.backends.backend_agg
-            phi, theta = na.mgrid[0.0:2*pi:800j, 0:pi:800j]
+            phi, theta = na.mgrid[0.0:2*na.pi:800j, 0:na.pi:800j]
             pixi = arr_ang2pix_nest(self.nside, theta.ravel(), phi.ravel())
             image *= self.radius * self.pf['cm']
             img = na.log10(image[:,0,0][pixi]).reshape((800,800))
 
             fig = matplotlib.figure.Figure((10, 5))
             ax = fig.add_subplot(1,1,1,projection='hammer')
-            implot = ax.imshow(img, extent=(-pi,pi,-pi/2,pi/2), clip_on=False, aspect=0.5)
+            implot = ax.imshow(img, extent=(-na.pi,na.pi,-na.pi/2,na.pi/2), clip_on=False, aspect=0.5)
             cb = fig.colorbar(implot, orientation='horizontal')
             cb.set_label(r"$\mathrm{log}\/\mathrm{Column}\/\mathrm{Density}\/[\mathrm{g}/\mathrm{cm}^2]$")
             if clim is not None: cb.set_clim(*clim)
@@ -1490,7 +1490,7 @@
         for g in pf.h.grids:
             if "temp_weightfield" in g.keys():
                 del g["temp_weightfield"]
-    return image
+    return image[:,0,0]
 
 def plot_allsky_healpix(image, nside, fn, label = "", rotation = None,
                         take_log = True, resolution=512):
@@ -1504,7 +1504,8 @@
     ax = fig.add_subplot(1,1,1,projection='aitoff')
     if take_log: func = na.log10
     else: func = lambda a: a
-    implot = ax.imshow(func(img), extent=(-pi,pi,-pi/2,pi/2), clip_on=False, aspect=0.5)
+    implot = ax.imshow(func(img), extent=(-na.pi,na.pi,-na.pi/2,na.pi/2),
+                       clip_on=False, aspect=0.5)
     cb = fig.colorbar(implot, orientation='horizontal')
     cb.set_label(label)
     ax.xaxis.set_ticks(())

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list