[yt-dev] Issue #570: Healpix volume rendering produces garbled, artifacted images (yt_analysis/yt)
Nathan Goldbaum
issues-reply at bitbucket.org
Fri May 17 13:49:54 PDT 2013
New issue 570: Healpix volume rendering produces garbled, artifacted images
https://bitbucket.org/yt_analysis/yt/issue/570/healpix-volume-rendering-produces-garbled
Nathan Goldbaum:
Using the sample script from the docs:
```
#!python
from yt.mods import *
import yt.visualization.volume_rendering.camera as camera
pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
image = camera.allsky_projection(pf, [0.5,0.5,0.5], 100.0/pf['kpc'], 64, "Density")
camera.plot_allsky_healpix(image, 64, "allsky.png", "Column Density [g/cm^2]")
```
Produces the following image:
![](http://i.imgur.com/5wskzay.png)
I also tried the manual method described further down in the docs:
```
#!python
rom yt.mods import *
import yt.visualization.volume_rendering.camera as camera
Nside = 32
pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
cam = camera.HEALpixCamera([0.5,0.5,0.5], 0.2, Nside, pf = pf, log_fields = [False])
bitmap = cam.snapshot()
import yt.utilities.lib as au
from numpy import pi
phi, theta = np.mgrid[0.0:2*pi:800j, 0:pi:800j]
pixi = au.arr_ang2pix_nest(Nside, theta.ravel(), phi.ravel())
img = np.log10(bitmap[:,0,0][pixi]).reshape((800,800))
import matplotlib.figure
import matplotlib.backends.backend_agg
fig = matplotlib.figure.Figure((10, 5))
ax = fig.add_subplot(1,1,1,projection='mollweide')
image = ax.imshow(img, extent=(-pi,pi,-pi/2,pi/2), clip_on=False, aspect=0.5)
cb = fig.colorbar(image, orientation='horizontal')
cb.set_label(r"$\mathrm{Column}\/\mathrm{Density}\/[\mathrm{g}/\mathrm{cm}^2]$")
canvas = matplotlib.backends.backend_agg.FigureCanvasAgg(fig)
canvas.print_figure("allsky.png")
```
Note that I had to update this a bit since amr_utils was renamed a while back. This produces the following image:
![](http://i.imgur.com/Jax1sYB.png)
While this looks more sensible, it's not clear to me that it is correct.
More information about the yt-dev
mailing list