Issue #570: Healpix volume rendering produces garbled, artifacted images (yt_analysis/yt)
![](https://secure.gravatar.com/avatar/4f4e2225d21fe9d39a9309496e866894.jpg?s=120&d=mm&r=g)
New issue 570: Healpix volume rendering produces garbled, artifacted images https://bitbucket.org/yt_analysis/yt/issue/570/healpix-volume-rendering-prod... 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.
![](https://secure.gravatar.com/avatar/b8340e5ad7f6df5042b7d4a53be72e18.jpg?s=120&d=mm&r=g)
I can confirm, the images I got looks like the grids were not ordered correctly, patches of zones looks fine inbetween, but zone and zones do not match well at the boundary. From G.S. On Fri, May 17, 2013 at 1:49 PM, Nathan Goldbaum <issues-reply@bitbucket.org
wrote:
New issue 570: Healpix volume rendering produces garbled, artifacted images
https://bitbucket.org/yt_analysis/yt/issue/570/healpix-volume-rendering-prod...
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.
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
![](https://secure.gravatar.com/avatar/b279d746f54e2cd6062e8279a767c4bc.jpg?s=120&d=mm&r=g)
Can you attach your image to the issue? On the mailing list you also said it worked fine I thought. On May 17, 2013 5:01 PM, "Geoffrey So" <gsiisg@gmail.com> wrote:
I can confirm, the images I got looks like the grids were not ordered correctly, patches of zones looks fine inbetween, but zone and zones do not match well at the boundary.
From G.S.
On Fri, May 17, 2013 at 1:49 PM, Nathan Goldbaum < issues-reply@bitbucket.org> wrote:
New issue 570: Healpix volume rendering produces garbled, artifacted images
https://bitbucket.org/yt_analysis/yt/issue/570/healpix-volume-rendering-prod...
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.
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
![](https://secure.gravatar.com/avatar/b8340e5ad7f6df5042b7d4a53be72e18.jpg?s=120&d=mm&r=g)
Sorry what I meant was the script ran fine without crashing, the image I got and the script I used is now updated on the bug issue comment section. The grid boundary is clearly visible so something seems wrong. From G.S. On Fri, May 17, 2013 at 2:04 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Can you attach your image to the issue? On the mailing list you also said it worked fine I thought. On May 17, 2013 5:01 PM, "Geoffrey So" <gsiisg@gmail.com> wrote:
I can confirm, the images I got looks like the grids were not ordered correctly, patches of zones looks fine inbetween, but zone and zones do not match well at the boundary.
From G.S.
On Fri, May 17, 2013 at 1:49 PM, Nathan Goldbaum < issues-reply@bitbucket.org> wrote:
New issue 570: Healpix volume rendering produces garbled, artifacted images
https://bitbucket.org/yt_analysis/yt/issue/570/healpix-volume-rendering-prod...
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.
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
participants (3)
-
Geoffrey So
-
Matthew Turk
-
Nathan Goldbaum