[yt-svn] commit/yt-doc: MatthewTurk: Adding allsky_projection example and cleaning up a bit of the volume rendering

Bitbucket commits-noreply at bitbucket.org
Thu Feb 14 12:19:59 PST 2013


1 new commit in yt-doc:

https://bitbucket.org/yt_analysis/yt-doc/commits/61f98cfe4aaf/
changeset:   61f98cfe4aaf
user:        MatthewTurk
date:        2013-02-14 21:03:40
summary:     Adding allsky_projection example and cleaning up a bit of the volume rendering
recipe.
affected #:  2 files

diff -r c2a8bc9a63df40a07d8862b60952978541851ca7 -r 61f98cfe4aaf7669f0305204ed8b6bbfac87fcb2 source/visualizing/_images/allsky.png
Binary file source/visualizing/_images/allsky.png has changed

diff -r c2a8bc9a63df40a07d8862b60952978541851ca7 -r 61f98cfe4aaf7669f0305204ed8b6bbfac87fcb2 source/visualizing/volume_rendering.rst
--- a/source/visualizing/volume_rendering.rst
+++ b/source/visualizing/volume_rendering.rst
@@ -20,6 +20,9 @@
 for transitioning the rendering to the GPU.  In addition, this allows users to create
 volume renderings on traditional supercomputing platforms that may not have access to GPUs.
 
+As of yt 2.4, this code is threaded using OpenMP.  Many of the commands
+(including `snapshot`) will accept a `num_threads` option.
+
 Tutorial
 --------
 .. versionadded:: 1.6
@@ -45,11 +48,6 @@
     # Do you want the log of the field?
     use_log = True
     
-    # Make sure everything is set to act correctly based on log
-    if use_log:
-        pf.h
-        pf.field_info[field].take_log=use_log
-    
     # Find the bounds in log space of for your field
     dd = pf.h.all_data()
     mi, ma = dd.quantities["Extrema"](field)[0]
@@ -67,7 +65,7 @@
     N = 256 
     
     # Create a camera object
-    cam = pf.h.camera(c, L, W, N, tf)
+    cam = pf.h.camera(c, L, W, N, tf, fields = [field], log_fields = [use_log])
     
     # Set up the filename using pf and field.
     fn = "%s_%s_rendering.png" % (pf, field)
@@ -190,7 +188,6 @@
 motion helper functions, see the docstrings associated with
 :class:`~yt.visualization.volume_rendering.camera.Camera`.
 
-
 .. _transfer_functions:
 
 Transfer Functions
@@ -275,10 +272,26 @@
 
 Unfortunately, due to issues spherical-projection issues, the generation of
 the initial volume rendering is much easier than the generation of the output
-image from the process.
+image from the process.  We have provided a simple interface to this:
 
-To actually issue the rays from a central location, the call is similar but not
-identical to the creation of a standard volume rendering.
+.. code-block:: 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]")
+
+This produces an image like this:
+
+.. image:: _images/vr_sample.jpg
+   :width: 512
+
+However, below we describe a longer, build-it-yourself method.  To actually
+issue the rays from a central location, the call is similar but not identical
+to the creation of a standard volume rendering.
 
 .. code-block:: python
 
@@ -501,9 +514,3 @@
 your homogenized volume to then be passed in to the camera. A sample usage is shown
 in :ref:`cookbook-amrkdtree_downsampling`.
 
-
-The Simple Volume Rendering Interface
--------------------------------------
-.. warning:: This has been removed in yt-2.3.  Please use :ref:`the-camera-interface`.
-
-

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

--

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