Commits

Matthew Turk  committed 9b09d20

Two minor fixes, for the volume_rendering code block and merger tree recipe

  • Participants
  • Parent commits 3101a9b

Comments (0)

Files changed (2)

File source/cookbook/halo_merger_tree.py

 from yt.analysis_modules.halo_merger_tree.api import *
 
 # Makes a TimeSeries object from all of whatever files you have
-ts = TimeSeriesData.from_filenames("DD????/DD????")
+ts = TimeSeriesData.from_filenames("enzo_tiny_cosmology/DD????/DD????")
 
 # For each datadump in our timeseries, run the friends of friends
 # halo finder on it (this has only been tested with FOF currently).

File source/visualizing/volume_rendering.rst

 Here is a working example for the IsolatedGalaxy dataset from the 2012 yt workshop.
 
 .. code-block:: python
-    from yt.mods import *
 
-    pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-    # Choose a field
-    field = 'Density'
-    # Do you want the log of the field?
-    use_log = True
+   from yt.mods import *
 
-    # Find the bounds in log space of for your field
-    dd = pf.h.all_data()
-    mi, ma = dd.quantities["Extrema"](field)[0]
+   pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+   # Choose a field
+   field = 'Density'
+   # Do you want the log of the field?
+   use_log = True
 
-    if use_log:
-        mi,ma = np.log10(mi), np.log10(ma)
+   # Find the bounds in log space of for your field
+   dd = pf.h.all_data()
+   mi, ma = dd.quantities["Extrema"](field)[0]
 
-    # Instantiate the ColorTransferfunction.
-    tf = ColorTransferFunction((mi, ma))
+   if use_log:
+       mi,ma = np.log10(mi), np.log10(ma)
 
-    # Set up the camera parameters: center, looking direction, width, resolution
-    c = (pf.domain_right_edge + pf.domain_left_edge)/2.0
-    L = np.array([1.0, 1.0, 1.0])
-    W = 0.3 / pf["unitary"]
-    N = 256 
+   # Instantiate the ColorTransferfunction.
+   tf = ColorTransferFunction((mi, ma))
 
-    # Create a camera object
-    cam = pf.h.camera(c, L, W, N, tf, fields = [field], log_fields = [use_log])
+   # Set up the camera parameters: center, looking direction, width, resolution
+   c = (pf.domain_right_edge + pf.domain_left_edge)/2.0
+   L = np.array([1.0, 1.0, 1.0])
+   W = 0.3 / pf["unitary"]
+   N = 256 
 
-    # Now let's add some isocontours, and take a snapshot, saving the image
-    # to a file.
-    tf.add_layers(10, 0.01, colormap = 'RdBu_r')
-    im = cam.snapshot('test_rendering.png')
+   # Create a camera object
+   cam = pf.h.camera(c, L, W, N, tf, fields = [field], log_fields = [use_log])
 
-    # To add the domain box to the image:
-    nim = cam.draw_domain(im)
-    nim.write_png('test_rendering_with_domain.png')
+   # Now let's add some isocontours, and take a snapshot, saving the image
+   # to a file.
+   tf.add_layers(10, 0.01, colormap = 'RdBu_r')
+   im = cam.snapshot('test_rendering.png')
 
-    # To add the grid outlines to the image:
-    nim = cam.draw_grids(im)
-    nim.write_png('test_rendering_with_grids.png')
+   # To add the domain box to the image:
+   nim = cam.draw_domain(im)
+   nim.write_png('test_rendering_with_domain.png')
+
+   # To add the grid outlines to the image:
+   nim = cam.draw_grids(im)
+   nim.write_png('test_rendering_with_grids.png')
 
 Method
 ------