[yt-svn] commit/yt: 69 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jun 18 17:24:01 PDT 2014


69 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/4cdce2f34ef0/
Changeset:   4cdce2f34ef0
Branch:      yt-3.0
User:        chummels
Date:        2014-05-18 23:14:29
Summary:     Updating the aligned cutting plane recipe in the cookbook.  Angular momentum
vector is wrong compared to yt 2.x.
Affected #:  1 file

diff -r 036f745796c12e66b4636835800f2b029bbe7b4b -r 4cdce2f34ef0f9fa616419b3403a336bd44fc05b doc/source/cookbook/aligned_cutting_plane.py
--- a/doc/source/cookbook/aligned_cutting_plane.py
+++ b/doc/source/cookbook/aligned_cutting_plane.py
@@ -3,16 +3,15 @@
 # Load the dataset.
 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
-# Create a 1 kpc radius sphere, centered on the maximum gas density.  Note
-# that this sphere is very small compared to the size of our final plot,
-# and it has a non-axially aligned L vector.
-sp = ds.sphere("m", (1.0, "kpc"))
+# Create a 15 kpc radius sphere, centered on the center of the sim volume
+sp = ds.sphere("center", (15.0, "kpc"))
 
 # Get the angular momentum vector for the sphere.
 L = sp.quantities.angular_momentum_vector()
 
 print "Angular momentum vector: {0}".format(L)
 
-# Create an OffAxisSlicePlot on the object with the L vector as its normal
-p = yt.OffAxisSlicePlot(ds, L, "density", sp.center, (15, "kpc"))
+# Create an OffAxisSlicePlot of density centered on the object with the L 
+# vector as its normal and a width of 25 kpc on a side
+p = yt.OffAxisSlicePlot(ds, L, "density", sp.center, (25, "kpc"))
 p.save()


https://bitbucket.org/yt_analysis/yt/commits/d356742f2b8c/
Changeset:   d356742f2b8c
Branch:      yt-3.0
User:        chummels
Date:        2014-05-19 01:03:49
Summary:     Correcting a bug in amr_kdtree involving units and node edges. Updating the amrkdtree_downsampling recipe.  Recipe still does not fully work, but will fix after "scene" object PR'd.
Affected #:  2 files

diff -r 4cdce2f34ef0f9fa616419b3403a336bd44fc05b -r d356742f2b8cf0a06b5fbf130551cedc6245e56c doc/source/cookbook/amrkdtree_downsampling.py
--- a/doc/source/cookbook/amrkdtree_downsampling.py
+++ b/doc/source/cookbook/amrkdtree_downsampling.py
@@ -10,17 +10,17 @@
 import yt
 from yt.utilities.amr_kdtree.api import AMRKDTree
 
-# Load up a data and print out the maximum refinement level
+# Load up a dataset
 ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
 
 kd = AMRKDTree(ds)
-# Print out the total volume of all the bricks
-print kd.count_volume()
-# Print out the number of cells
-print kd.count_cells()
+
+# Print out specifics of KD Tree
+print "Total volume of all bricks = %i" % kd.count_volume()
+print "Total number of cells = %i" % kd.count_cells()
 
 tf = yt.ColorTransferFunction((-30, -22))
-cam = ds.h.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256,
+cam = ds.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256,
                   tf, volume=kd)
 tf.add_layers(4, 0.01, col_bounds=[-27.5, -25.5], colormap='RdBu_r')
 cam.snapshot("v1.png", clip_ratio=6.0)

diff -r 4cdce2f34ef0f9fa616419b3403a336bd44fc05b -r d356742f2b8cf0a06b5fbf130551cedc6245e56c yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -94,8 +94,8 @@
             dds = grid.dds
             gle = grid.LeftEdge
             gre = grid.RightEdge
-            nle = get_left_edge(node)
-            nre = get_right_edge(node)
+            nle = self.pf.arr(get_left_edge(node), input_units="code_length")
+            nre = self.pf.arr(get_right_edge(node), input_units="code_length")
             li = np.rint((nle-gle)/dds).astype('int32')
             ri = np.rint((nre-gle)/dds).astype('int32')
             dims = (ri - li).astype('int32')
@@ -119,8 +119,8 @@
             grid = self.pf.index.grids[node.grid - self._id_offset]
             dds = grid.dds
             gle = grid.LeftEdge
-            nle = get_left_edge(node)
-            nre = get_right_edge(node)
+            nle = self.pf.arr(get_left_edge(node), input_units="code_length")
+            nre = self.pf.arr(get_right_edge(node), input_units="code_length")
             li = np.rint((nle-gle)/dds).astype('int32')
             ri = np.rint((nre-gle)/dds).astype('int32')
             dims = (ri - li).astype('int32')


https://bitbucket.org/yt_analysis/yt/commits/232ce1af99bc/
Changeset:   232ce1af99bc
Branch:      yt-3.0
User:        chummels
Date:        2014-05-19 01:17:21
Summary:     Updating average_value recipe.
Affected #:  1 file

diff -r d356742f2b8cf0a06b5fbf130551cedc6245e56c -r 232ce1af99bc8dea7c1a48338f68155236943a32 doc/source/cookbook/average_value.py
--- a/doc/source/cookbook/average_value.py
+++ b/doc/source/cookbook/average_value.py
@@ -5,9 +5,10 @@
 field = "temperature"  # The field to average
 weight = "cell_mass"  # The weight for the average
 
-dd = ds.h.all_data()  # This is a region describing the entire box,
-                      # but note it doesn't read anything in yet!
+ad = ds.all_data()  # This is a region describing the entire box,
+                    # but note it doesn't read anything in yet!
+
 # We now use our 'quantities' call to get the average quantity
-average_value = dd.quantities["WeightedAverageQuantity"](field, weight)
+average_value = ad.quantities.weighted_average_quantity(field, weight)
 
-print "Average %s (weighted by %s) is %0.5e" % (field, weight, average_value)
+print "Average %s (weighted by %s) is %0.3e %s" % (field, weight, average_value, average_value.units)


https://bitbucket.org/yt_analysis/yt/commits/dfbcd1a35964/
Changeset:   dfbcd1a35964
Branch:      yt-3.0
User:        chummels
Date:        2014-05-19 01:25:12
Summary:     Fixing a typo in docstrings.
Affected #:  1 file

diff -r 232ce1af99bc8dea7c1a48338f68155236943a32 -r dfbcd1a35964d1ad902092e160da710c9452fa7c yt/data_objects/derived_quantities.py
--- a/yt/data_objects/derived_quantities.py
+++ b/yt/data_objects/derived_quantities.py
@@ -616,7 +616,7 @@
 
     >>> pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
     >>> ad = pf.all_data()
-    >>> print ad.quantities.center_of_mass()
+    >>> print ad.quantities.spin_parameter()
     
     """
     def count_values(self, **kwargs):


https://bitbucket.org/yt_analysis/yt/commits/9f1d75eedae6/
Changeset:   9f1d75eedae6
Branch:      yt-3.0
User:        chummels
Date:        2014-05-19 01:38:34
Summary:     Updating boolean_data_objects recipe.  Is broken because of unsupported get_list_of_grids() call.
Affected #:  3 files

diff -r dfbcd1a35964d1ad902092e160da710c9452fa7c -r 9f1d75eedae6ad915285b1ed9677550a63c2acb9 doc/source/cookbook/boolean_data_objects.py
--- a/doc/source/cookbook/boolean_data_objects.py
+++ b/doc/source/cookbook/boolean_data_objects.py
@@ -1,23 +1,29 @@
 import yt
 
 ds = yt.load("Enzo_64/DD0043/data0043")  # load data
-# Make a few data ojbects to start.
+# Make a few data ojbects to start. Two boxes and two spheres.
 re1 = ds.region([0.5, 0.5, 0.5], [0.4, 0.4, 0.4], [0.6, 0.6, 0.6])
 re2 = ds.region([0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [0.6, 0.6, 0.6])
 sp1 = ds.sphere([0.5, 0.5, 0.5], 0.05)
 sp2 = ds.sphere([0.1, 0.2, 0.3], 0.1)
+
 # The "AND" operator. This will make a region identical to re2.
 bool1 = ds.boolean([re1, "AND", re2])
 xp = bool1["particle_position_x"]
+
 # The "OR" operator. This will make a region identical to re1.
 bool2 = ds.boolean([re1, "OR", re2])
+
 # The "NOT" operator. This will make a region like re1, but with the corner
 # that re2 covers cut out.
 bool3 = ds.boolean([re1, "NOT", re2])
+
 # Disjoint regions can be combined with the "OR" operator.
 bool4 = ds.boolean([sp1, "OR", sp2])
+
 # Find oddly-shaped overlapping regions.
 bool5 = ds.boolean([re2, "AND", sp1])
+
 # Nested logic with parentheses.
 # This is re1 with the oddly-shaped region cut out.
 bool6 = ds.boolean([re1, "NOT", "(", re1, "AND", sp1, ")"])

diff -r dfbcd1a35964d1ad902092e160da710c9452fa7c -r 9f1d75eedae6ad915285b1ed9677550a63c2acb9 yt/data_objects/construction_data_containers.py
--- a/yt/data_objects/construction_data_containers.py
+++ b/yt/data_objects/construction_data_containers.py
@@ -127,7 +127,6 @@
         
 
     def _get_cut_mask(self, grid):
-        #pdb.set_trace()
         points_in_grid = np.all(self.positions > grid.LeftEdge, axis=1) & \
                          np.all(self.positions <= grid.RightEdge, axis=1) 
         pids = np.where(points_in_grid)[0]

diff -r dfbcd1a35964d1ad902092e160da710c9452fa7c -r 9f1d75eedae6ad915285b1ed9677550a63c2acb9 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -1222,10 +1222,10 @@
         pbar = get_pbar("Building boolean", len(self._all_regions))
         for i, region in enumerate(self._all_regions):
             try:
-                region._get_list_of_grids()
+                region._get_list_of_grids() # This is no longer supported. 
                 alias = region
             except AttributeError:
-                alias = region.data
+                alias = region.data         # This is no longer supported.
             for grid in alias._grids:
                 if grid in self._some_overlap or grid in self._all_overlap:
                     continue


https://bitbucket.org/yt_analysis/yt/commits/7f18f27fb744/
Changeset:   7f18f27fb744
Branch:      yt-3.0
User:        chummels
Date:        2014-05-19 01:45:16
Summary:     Updating contours_on_slice recipe to work.
Affected #:  1 file

diff -r 9f1d75eedae6ad915285b1ed9677550a63c2acb9 -r 7f18f27fb7441f985cf73c3d6ed949e793ff0f15 doc/source/cookbook/contours_on_slice.py
--- a/doc/source/cookbook/contours_on_slice.py
+++ b/doc/source/cookbook/contours_on_slice.py
@@ -1,13 +1,12 @@
 import yt
 
 # first add density contours on a density slice
-pf = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")  # load data
-p = yt.SlicePlot(pf, "x", "density")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")  
+p = yt.SlicePlot(ds, "x", "density")
 p.annotate_contour("density")
 p.save()
 
-# then add temperature contours on the same densty slice
-pf = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")  # load data
-p = yt.SlicePlot(pf, "x", "density")
+# then add temperature contours on the same density slice
+p = yt.SlicePlot(ds, "x", "density")
 p.annotate_contour("temperature")
-p.save(str(pf)+'_T_contour')
+p.save(str(ds)+'_T_contour')


https://bitbucket.org/yt_analysis/yt/commits/4f1853a53b7c/
Changeset:   4f1853a53b7c
Branch:      yt-3.0
User:        chummels
Date:        2014-05-19 01:58:04
Summary:     Updating extract_fixed_resolution_data recipe.
Affected #:  1 file

diff -r 7f18f27fb7441f985cf73c3d6ed949e793ff0f15 -r 4f1853a53b7c953577508233c438abea1117fc76 doc/source/cookbook/extract_fixed_resolution_data.py
--- a/doc/source/cookbook/extract_fixed_resolution_data.py
+++ b/doc/source/cookbook/extract_fixed_resolution_data.py
@@ -8,21 +8,26 @@
 level = 2
 dims = ds.domain_dimensions * ds.refine_by**level
 
-# Now, we construct an object that describes the data region and structure we
-# want
-cube = ds.covering_grid(2,  # The level we are willing to extract to; higher
-                            # levels than this will not contribute to the data!
+# We construct an object that describes the data region and structure we want
+# In this case, we want all data up to the maximum "level" of refinement 
+# across the entire simulation volume.  Higher levels than this will not 
+# contribute to our covering grid.
+cube = ds.covering_grid(level,  
                         left_edge=[0.0, 0.0, 0.0],
+                        dims=dims,
                         # And any fields to preload (this is optional!)
-                        dims=dims,
                         fields=["density"])
 
 # Now we open our output file using h5py
-# Note that we open with 'w' which will overwrite existing files!
+# Note that we open with 'w' (write), which will overwrite existing files!
 f = h5py.File("my_data.h5", "w")
 
-# We create a dataset at the root note, calling it density...
+# We create a dataset at the root, calling it "density"
 f.create_dataset("/density", data=cube["density"])
 
 # We close our file
 f.close()
+
+# If we want to then access this datacube in the h5 file, we can now...
+f = h5py.File("my_data.h5", "r")
+print f["density"].value


https://bitbucket.org/yt_analysis/yt/commits/9fc7cfc57824/
Changeset:   9fc7cfc57824
Branch:      yt-3.0
User:        chummels
Date:        2014-05-20 03:58:59
Summary:     Updating fit_spectrum cookbook recipe.  Does not compile due to problem in creating derived field.
Affected #:  1 file

diff -r 4f1853a53b7c953577508233c438abea1117fc76 -r 9fc7cfc57824d279d1538fe63f22dbd4da35a3d6 doc/source/cookbook/fit_spectrum.py
--- a/doc/source/cookbook/fit_spectrum.py
+++ b/doc/source/cookbook/fit_spectrum.py
@@ -1,13 +1,14 @@
 import yt
 from yt.analysis_modules.cosmological_observation.light_ray.api import LightRay
-from yt.analysis_modules.api import AbsorptionSpectrum
+from yt.analysis_modules.absorption_spectrum.api import AbsorptionSpectrum
 from yt.analysis_modules.absorption_spectrum.api import generate_total_fit
 
 # Define and add a field to simulate OVI based on a constant relationship to HI
+# Do *NOT* use this for science, because this is not how OVI actually behaves;
+# it is just an example.
 def _OVI_NumberDensity(field, data):
     return data['HI_NumberDensity']
 
-
 def _convertOVI(data):
     return 4.9E-4*.2
 
@@ -15,8 +16,7 @@
              function=_OVI_NumberDensity,
              convert_function=_convertOVI)
 
-
-# Define species andi associated parameters to add to continuum
+# Define species and associated parameters to add to continuum
 # Parameters used for both adding the transition to the spectrum
 # and for fitting
 # Note that for single species that produce multiple lines


https://bitbucket.org/yt_analysis/yt/commits/90dcdf65ff9a/
Changeset:   90dcdf65ff9a
Branch:      yt-3.0
User:        chummels
Date:        2014-05-21 02:36:22
Summary:     Fixing bug in PhasePlot that crashed when you didn't specify a name.  Copied code from PlotWindow to fix.
Affected #:  1 file

diff -r 9fc7cfc57824d279d1538fe63f22dbd4da35a3d6 -r 90dcdf65ff9a9863010c864d3661f5d504851432 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -750,6 +750,9 @@
             self._setup_plots()
         if mpl_kwargs is None:
             mpl_kwargs = {}
+        if name is None:
+            name = str(self.profile.pf)
+        name = os.path.expanduser(name)
         xfn = self.profile.x_field
         yfn = self.profile.y_field
         if isinstance(xfn, types.TupleType):


https://bitbucket.org/yt_analysis/yt/commits/24366e0fb916/
Changeset:   24366e0fb916
Branch:      yt-3.0
User:        chummels
Date:        2014-05-21 02:37:03
Summary:     Updated global_phase_plots recipe to work correctly.
Affected #:  1 file

diff -r 90dcdf65ff9a9863010c864d3661f5d504851432 -r 24366e0fb91662233a51a2f6d905e1f8f60ffdff doc/source/cookbook/global_phase_plots.py
--- a/doc/source/cookbook/global_phase_plots.py
+++ b/doc/source/cookbook/global_phase_plots.py
@@ -4,10 +4,10 @@
 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # This is an object that describes the entire box
-ad = ds.h.all_data()
+ad = ds.all_data()
 
-# We plot the average VelocityMagnitude (mass-weighted) in our object
-# as a function of Density and temperature
+# We plot the average velocity magnitude (mass-weighted) in our object
+# as a function of density and temperature
 plot = yt.PhasePlot(ad, "density", "temperature", "velocity_magnitude")
 
 # save the plot


https://bitbucket.org/yt_analysis/yt/commits/b558fcbd0583/
Changeset:   b558fcbd0583
Branch:      yt-3.0
User:        chummels
Date:        2014-06-17 22:04:30
Summary:     Updating halo_plotting.py recipe.
Affected #:  1 file

diff -r 24366e0fb91662233a51a2f6d905e1f8f60ffdff -r b558fcbd058320149288d5ec7404bd67714d90d9 doc/source/cookbook/halo_plotting.py
--- a/doc/source/cookbook/halo_plotting.py
+++ b/doc/source/cookbook/halo_plotting.py
@@ -2,15 +2,20 @@
 This is a mechanism for plotting circles representing identified particle halos
 on an image.  For more information, see :ref:`halo_finding`.
 """
-from yt.mods import * # set up our namespace
+import yt
+from yt.analysis_modules.halo_analysis.halo_catalog import HaloCatalog
 
-data_pf = load("Enzo_64/RD0006/RedshiftOutput0006")
+# Load the dataset
+ds = yt.load("Enzo_64/RD0006/RedshiftOutput0006")
 
-halo_pf = load('rockstar_halos/halos_0.0.bin')
+# Load the halo list from a rockstar output for this dataset
+halos = yt.load('rockstar_halos/halos_0.0.bin')
 
-hc - HaloCatalog(halos_pf = halo_pf)
+# Create the halo catalog from this halo list
+hc = HaloCatalog(halos_pf = halos)
 hc.load()
 
-p = ProjectionPlot(pf, "x", "density")
+# Create a projection with the halos overplot on top
+p = yt.ProjectionPlot(ds, "x", "density")
 p.annotate_halos(hc)
 p.save()


https://bitbucket.org/yt_analysis/yt/commits/333267c25176/
Changeset:   333267c25176
Branch:      yt-3.0
User:        chummels
Date:        2014-06-17 22:16:16
Summary:     Updated image_background_colors recipe.
Affected #:  1 file

diff -r b558fcbd058320149288d5ec7404bd67714d90d9 -r 333267c251766603ee02b4d46bd5ca3ed0f56be0 doc/source/cookbook/image_background_colors.py
--- a/doc/source/cookbook/image_background_colors.py
+++ b/doc/source/cookbook/image_background_colors.py
@@ -1,21 +1,24 @@
-from yt.mods import *
-
 # This shows how to save ImageArray objects, such as those returned from 
 # volume renderings, to pngs with varying backgrounds.
 
+import yt
+import numpy as np
+
 # Lets make a fake "rendering" that has 4 channels and looks like a linear
 # gradient from the bottom to top.
+
 im = np.zeros([64,128,4])
 for i in xrange(im.shape[0]):
     for k in xrange(im.shape[2]):
         im[i,:,k] = np.linspace(0.,10.*k, im.shape[1])
-im_arr = ImageArray(im)
+im_arr = yt.ImageArray(im)
 
 # in this case you would have gotten im_arr from something like:
 # im_arr = cam.snapshot() 
 
 # To save it with the default settings, we can just use write_png, where it 
 # rescales the image and uses a black background.
+
 im_arr.write_png('standard.png')
  
 # write_png accepts a background keyword argument that defaults to 'black'.
@@ -24,12 +27,8 @@
 # white (1.,1.,1.,1.)
 # None  (0.,0.,0.,0.) <-- Transparent!
 # any rgba list/array: [r,g,b,a], bounded by 0..1
+
 im_arr.write_png('black_bg.png', background='black')
 im_arr.write_png('white_bg.png', background='white')
 im_arr.write_png('green_bg.png', background=[0.,1.,0.,1.])
 im_arr.write_png('transparent_bg.png', background=None)
-
-
-
-
-


https://bitbucket.org/yt_analysis/yt/commits/7a8d3032fca4/
Changeset:   7a8d3032fca4
Branch:      yt-3.0
User:        chummels
Date:        2014-06-17 22:21:50
Summary:     Updating light_cone_projection recipe
Affected #:  1 file

diff -r 333267c251766603ee02b4d46bd5ca3ed0f56be0 -r 7a8d3032fca486698afc327dcdbeee77036c23b7 doc/source/cookbook/light_cone_projection.py
--- a/doc/source/cookbook/light_cone_projection.py
+++ b/doc/source/cookbook/light_cone_projection.py
@@ -1,9 +1,10 @@
-from yt.mods import *
-from yt.analysis_modules.api import LightCone
+import yt
+from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone
 
 # Create a LightCone object extending from z = 0 to z = 0.1
 # with a 600 arcminute field of view and a resolution of
 # 60 arcseconds.
+
 # We have already set up the redshift dumps to be
 # used for this, so we will not use any of the time
 # data dumps.


https://bitbucket.org/yt_analysis/yt/commits/f3ea0dcc7463/
Changeset:   f3ea0dcc7463
Branch:      yt-3.0
User:        chummels
Date:        2014-06-17 22:24:32
Summary:     Updating light_cone_with_halo_mask recipe.
Affected #:  1 file

diff -r 7a8d3032fca486698afc327dcdbeee77036c23b7 -r f3ea0dcc7463c51136e66206537f073575fe6cdf doc/source/cookbook/light_cone_with_halo_mask.py
--- a/doc/source/cookbook/light_cone_with_halo_mask.py
+++ b/doc/source/cookbook/light_cone_with_halo_mask.py
@@ -1,7 +1,7 @@
-from yt.mods import *
+import yt
 
-from yt.analysis_modules.api import LightCone
-from yt.analysis_modules.halo_profiler.api import *
+from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone
+from yt.analysis_modules.halo_profiler.api import HaloProfiler
 
 # Instantiate a light cone object as usual.
 lc = LightCone('enzo_tiny_cosmology/32Mpc_32.enzo',


https://bitbucket.org/yt_analysis/yt/commits/954bb27814c4/
Changeset:   954bb27814c4
Branch:      yt-3.0
User:        chummels
Date:        2014-06-17 22:26:56
Summary:     Updating make_light_ray.py recipe.
Affected #:  1 file

diff -r f3ea0dcc7463c51136e66206537f073575fe6cdf -r 954bb27814c453dcc79face5857ebfb5f29442e2 doc/source/cookbook/make_light_ray.py
--- a/doc/source/cookbook/make_light_ray.py
+++ b/doc/source/cookbook/make_light_ray.py
@@ -1,13 +1,13 @@
 import os
 import sys
-
-from yt.mods import *
-
-from yt.analysis_modules.halo_profiler.api import *
-from yt.analysis_modules.cosmological_observation.light_ray.api import \
+import yt
+from yt.analysis_modules.halo_profiler.api import HaloProfiler
+from yt.analysis_modules.cosmological_observation.light_ray.light_ray import \
      LightRay
 
-if not os.path.isdir("LR"): os.mkdir('LR')
+# Create a directory for the light rays
+if not os.path.isdir("LR"): 
+    os.mkdir('LR')
      
 # Create a LightRay object extending from z = 0 to z = 0.1
 # and use only the redshift dumps.


https://bitbucket.org/yt_analysis/yt/commits/d4a65aa408b5/
Changeset:   d4a65aa408b5
Branch:      yt-3.0
User:        chummels
Date:        2014-06-17 22:57:21
Summary:     Updating multi_plot_3x2_FRB.py
Affected #:  1 file

diff -r 954bb27814c453dcc79face5857ebfb5f29442e2 -r d4a65aa408b5793070dd789aa5c73a9cbc682155 doc/source/cookbook/multi_plot_3x2_FRB.py
--- a/doc/source/cookbook/multi_plot_3x2_FRB.py
+++ b/doc/source/cookbook/multi_plot_3x2_FRB.py
@@ -1,12 +1,13 @@
-from yt.mods import * # set up our namespace
+import yt
+from yt.visualization.api import get_multi_plot
 import matplotlib.colorbar as cb
 from matplotlib.colors import LogNorm
 
 fn = "Enzo_64/RD0006/RedshiftOutput0006" # parameter file to load
 
-
-pf = load(fn) # load data
-v, c = pf.h.find_max("density")
+# load data and get center value and center location as maximum density location
+ds = yt.load(fn) 
+v, c = ds.find_max("density")
 
 # set up our Fixed Resolution Buffer parameters: a width, resolution, and center
 width = (1.0, 'unitary')
@@ -28,7 +29,7 @@
 # over the columns, which will become axes of slicing.
 plots = []
 for ax in range(3):
-    sli = pf.slice(ax, c[ax])
+    sli = ds.slice(ax, c[ax])
     frb = sli.to_frb(width, res)
     den_axis = axes[ax][0]
     temp_axis = axes[ax][1]
@@ -60,4 +61,4 @@
     cbar.set_label(t)
 
 # And now we're done!  
-fig.savefig("%s_3x2.png" % pf)
+fig.savefig("%s_3x2.png" % ds)


https://bitbucket.org/yt_analysis/yt/commits/7d16cc705a63/
Changeset:   7d16cc705a63
Branch:      yt-3.0
User:        chummels
Date:        2014-06-17 23:27:18
Summary:     Merging.
Affected #:  94 files

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -41,6 +41,7 @@
 yt/utilities/lib/PointsInVolume.c
 yt/utilities/lib/QuadTree.c
 yt/utilities/lib/RayIntegrators.c
+yt/utilities/lib/ragged_arrays.c
 yt/utilities/lib/VolumeIntegrator.c
 yt/utilities/lib/grid_traversal.c
 yt/utilities/lib/GridTree.c

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/README
--- a/doc/README
+++ b/doc/README
@@ -5,6 +5,6 @@
 http://sphinx.pocoo.org/
 
 Because the documentation requires a number of dependencies, we provide
-pre-build versions online, accessible here:
+pre-built versions online, accessible here:
 
-http://yt-project.org/docs/
+http://yt-project.org/docs/dev-3.0/

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/analyzing/analysis_modules/PPVCube.ipynb
--- a/doc/source/analyzing/analysis_modules/PPVCube.ipynb
+++ b/doc/source/analyzing/analysis_modules/PPVCube.ipynb
@@ -1,7 +1,7 @@
 {
  "metadata": {
   "name": "",
-  "signature": "sha256:3a720e0a18272564522f9fc23553431908d6f2b4f3e3e7dfe5b3e690e2e37677"
+  "signature": "sha256:3f810954006851303837edb8fd85ee6583a883122b0f4867903562546c4f19d2"
  },
  "nbformat": 3,
  "nbformat_minor": 0,
@@ -16,6 +16,18 @@
      ]
     },
     {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "%matplotlib inline\n",
+      "from yt.mods import *\n",
+      "from yt.analysis_modules.api import PPVCube"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
@@ -44,30 +56,40 @@
      ]
     },
     {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "First, we'll set up the grid and the parameters of the profiles:"
+     ]
+    },
+    {
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "%matplotlib inline\n",
-      "from yt.mods import *\n",
-      "from yt.analysis_modules.api import PPVCube"
+      "nx,ny,nz = (256,256,256) # domain dimensions\n",
+      "R = 10. # outer radius of disk, kpc\n",
+      "r_0 = 3. # scale radius, kpc\n",
+      "beta = 1.4 # for the tangential velocity profile\n",
+      "alpha = -1. # for the radial density profile\n",
+      "x, y = np.mgrid[-R:R:nx*1j,-R:R:ny*1j] # cartesian coordinates of x-y plane of disk\n",
+      "r = np.sqrt(x*x+y*y) # polar coordinates\n",
+      "theta = np.arctan2(y, x) # polar coordinates"
      ],
      "language": "python",
      "metadata": {},
      "outputs": []
     },
     {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "Second, we'll construct the data arrays for the density and the velocity of the disk. Since we have the tangential velocity profile, we have to use the polar coordinates we derived earlier to compute `velx` and `vely`. Everywhere outside the disk, all fields are set to zero.  "
+     ]
+    },
+    {
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "data = {}\n",
-      "nx,ny,nz = (256,256,256)\n",
-      "R = 10. # kpc\n",
-      "r_0 = 3. # kpc\n",
-      "beta = 1.4\n",
-      "alpha = -1.\n",
-      "x, y = np.mgrid[-R:R:nx*1j,-R:R:ny*1j] # cartesian coordinates\n",
-      "r = np.sqrt(x*x+y*y) # polar coordinates\n",
-      "theta = np.arctan2(y, x) # polar coordinates\n",
       "dens = np.zeros((nx,ny,nz))\n",
       "dens[:,:,nz/2-3:nz/2+3] = (r**alpha).reshape(nx,ny,1) # the density profile of the disk\n",
       "vel_theta = r/(1.+(r/r_0)**beta) # the azimuthal velocity profile of the disk\n",
@@ -75,11 +97,31 @@
       "vely = np.zeros((nx,ny,nz))\n",
       "velx[:,:,nz/2-3:nz/2+3] = (-vel_theta*np.sin(theta)).reshape(nx,ny,1) # convert polar to cartesian\n",
       "vely[:,:,nz/2-3:nz/2+3] = (vel_theta*np.cos(theta)).reshape(nx,ny,1) # convert polar to cartesian\n",
+      "dens[r > R] = 0.0\n",
+      "velx[r > R] = 0.0\n",
+      "vely[r > R] = 0.0"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "Finally, we'll package these data arrays up into a dictionary, which will then be shipped off to `load_uniform_grid`. We'll define the width of the grid to be `2*R` kpc, which will be equal to 1  `code_length`. "
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "data = {}\n",
       "data[\"density\"] = (dens,\"g/cm**3\")\n",
       "data[\"velocity_x\"] = (velx, \"km/s\")\n",
       "data[\"velocity_y\"] = (vely, \"km/s\")\n",
       "data[\"velocity_z\"] = (np.zeros((nx,ny,nz)), \"km/s\") # zero velocity in the z-direction\n",
-      "bbox = np.array([[-0.5,0.5],[-0.5,0.5],[-0.5,0.5]])\n",
+      "bbox = np.array([[-0.5,0.5],[-0.5,0.5],[-0.5,0.5]]) # bbox of width 1 on a side with center (0,0,0)\n",
       "ds = load_uniform_grid(data, (nx,ny,nz), length_unit=(2*R,\"kpc\"), nprocs=1, bbox=bbox)"
      ],
      "language": "python",
@@ -146,7 +188,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "cube = PPVCube(ds, L, \"density\", dims=(200,100,50), velocity_bounds=(-0.5,0.5,\"km/s\"))"
+      "cube = PPVCube(ds, L, \"density\", dims=(200,100,50), velocity_bounds=(-1.5,1.5,\"km/s\"))"
      ],
      "language": "python",
      "metadata": {},
@@ -180,8 +222,18 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "ds = load(\"cube.fits\")\n",
-      "slc = SlicePlot(ds, \"z\", [\"density\"], center=\"c\") # sliced at the center of the domain\n",
+      "pf = load(\"cube.fits\")"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "# Specifying no center gives us the center slice\n",
+      "slc = SlicePlot(pf, \"z\", [\"density\"])\n",
       "slc.show()"
      ],
      "language": "python",
@@ -192,19 +244,11 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "# To figure out what the domain center and width is in pixel (code length) units:\n",
-      "print ds.domain_center\n",
-      "print ds.domain_width"
-     ],
-     "language": "python",
-     "metadata": {},
-     "outputs": []
-    },
-    {
-     "cell_type": "code",
-     "collapsed": false,
-     "input": [
-      "slc = SlicePlot(ds, \"z\", [\"density\"], center=[100.5,50.5,-250.0]) # \"z\" slice is in m/s\n",
+      "import yt.units as u\n",
+      "# Picking different velocities for the slices\n",
+      "new_center = pf.domain_center\n",
+      "new_center[2] = pf.spec2pixel(-1.0*u.km/u.s)\n",
+      "slc = SlicePlot(pf, \"z\", [\"density\"], center=new_center)\n",
       "slc.show()"
      ],
      "language": "python",
@@ -215,7 +259,8 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "slc = SlicePlot(ds, \"z\", [\"density\"], center=[100.5,50.5,300.0])\n",
+      "new_center[2] = pf.spec2pixel(0.7*u.km/u.s)\n",
+      "slc = SlicePlot(pf, \"z\", [\"density\"], center=new_center)\n",
       "slc.show()"
      ],
      "language": "python",
@@ -225,7 +270,31 @@
     {
      "cell_type": "code",
      "collapsed": false,
-     "input": [],
+     "input": [
+      "new_center[2] = pf.spec2pixel(-0.3*u.km/u.s)\n",
+      "slc = SlicePlot(pf, \"z\", [\"density\"], center=new_center)\n",
+      "slc.show()"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "If we project all the emission at all the different velocities along the z-axis, we recover the entire disk:"
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "prj = ProjectionPlot(pf, \"z\", [\"density\"], proj_style=\"sum\")\n",
+      "prj.set_log(\"density\", True)\n",
+      "prj.set_zlim(\"density\", 1.0e-3, 0.2)\n",
+      "prj.show()"
+     ],
      "language": "python",
      "metadata": {},
      "outputs": []

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/analyzing/analysis_modules/SZ_projections.ipynb
--- a/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
+++ b/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
@@ -1,7 +1,7 @@
 {
  "metadata": {
   "name": "",
-  "signature": "sha256:e5d3c629592c8aacbabf2e3fab2660703298886b8de6f36eb7cdc1f60b726496"
+  "signature": "sha256:7fc053480ba7896bfa5905bd69f7b3dd326364fbab324975b76f79640f2e0adf"
  },
  "nbformat": 3,
  "nbformat_minor": 0,
@@ -18,7 +18,7 @@
       "projection of the pressure field of a cluster. However, the *full* S-Z signal is a combination of thermal and kinetic\n",
       "contributions, and for large frequencies and high temperatures\n",
       "relativistic effects are important. For computing the full S-Z signal\n",
-      "incorporating all of these effects, Jens Chluba has written a library:\n",
+      "incorporating all of these effects, there is a library:\n",
       "SZpack ([Chluba et al 2012](http://adsabs.harvard.edu/abs/2012MNRAS.426..510C)). \n",
       "\n",
       "The `sunyaev_zeldovich` analysis module in `yt` makes it possible\n",
@@ -93,10 +93,10 @@
       "from yt.mods import *\n",
       "from yt.analysis_modules.api import SZProjection\n",
       "\n",
-      "pf = load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n",
+      "ds = load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n",
       "\n",
       "freqs = [90.,180.,240.]\n",
-      "szprj = SZProjection(pf, freqs)"
+      "szprj = SZProjection(ds, freqs)"
      ],
      "language": "python",
      "metadata": {},
@@ -108,8 +108,8 @@
      "source": [
       "`freqs` is a list or array of frequencies in GHz at which the signal\n",
       "is to be computed. The `SZProjection` constructor also accepts the\n",
-      "optional keywords, **mue** (mean molecular weight for computing the\n",
-      "electron number density, 1.143 is the default) and **high_order** (set\n",
+      "optional keywords, `mue` (mean molecular weight for computing the\n",
+      "electron number density, 1.143 is the default) and `high_order` (set\n",
       "to True to compute terms in the S-Z signal expansion up to\n",
       "second-order in $T_{e,SZ}$ and $\\beta$). "
      ]
@@ -127,7 +127,7 @@
      "collapsed": false,
      "input": [
       "# An on-axis projection along the z-axis with width 10 Mpc, centered on the gas density maximum\n",
-      "szprj.on_axis(\"z\", center=\"max\", width=(10.0, \"mpc\"), nx=400)"
+      "szprj.on_axis(\"z\", center=\"max\", width=(10.0, \"Mpc\"), nx=400)"
      ],
      "language": "python",
      "metadata": {},
@@ -144,7 +144,7 @@
       "which can be accessed dict-like from the projection object (e.g.,\n",
       "`szprj[\"90_GHz\"]`). Projections of other quantities may also be\n",
       "accessed; to see what fields are available call `szprj.keys()`. The methods also accept standard ``yt``\n",
-      "keywords for projections such as **center**, **width**, and **source**. The image buffer size can be controlled by setting **nx**.  \n"
+      "keywords for projections such as `center`, `width`, and `source`. The image buffer size can be controlled by setting `nx`.  \n"
      ]
     },
     {
@@ -216,8 +216,16 @@
      "source": [
       "which would write all of the projections to a single FITS file,\n",
       "including coordinate information in kpc. The optional keyword\n",
-      "**clobber** allows a previous file to be overwritten. \n"
+      "`clobber` allows a previous file to be overwritten. \n"
      ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
     }
    ],
    "metadata": {}

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/analyzing/analysis_modules/halo_catalogs.rst
--- a/doc/source/analyzing/analysis_modules/halo_catalogs.rst
+++ b/doc/source/analyzing/analysis_modules/halo_catalogs.rst
@@ -226,4 +226,4 @@
 =======
 
 For a full example of how to use these methods together see 
-:ref:`halo_analysis_example`.
+:doc:`halo_analysis_example`.

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/analyzing/analysis_modules/photon_simulator.rst
--- a/doc/source/analyzing/analysis_modules/photon_simulator.rst
+++ b/doc/source/analyzing/analysis_modules/photon_simulator.rst
@@ -36,20 +36,20 @@
 .. code:: python
 
     from yt.mods import *
-    from yt.analysis_modules.api import *
+    from yt.analysis_modules.photon_simulator.api import *
     from yt.utilities.cosmology import Cosmology
 
 We're going to load up an Athena dataset of a galaxy cluster core:
 
 .. code:: python
 
-    pf = load("MHDSloshing/virgo_low_res.0054.vtk", 
-              parameters={"TimeUnits":3.1557e13,
-                          "LengthUnits":3.0856e24,
-                          "DensityUnits":6.770424595218825e-27})
+    pf = load("MHDSloshing/virgo_low_res.0054.vtk",
+              parameters={"time_unit":(1.0,"Myr"),
+                          "length_unit":(1.0,"Mpc"),
+                          "mass_unit":(1.0e14,"Msun")}) 
 
 First, to get a sense of what the resulting image will look like, let's
-make a new ``yt`` field called ``"DensitySquared"``, since the X-ray
+make a new ``yt`` field called ``"density_squared"``, since the X-ray
 emission is proportional to :math:`\rho^2`, and a weak function of
 temperature and metallicity.
 
@@ -57,14 +57,14 @@
 
     def _density_squared(field, data):
         return data["density"]**2
-    add_field("DensitySquared", function=_density_squared)
+    add_field("density_squared", function=_density_squared)
 
 Then we'll project this field along the z-axis.
 
 .. code:: python
 
-    prj = ProjectionPlot(pf, "z", ["DensitySquared"], width=(500., "kpc"))
-    prj.set_cmap("DensitySquared", "gray_r")
+    prj = ProjectionPlot(ds, "z", ["density_squared"], width=(500., "kpc"))
+    prj.set_cmap("density_squared", "gray_r")
     prj.show()
 
 .. image:: _images/dsquared.png
@@ -89,7 +89,7 @@
 
 .. code:: python
 
-    sp = pf.sphere("c", (250., "kpc"))
+    sp = ds.sphere("c", (250., "kpc"))
 
 This will serve as our ``data_source`` that we will use later. Next, we
 need to create the ``SpectralModel`` instance that will determine how
@@ -258,11 +258,6 @@
     events = photons.project_photons(L, exp_time_new=2.0e5, redshift_new=0.07, absorb_model=abs_model,
                                      sky_center=(187.5,12.333), responses=[ARF,RMF])
 
-.. parsed-literal::
-
-    WARNING:yt:This routine has not been tested to work with all RMFs. YMMV.
-
-
 Also, the optional keyword ``psf_sigma`` specifies a Gaussian standard
 deviation to scatter the photon sky positions around with, providing a
 crude representation of a PSF.
@@ -282,17 +277,17 @@
 
 .. code:: python
 
-    {'eobs': array([  0.32086522,   0.32271389,   0.32562708, ...,   8.90600621,
-             9.73534237,  10.21614256]), 
-     'xsky': array([ 187.5177707 ,  187.4887825 ,  187.50733609, ...,  187.5059345 ,
-            187.49897546,  187.47307048]), 
-     'ysky': array([ 12.33519996,  12.3544496 ,  12.32750903, ...,  12.34907707,
-            12.33327653,  12.32955225]), 
-     'ypix': array([ 133.85374195,  180.68583074,  115.14110561, ...,  167.61447493,
-            129.17278711,  120.11508562]), 
+    {'eobs': YTArray([  0.32086522,   0.32271389,   0.32562708, ...,   8.90600621,
+             9.73534237,  10.21614256]) keV, 
+     'xsky': YTArray([ 187.5177707 ,  187.4887825 ,  187.50733609, ...,  187.5059345 ,
+            187.49897546,  187.47307048]) degree, 
+     'ysky': YTArray([ 12.33519996,  12.3544496 ,  12.32750903, ...,  12.34907707,
+            12.33327653,  12.32955225]) degree, 
+     'ypix': YTArray([ 133.85374195,  180.68583074,  115.14110561, ...,  167.61447493,
+            129.17278711,  120.11508562]) (dimensionless), 
      'PI': array([ 27,  15,  25, ..., 609, 611, 672]), 
-     'xpix': array([  86.26331108,  155.15934197,  111.06337043, ...,  114.39586907,
-            130.93509652,  192.50639633])}
+     'xpix': YTArray([  86.26331108,  155.15934197,  111.06337043, ...,  114.39586907,
+            130.93509652,  192.50639633]) (dimensionless)}
 
 
 We can bin up the events into an image and save it to a FITS file. The
@@ -436,7 +431,7 @@
 
    bbox = np.array([[-0.5,0.5],[-0.5,0.5],[-0.5,0.5]])
 
-   pf = load_uniform_grid(data, ddims, 2*R*cm_per_kpc, bbox=bbox)
+   ds = load_uniform_grid(data, ddims, 2*R*cm_per_kpc, bbox=bbox)
 
 where for simplicity we have set the velocities to zero, though we
 could have created a realistic velocity field as well. Now, we
@@ -445,7 +440,7 @@
 
 .. code:: python
 
-   sphere = pf.sphere(pf.domain_center, 1.0/pf["mpc"])
+   sphere = ds.sphere(pf.domain_center, (1.0,"Mpc"))
        
    A = 6000.
    exp_time = 2.0e5

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/analyzing/objects.rst
--- a/doc/source/analyzing/objects.rst
+++ b/doc/source/analyzing/objects.rst
@@ -236,7 +236,7 @@
 -------------------------------
 
 Data objects can be cut by their field values using the ``cut_region`` 
-method.  For example, this could be used to compute the total mass within 
+method.  For example, this could be used to compute the total gas mass within
 a certain temperature range, as in the following example.
 
 .. notebook-cell::
@@ -244,11 +244,11 @@
    from yt.mods import *
    ds = load("enzo_tiny_cosmology/DD0046/DD0046")
    ad = ds.all_data()
-   total_mass = ad.quantities.total_mass()
+   total_mass = ad.quantities.total_quantity('cell_mass')
    # now select only gas with 1e5 K < T < 1e7 K.
    new_region = ad.cut_region(['obj["temperature"] > 1e5',
                                'obj["temperature"] < 1e7'])
-   cut_mass = new_region.quantities.total_mass()
+   cut_mass = new_region.quantities.total_quantity('cell_mass')
    print "The fraction of mass in this temperature range is %f." % \
      (cut_mass / total_mass)
 

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/bootcamp/4)_Data_Objects_and_Time_Series.ipynb
--- a/doc/source/bootcamp/4)_Data_Objects_and_Time_Series.ipynb
+++ b/doc/source/bootcamp/4)_Data_Objects_and_Time_Series.ipynb
@@ -23,7 +23,8 @@
      "input": [
       "%matplotlib inline\n",
       "from yt.mods import *\n",
-      "from matplotlib import pylab"
+      "from matplotlib import pylab\n",
+      "from yt.analysis_modules.halo_finding.api import HaloFinder"
      ],
      "language": "python",
      "metadata": {},

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/cookbook/amrkdtree_to_uniformgrid.py
--- /dev/null
+++ b/doc/source/cookbook/amrkdtree_to_uniformgrid.py
@@ -0,0 +1,33 @@
+import numpy as np
+import yt
+
+#This is an example of how to map an amr data set
+#to a uniform grid. In this case the highest
+#level of refinement is mapped into a 1024x1024x1024 cube
+
+#first the amr data is loaded
+ds = yt.load("~/pfs/galaxy/new_tests/feedback_8bz/DD0021/DD0021")
+
+#next we get the maxium refinement level
+lmax = ds.parameters['MaximumRefinementLevel']
+
+#calculate the center of the domain
+domain_center = (ds.domain_right_edge - ds.domain_left_edge)/2
+
+#determine the cellsize in the highest refinement level
+cell_size = pf.domain_width/(pf.domain_dimensions*2**lmax)
+
+#calculate the left edge of the new grid
+left_edge = domain_center - 512*cell_size
+
+#the number of cells per side of the new grid
+ncells = 1024
+
+#ask yt for the specified covering grid
+cgrid = pf.h.covering_grid(lmax, left_edge, np.array([ncells,]*3))
+
+#get a map of the density into the new grid
+density_map = cgrid["density"].astype(dtype="float32")
+
+#save the file as a numpy array for convenient future processing
+np.save("/pfs/goldbaum/galaxy/new_tests/feedback_8bz/gas_density_DD0021_log_densities.npy", density_map)

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/cookbook/ffmpeg_volume_rendering.py
--- /dev/null
+++ b/doc/source/cookbook/ffmpeg_volume_rendering.py
@@ -0,0 +1,99 @@
+#This is an example of how to make videos of 
+#uniform grid data using Theia and ffmpeg
+
+#The Scene object to hold the ray caster and view camera
+from yt.visualization.volume_rendering.theia.scene import TheiaScene
+
+#GPU based raycasting algorithm to use 
+from yt.visualization.volume_rendering.theia.algorithms.front_to_back import FrontToBackRaycaster
+
+#These will be used to define how to color the data
+from yt.visualization.volume_rendering.transfer_functions import ColorTransferFunction
+from yt.visualization.color_maps import *
+
+#This will be used to launch ffmpeg
+import subprocess as sp
+
+#Of course we need numpy for math magic
+import numpy as np
+
+#Opacity scaling function
+def scale_func(v, mi, ma):
+      return  np.minimum(1.0, (v-mi)/(ma-mi) + 0.0)
+
+#load the uniform grid from a numpy array file
+bolshoi = "/home/bogert/log_densities_1024.npy"
+density_grid = np.load(bolshoi)
+
+#Set the TheiaScene to use the density_grid and 
+#setup the raycaster for a resulting 1080p image
+ts = TheiaScene(volume = density_grid, raycaster = FrontToBackRaycaster(size = (1920,1080) ))
+
+#the min and max values in the data to color
+mi, ma = 0.0, 3.6
+
+#setup colortransferfunction
+bins = 5000
+tf = ColorTransferFunction( (mi, ma), bins)
+tf.map_to_colormap(0.5, ma, colormap="spring", scale_func = scale_func)
+
+#pass the transfer function to the ray caster
+ts.source.raycaster.set_transfer(tf)
+
+#Initial configuration for start of video
+#set initial opacity and brightness values
+#then zoom into the center of the data 30%
+ts.source.raycaster.set_opacity(0.03)
+ts.source.raycaster.set_brightness(2.3)
+ts.camera.zoom(30.0)
+
+#path to ffmpeg executable
+FFMPEG_BIN = "/usr/local/bin/ffmpeg"
+
+pipe = sp.Popen([ FFMPEG_BIN,
+        '-y', # (optional) overwrite the output file if it already exists
+	#This must be set to rawvideo because the image is an array
+        '-f', 'rawvideo', 
+	#This must be set to rawvideo because the image is an array
+        '-vcodec','rawvideo',
+	#The size of the image array and resulting video
+        '-s', '1920x1080', 
+	#This must be rgba to match array format (uint32)
+        '-pix_fmt', 'rgba',
+	#frame rate of video
+        '-r', '29.97', 
+        #Indicate that the input to ffmpeg comes from a pipe
+        '-i', '-', 
+        # Tells FFMPEG not to expect any audio
+        '-an', 
+        #Setup video encoder
+	#Use any encoder you life available from ffmpeg
+        '-vcodec', 'libx264', '-preset', 'ultrafast', '-qp', '0',
+        '-pix_fmt', 'yuv420p',
+        #Name of the output
+        'bolshoiplanck2.mkv' ],
+        stdin=sp.PIPE,stdout=sp.PIPE)
+		
+		
+#Now we loop and produce 500 frames
+for k in range (0,500) :
+    #update the scene resulting in a new image
+    ts.update()
+
+    #get the image array from the ray caster
+    array = ts.source.get_results()
+
+    #send the image array to ffmpeg
+    array.tofile(pipe.stdin)
+
+    #rotate the scene by 0.01 rads in x,y & z
+    ts.camera.rotateX(0.01)
+    ts.camera.rotateZ(0.01)
+    ts.camera.rotateY(0.01)
+
+    #zoom in 0.01% for a total of a 5% zoom
+    ts.camera.zoom(0.01)
+
+
+#Close the pipe to ffmpeg
+pipe.terminate()

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/cookbook/fits_radio_cubes.ipynb
--- a/doc/source/cookbook/fits_radio_cubes.ipynb
+++ b/doc/source/cookbook/fits_radio_cubes.ipynb
@@ -1,7 +1,7 @@
 {
  "metadata": {
   "name": "",
-  "signature": "sha256:dbc41f6f836cdeb88a549d85e389d6e4e43d163d8c4c267baea8cce0ebdbf441"
+  "signature": "sha256:40add63976fd633e0542cf7674b166507985aa14685be6b4e4e53bd9a23befc2"
  },
  "nbformat": 3,
  "nbformat_minor": 0,
@@ -23,7 +23,7 @@
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "This notebook demonstrates some of the capabilties of `yt` on some FITS \"position-position-velocity\" cubes of radio data. "
+      "This notebook demonstrates some of the capabilties of `yt` on some FITS \"position-position-spectrum\" cubes of radio data. "
      ]
     },
     {
@@ -82,7 +82,7 @@
      "input": [
       "from yt.frontends.fits.misc import PlotWindowWCS\n",
       "wcs_slc = PlotWindowWCS(slc)\n",
-      "wcs_slc.show()"
+      "wcs_slc[\"intensity\"]"
      ],
      "language": "python",
      "metadata": {},
@@ -109,14 +109,16 @@
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "We can also take slices of this dataset at a few different values along the \"z\" axis (corresponding to the velocity), so let's try a few. First, we'll check what the value along the velocity axis at the domain center is, as well as the range of possible values. This is the third value of each array. "
+      "We can also take slices of this dataset at a few different values along the \"z\" axis (corresponding to the velocity), so let's try a few. To pick specific velocity values for slices, we will need to use the dataset's `spec2pixel` method to determine which pixels to slice on:"
      ]
     },
     {
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "print ds.domain_left_edge[2], ds.domain_center[2], ds.domain_right_edge[2]"
+      "import yt.units as u\n",
+      "new_center = ds.domain_center\n",
+      "new_center[2] = ds.spec2pixel(-250000.*u.m/u.s)"
      ],
      "language": "python",
      "metadata": {},
@@ -126,15 +128,32 @@
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "Now, we'll choose a few values for the velocity within this range:"
+      "Now we can use this new center to create a new slice:"
      ]
     },
     {
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "new_center = ds.domain_center \n",
-      "new_center[2] = -250000.\n",
+      "slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], center=new_center, origin=\"native\")\n",
+      "slc.show()"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "We can do this a few more times for different values of the velocity:"
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "new_center[2] = ds.spec2pixel(-100000.*u.m/u.s)\n",
       "slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], center=new_center, origin=\"native\")\n",
       "slc.show()"
      ],
@@ -146,21 +165,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "new_center = ds.domain_center \n",
-      "new_center[2] = -100000.\n",
-      "slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], center=new_center, origin=\"native\")\n",
-      "slc.show()"
-     ],
-     "language": "python",
-     "metadata": {},
-     "outputs": []
-    },
-    {
-     "cell_type": "code",
-     "collapsed": false,
-     "input": [
-      "new_center = ds.domain_center \n",
-      "new_center[2] = -150000.\n",
+      "new_center[2] = ds.spec2pixel(-150000.*u.m/u.s)\n",
       "slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], center=new_center, origin=\"native\")\n",
       "slc.show()"
      ],
@@ -179,14 +184,14 @@
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "We can also make a projection of all the emission along the line of sight:"
+      "We can also make a projection of all the emission along the line of sight. Since we're not doing an integration along a path length, we needed to specify `proj_style = \"sum\"`:"
      ]
     },
     {
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "prj = yt.ProjectionPlot(ds, \"z\", [\"intensity\"], origin=\"native\", proj_style=\"sum\")\n",
+      "prj = yt.ProjectionPlot(ds, \"z\", [\"intensity\"], proj_style=\"sum\", origin=\"native\")\n",
       "prj.show()"
      ],
      "language": "python",
@@ -197,13 +202,6 @@
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "Since we're not doing an integration along a path length, we needed to specify `proj_style = \"sum\"`. "
-     ]
-    },
-    {
-     "cell_type": "markdown",
-     "metadata": {},
-     "source": [
       "We can also look at the slices perpendicular to the other axes, which will show us the structure along the velocity axis:"
      ]
     },
@@ -211,8 +209,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "slc = yt.SlicePlot(ds, \"x\", [\"intensity\"], origin=\"native\", \n",
-      "                   aspect=\"auto\", window_size=(8.0,8.0))\n",
+      "slc = yt.SlicePlot(ds, \"x\", [\"intensity\"], origin=\"native\", window_size=(8,8))\n",
       "slc.show()"
      ],
      "language": "python",
@@ -223,8 +220,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "slc = yt.SlicePlot(ds, \"y\", [\"intensity\"], origin=\"native\", \n",
-      "                   aspect=\"auto\", window_size=(8.0,8.0))\n",
+      "slc = yt.SlicePlot(ds, \"y\", [\"intensity\"], origin=\"native\", window_size=(8,8))\n",
       "slc.show()"
      ],
      "language": "python",
@@ -235,7 +231,7 @@
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "In these cases, we needed to set `aspect=\"auto\"` and explicitly declare a square `window_size` to get a figure that looks good. "
+      "In these cases, we needed to explicitly declare a square `window_size` to get a figure that looks good. "
      ]
     },
     {

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/cookbook/opengl_stereo_volume_rendering.py
--- /dev/null
+++ b/doc/source/cookbook/opengl_stereo_volume_rendering.py
@@ -0,0 +1,370 @@
+from OpenGL.GL import *
+from OpenGL.GLUT import *
+from OpenGL.GLU import *
+from OpenGL.GL.ARB.vertex_buffer_object import *
+
+import sys, time
+import numpy as np
+import pycuda.driver as cuda_driver
+import pycuda.gl as cuda_gl
+
+from yt.visualization.volume_rendering.theia.scene import TheiaScene
+from yt.visualization.volume_rendering.theia.algorithms.front_to_back import FrontToBackRaycaster
+from yt.visualization.volume_rendering.transfer_functions import ColorTransferFunction
+from yt.visualization.color_maps import *
+
+import numexpr as ne
+
+window = None     # Number of the glut window.
+rot_enabled = True
+
+#Theia Scene
+ts = None
+
+#RAY CASTING values
+c_tbrightness = 1.0
+c_tdensity = 0.05
+
+output_texture = None # pointer to offscreen render target
+
+leftButton = False
+middleButton = False
+rightButton = False
+
+#Screen width and height
+width = 1920
+height = 1080
+
+eyesep = 0.1
+
+(pbo, pycuda_pbo) = [None]*2
+(rpbo, rpycuda_pbo) = [None]*2
+
+#create 2 PBO for stereo scopic rendering
+def create_PBO(w, h):
+    global pbo, pycuda_pbo, rpbo, rpycuda_pbo
+    num_texels = w*h
+    array = np.zeros((num_texels, 3),np.float32)
+
+    pbo = glGenBuffers(1)
+    glBindBuffer(GL_ARRAY_BUFFER, pbo)
+    glBufferData(GL_ARRAY_BUFFER, array, GL_DYNAMIC_DRAW)
+    glBindBuffer(GL_ARRAY_BUFFER, 0)
+    pycuda_pbo = cuda_gl.RegisteredBuffer(long(pbo))
+
+    rpbo = glGenBuffers(1)
+    glBindBuffer(GL_ARRAY_BUFFER, rpbo)
+    glBufferData(GL_ARRAY_BUFFER, array, GL_DYNAMIC_DRAW)
+    glBindBuffer(GL_ARRAY_BUFFER, 0)
+    rpycuda_pbo = cuda_gl.RegisteredBuffer(long(rpbo))
+
+def destroy_PBO(self):
+    global pbo, pycuda_pbo, rpbo, rpycuda_pbo
+    glBindBuffer(GL_ARRAY_BUFFER, long(pbo))
+    glDeleteBuffers(1, long(pbo));
+    glBindBuffer(GL_ARRAY_BUFFER, 0)
+    pbo,pycuda_pbo = [None]*2
+
+    glBindBuffer(GL_ARRAY_BUFFER, long(rpbo))
+    glDeleteBuffers(1, long(rpbo));
+    glBindBuffer(GL_ARRAY_BUFFER, 0)
+    rpbo,rpycuda_pbo = [None]*2
+
+#consistent with C initPixelBuffer()
+def create_texture(w,h):
+    global output_texture
+    output_texture = glGenTextures(1)
+    glBindTexture(GL_TEXTURE_2D, output_texture)
+    # set basic parameters
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
+    # buffer data
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
+                 w, h, 0, GL_RGB, GL_FLOAT, None)
+
+#consistent with C initPixelBuffer()
+def destroy_texture():
+    global output_texture
+    glDeleteTextures(output_texture);
+    output_texture = None
+
+def init_gl(w = 512 , h = 512):
+    Width, Height = (w, h)
+
+    glClearColor(0.1, 0.1, 0.5, 1.0)
+    glDisable(GL_DEPTH_TEST)
+
+    #matrix functions
+    glViewport(0, 0, Width, Height)
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+
+    #matrix functions
+    gluPerspective(60.0, Width/float(Height), 0.1, 10.0)
+    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
+
+def resize(Width, Height):
+    global width, height
+    (width, height) = Width, Height
+    glViewport(0, 0, Width, Height)        # Reset The Current Viewport And Perspective Transformation
+    glMatrixMode(GL_PROJECTION)
+    glLoadIdentity()
+    gluPerspective(60.0, Width/float(Height), 0.1, 10.0)
+
+
+def do_tick():
+    global time_of_last_titleupdate, frame_counter, frames_per_second
+    if ((time.clock () * 1000.0) - time_of_last_titleupdate >= 1000.):
+        frames_per_second = frame_counter                   # Save The FPS
+        frame_counter = 0  # Reset The FPS Counter
+        szTitle = "%d FPS" % (frames_per_second )
+        glutSetWindowTitle ( szTitle )
+        time_of_last_titleupdate = time.clock () * 1000.0
+    frame_counter += 1
+
+oldMousePos = [ 0, 0 ]
+def mouseButton( button, mode, x, y ):
+	"""Callback function (mouse button pressed or released).
+
+	The current and old mouse positions are stored in
+	a	global renderParam and a global list respectively"""
+
+	global leftButton, middleButton, rightButton, oldMousePos
+
+        if button == GLUT_LEFT_BUTTON:
+	    if mode == GLUT_DOWN:
+	        leftButton = True
+            else:
+		leftButton = False
+
+        if button == GLUT_MIDDLE_BUTTON:
+	    if mode == GLUT_DOWN:
+	        middleButton = True
+            else:
+		middleButton = False
+
+        if button == GLUT_RIGHT_BUTTON:
+	    if mode == GLUT_DOWN:
+	        rightButton = True
+            else:
+		rightButton = False
+
+	oldMousePos[0], oldMousePos[1] = x, y
+	glutPostRedisplay( )
+
+def mouseMotion( x, y ):
+	"""Callback function (mouse moved while button is pressed).
+
+	The current and old mouse positions are stored in
+	a	global renderParam and a global list respectively.
+	The global translation vector is updated according to
+	the movement of the mouse pointer."""
+
+	global ts, leftButton, middleButton, rightButton, oldMousePos
+	deltaX = x - oldMousePos[ 0 ]
+	deltaY = y - oldMousePos[ 1 ]
+
+	factor = 0.001
+
+	if leftButton == True:
+            ts.camera.rotateX( - deltaY * factor)
+            ts.camera.rotateY( - deltaX * factor)
+	if middleButton == True:
+	    ts.camera.translateX( deltaX* 2.0 * factor)
+	    ts.camera.translateY( - deltaY* 2.0 * factor)
+	if rightButton == True:
+	    ts.camera.scale += deltaY * factor
+
+	oldMousePos[0], oldMousePos[1] = x, y
+	glutPostRedisplay( )
+
+def keyPressed(*args):
+    global c_tbrightness, c_tdensity, eyesep
+    # If escape is pressed, kill everything.
+    if args[0] == '\033':
+        print 'Closing..'
+        destroy_PBOs()
+        destroy_texture()
+        exit()
+
+    #change the brightness of the scene
+    elif args[0] == ']':
+        c_tbrightness += 0.025
+    elif args[0] == '[':
+        c_tbrightness -= 0.025
+
+    #change the density scale
+    elif args[0] == ';':
+        c_tdensity -= 0.001
+    elif args[0] == '\'':
+        c_tdensity += 0.001 
+
+    #change the transfer scale
+    elif args[0] == '-':
+        eyesep -= 0.01
+    elif args[0] == '=':
+        eyesep += 0.01 
+
+def idle():
+    glutPostRedisplay()
+
+def display():
+    try:
+        #process left eye
+        process_image()
+        display_image()
+
+        #process right eye
+        process_image(eye = False)
+        display_image(eye = False)
+
+
+        glutSwapBuffers()
+
+    except:
+        from traceback import print_exc
+        print_exc()
+        from os import _exit
+        _exit(0)
+
+def process(eye = True):
+    global ts, pycuda_pbo, rpycuda_pbo, eyesep, c_tbrightness, c_tdensity
+    """ Use PyCuda """
+
+    ts.get_raycaster().set_opacity(c_tdensity)
+    ts.get_raycaster().set_brightness(c_tbrightness)
+
+    if (eye) :
+        ts.camera.translateX(-eyesep)
+        dest_mapping = pycuda_pbo.map()
+        (dev_ptr, size) = dest_mapping.device_ptr_and_size()
+        ts.get_raycaster().surface.device_ptr = dev_ptr
+        ts.update()
+        dest_mapping.unmap()
+        ts.camera.translateX(eyesep)
+    else :
+        ts.camera.translateX(eyesep)
+        dest_mapping = rpycuda_pbo.map()
+        (dev_ptr, size) = dest_mapping.device_ptr_and_size()
+        ts.get_raycaster().surface.device_ptr = dev_ptr
+        ts.update()
+        dest_mapping.unmap()
+        ts.camera.translateX(-eyesep)
+
+
+def process_image(eye =  True):
+    global output_texture, pbo, rpbo, width, height
+    """ copy image and process using CUDA """
+    # run the Cuda kernel
+    process(eye)
+    # download texture from PBO
+    if (eye) : 
+        glBindBuffer(GL_PIXEL_UNPACK_BUFFER, np.uint64(pbo))
+        glBindTexture(GL_TEXTURE_2D, output_texture)
+
+        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
+                 width, height, 0,
+                 GL_RGB, GL_FLOAT, None)
+    else :
+        glBindBuffer(GL_PIXEL_UNPACK_BUFFER, np.uint64(rpbo))
+        glBindTexture(GL_TEXTURE_2D, output_texture)
+
+        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
+                 width, height, 0,
+                 GL_RGB, GL_FLOAT, None)
+
+def display_image(eye = True):
+    global width, height
+    """ render a screen sized quad """
+    glDisable(GL_DEPTH_TEST)
+    glDisable(GL_LIGHTING)
+    glEnable(GL_TEXTURE_2D)
+    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE)
+
+    #matix functions should be moved
+    glMatrixMode(GL_PROJECTION)
+    glPushMatrix()
+    glLoadIdentity()
+    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0)
+    glMatrixMode( GL_MODELVIEW)
+    glLoadIdentity()
+    glViewport(0, 0, width, height)
+
+    if (eye) :
+        glDrawBuffer(GL_BACK_LEFT)
+    else :
+        glDrawBuffer(GL_BACK_RIGHT)
+
+    glBegin(GL_QUADS)
+    glTexCoord2f(0.0, 0.0)
+    glVertex3f(-1.0, -1.0, 0.5)
+    glTexCoord2f(1.0, 0.0)
+    glVertex3f(1.0, -1.0, 0.5)
+    glTexCoord2f(1.0, 1.0)
+    glVertex3f(1.0, 1.0, 0.5)
+    glTexCoord2f(0.0, 1.0)
+    glVertex3f(-1.0, 1.0, 0.5)
+    glEnd()
+
+    glMatrixMode(GL_PROJECTION)
+    glPopMatrix()
+
+    glDisable(GL_TEXTURE_2D)
+    glBindTexture(GL_TEXTURE_2D, 0)
+    glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)
+    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)
+
+
+#note we may need to init cuda_gl here and pass it to camera
+def main():
+    global window, ts, width, height
+    (width, height) = (1920, 1080)
+
+    glutInit(sys.argv)
+    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH | GLUT_STEREO)
+    glutInitWindowSize(*initial_size)
+    glutInitWindowPosition(0, 0)
+    window = glutCreateWindow("Stereo Volume Rendering")
+
+
+    glutDisplayFunc(display)
+    glutIdleFunc(idle)
+    glutReshapeFunc(resize)
+    glutMouseFunc( mouseButton )
+    glutMotionFunc( mouseMotion )
+    glutKeyboardFunc(keyPressed)
+    init_gl(width, height)
+
+    # create texture for blitting to screen
+    create_texture(width, height)
+
+    import pycuda.gl.autoinit
+    import pycuda.gl
+    cuda_gl = pycuda.gl
+
+    create_PBO(width, height)
+    # ----- Load and Set Volume Data -----
+
+    density_grid = np.load("/home/bogert/dd150_log_densities.npy")
+
+    mi, ma= 21.5, 24.5
+    bins = 5000
+    tf = ColorTransferFunction( (mi, ma), bins)
+    tf.map_to_colormap(mi, ma, colormap="algae", scale_func = scale_func)
+
+    ts = TheiaScene(volume = density_grid, raycaster = FrontToBackRaycaster(size = (width, height), tf = tf))
+
+    ts.get_raycaster().set_sample_size(0.01)
+    ts.get_raycaster().set_max_samples(5000)
+
+    glutMainLoop()
+
+def scale_func(v, mi, ma):
+    return  np.minimum(1.0, np.abs((v)-ma)/np.abs(mi-ma) + 0.0)
+
+# Print message to console, and kick off the main to get it rolling.
+if __name__ == "__main__":
+    print "Hit ESC key to quit, 'a' to toggle animation, and 'e' to toggle cuda"
+    main()

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/cookbook/opengl_volume_rendering.py
--- /dev/null
+++ b/doc/source/cookbook/opengl_volume_rendering.py
@@ -0,0 +1,322 @@
+from OpenGL.GL import *
+from OpenGL.GLUT import *
+from OpenGL.GLU import *
+from OpenGL.GL.ARB.vertex_buffer_object import *
+
+import sys, time
+import numpy as np
+import pycuda.driver as cuda_driver
+import pycuda.gl as cuda_gl
+
+from yt.visualization.volume_rendering.theia.scene import TheiaScene
+from yt.visualization.volume_rendering.theia.algorithms.front_to_back import FrontToBackRaycaster
+from yt.visualization.volume_rendering.transfer_functions import ColorTransferFunction
+from yt.visualization.color_maps import *
+
+import numexpr as ne
+
+window = None     # Number of the glut window.
+rot_enabled = True
+
+#Theia Scene
+ts = None
+
+#RAY CASTING values
+c_tbrightness = 1.0
+c_tdensity = 0.05
+
+output_texture = None # pointer to offscreen render target
+
+leftButton = False
+middleButton = False
+rightButton = False
+
+#Screen width and height
+width = 1024
+height = 1024
+
+eyesep = 0.1
+
+(pbo, pycuda_pbo) = [None]*2
+
+def create_PBO(w, h):
+    global pbo, pycuda_pbo
+    num_texels = w*h
+    array = np.zeros((w,h,3),np.uint32)
+
+    pbo = glGenBuffers(1)
+    glBindBuffer(GL_ARRAY_BUFFER, pbo)
+    glBufferData(GL_ARRAY_BUFFER, array, GL_DYNAMIC_DRAW)
+    glBindBuffer(GL_ARRAY_BUFFER, 0)
+    pycuda_pbo = cuda_gl.RegisteredBuffer(long(pbo))
+
+def destroy_PBO(self):
+    global pbo, pycuda_pbo
+    glBindBuffer(GL_ARRAY_BUFFER, long(pbo))
+    glDeleteBuffers(1, long(pbo));
+    glBindBuffer(GL_ARRAY_BUFFER, 0)
+    pbo,pycuda_pbo = [None]*2
+
+#consistent with C initPixelBuffer()
+def create_texture(w,h):
+    global output_texture
+    output_texture = glGenTextures(1)
+    glBindTexture(GL_TEXTURE_2D, output_texture)
+    # set basic parameters
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
+    # buffer data
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                 w, h, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, None)
+
+#consistent with C initPixelBuffer()
+def destroy_texture():
+    global output_texture
+    glDeleteTextures(output_texture);
+    output_texture = None
+
+def init_gl(w = 512 , h = 512):
+    Width, Height = (w, h)
+
+    glClearColor(0.1, 0.1, 0.5, 1.0)
+    glDisable(GL_DEPTH_TEST)
+
+    #matrix functions
+    glViewport(0, 0, Width, Height)
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+
+    #matrix functions
+    gluPerspective(60.0, Width/float(Height), 0.1, 10.0)
+    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
+
+def resize(Width, Height):
+    global width, height
+    (width, height) = Width, Height
+    glViewport(0, 0, Width, Height)        # Reset The Current Viewport And Perspective Transformation
+    glMatrixMode(GL_PROJECTION)
+    glLoadIdentity()
+    gluPerspective(60.0, Width/float(Height), 0.1, 10.0)
+
+
+def do_tick():
+    global time_of_last_titleupdate, frame_counter, frames_per_second
+    if ((time.clock () * 1000.0) - time_of_last_titleupdate >= 1000.):
+        frames_per_second = frame_counter                   # Save The FPS
+        frame_counter = 0  # Reset The FPS Counter
+        szTitle = "%d FPS" % (frames_per_second )
+        glutSetWindowTitle ( szTitle )
+        time_of_last_titleupdate = time.clock () * 1000.0
+    frame_counter += 1
+
+oldMousePos = [ 0, 0 ]
+def mouseButton( button, mode, x, y ):
+	"""Callback function (mouse button pressed or released).
+
+	The current and old mouse positions are stored in
+	a	global renderParam and a global list respectively"""
+
+	global leftButton, middleButton, rightButton, oldMousePos
+
+        if button == GLUT_LEFT_BUTTON:
+	    if mode == GLUT_DOWN:
+	        leftButton = True
+            else:
+		leftButton = False
+
+        if button == GLUT_MIDDLE_BUTTON:
+	    if mode == GLUT_DOWN:
+	        middleButton = True
+            else:
+		middleButton = False
+
+        if button == GLUT_RIGHT_BUTTON:
+	    if mode == GLUT_DOWN:
+	        rightButton = True
+            else:
+		rightButton = False
+
+	oldMousePos[0], oldMousePos[1] = x, y
+	glutPostRedisplay( )
+
+def mouseMotion( x, y ):
+	"""Callback function (mouse moved while button is pressed).
+
+	The current and old mouse positions are stored in
+	a	global renderParam and a global list respectively.
+	The global translation vector is updated according to
+	the movement of the mouse pointer."""
+
+	global ts, leftButton, middleButton, rightButton, oldMousePos
+	deltaX = x - oldMousePos[ 0 ]
+	deltaY = y - oldMousePos[ 1 ]
+
+	factor = 0.001
+
+	if leftButton == True:
+             ts.camera.rotateX( - deltaY * factor)
+             ts.camera.rotateY( - deltaX * factor)
+	if middleButton == True:
+	     ts.camera.translateX( deltaX* 2.0 * factor)
+	     ts.camera.translateY( - deltaY* 2.0 * factor)
+	if rightButton == True:
+	     ts.camera.scale += deltaY * factor
+
+	oldMousePos[0], oldMousePos[1] = x, y
+	glutPostRedisplay( )
+
+def keyPressed(*args):
+    global c_tbrightness, c_tdensity
+    # If escape is pressed, kill everything.
+    if args[0] == '\033':
+        print 'Closing..'
+        destroy_PBOs()
+        destroy_texture()
+        exit()
+
+    #change the brightness of the scene
+    elif args[0] == ']':
+        c_tbrightness += 0.025
+    elif args[0] == '[':
+        c_tbrightness -= 0.025
+
+    #change the density scale
+    elif args[0] == ';':
+        c_tdensity -= 0.001
+    elif args[0] == '\'':
+        c_tdensity += 0.001 
+
+def idle():
+    glutPostRedisplay()
+
+def display():
+    try:
+        #process left eye
+        process_image()
+        display_image()
+
+        glutSwapBuffers()
+
+    except:
+        from traceback import print_exc
+        print_exc()
+        from os import _exit
+        _exit(0)
+
+def process(eye = True):
+    global ts, pycuda_pbo, eyesep, c_tbrightness, c_tdensity
+
+    ts.get_raycaster().set_opacity(c_tdensity)
+    ts.get_raycaster().set_brightness(c_tbrightness)
+
+    dest_mapping = pycuda_pbo.map()
+    (dev_ptr, size) = dest_mapping.device_ptr_and_size()
+    ts.get_raycaster().surface.device_ptr = dev_ptr
+    ts.update()
+   # ts.get_raycaster().cast()
+    dest_mapping.unmap()
+
+
+def process_image():
+    global output_texture, pbo, width, height
+    """ copy image and process using CUDA """
+    # run the Cuda kernel
+    process()
+    # download texture from PBO
+    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, np.uint64(pbo))
+    glBindTexture(GL_TEXTURE_2D, output_texture)
+
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                 width, height, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, None)
+
+def display_image(eye = True):
+    global width, height
+    """ render a screen sized quad """
+    glDisable(GL_DEPTH_TEST)
+    glDisable(GL_LIGHTING)
+    glEnable(GL_TEXTURE_2D)
+    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE)
+
+    #matix functions should be moved
+    glMatrixMode(GL_PROJECTION)
+    glPushMatrix()
+    glLoadIdentity()
+    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0)
+    glMatrixMode( GL_MODELVIEW)
+    glLoadIdentity()
+    glViewport(0, 0, width, height)
+
+    glBegin(GL_QUADS)
+    glTexCoord2f(0.0, 0.0)
+    glVertex3f(-1.0, -1.0, 0.5)
+    glTexCoord2f(1.0, 0.0)
+    glVertex3f(1.0, -1.0, 0.5)
+    glTexCoord2f(1.0, 1.0)
+    glVertex3f(1.0, 1.0, 0.5)
+    glTexCoord2f(0.0, 1.0)
+    glVertex3f(-1.0, 1.0, 0.5)
+    glEnd()
+
+    glMatrixMode(GL_PROJECTION)
+    glPopMatrix()
+
+    glDisable(GL_TEXTURE_2D)
+    glBindTexture(GL_TEXTURE_2D, 0)
+    glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)
+    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)
+
+
+#note we may need to init cuda_gl here and pass it to camera
+def main():
+    global window, ts, width, height
+    (width, height) = (1024, 1024)
+
+    glutInit(sys.argv)
+    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH )
+    glutInitWindowSize(width, height)
+    glutInitWindowPosition(0, 0)
+    window = glutCreateWindow("Stereo Volume Rendering")
+
+
+    glutDisplayFunc(display)
+    glutIdleFunc(idle)
+    glutReshapeFunc(resize)
+    glutMouseFunc( mouseButton )
+    glutMotionFunc( mouseMotion )
+    glutKeyboardFunc(keyPressed)
+    init_gl(width, height)
+
+    # create texture for blitting to screen
+    create_texture(width, height)
+
+    import pycuda.gl.autoinit
+    import pycuda.gl
+    cuda_gl = pycuda.gl
+
+    create_PBO(width, height)
+    # ----- Load and Set Volume Data -----
+
+    density_grid = np.load("/home/bogert/dd150_log_densities.npy")
+
+    mi, ma= 21.5, 24.5
+    bins = 5000
+    tf = ColorTransferFunction( (mi, ma), bins)
+    tf.map_to_colormap(mi, ma, colormap="algae", scale_func = scale_func)
+
+    ts = TheiaScene(volume = density_grid, raycaster = FrontToBackRaycaster(size = (width, height), tf = tf))
+
+    ts.get_raycaster().set_sample_size(0.01)
+    ts.get_raycaster().set_max_samples(5000)
+    ts.update()
+
+    glutMainLoop()
+
+def scale_func(v, mi, ma):
+    return  np.minimum(1.0, np.abs((v)-ma)/np.abs(mi-ma) + 0.0)
+
+# Print message to console, and kick off the main to get it rolling.
+if __name__ == "__main__":
+    print "Hit ESC key to quit, 'a' to toggle animation, and 'e' to toggle cuda"
+    main()

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/developing/developing.rst
--- a/doc/source/developing/developing.rst
+++ b/doc/source/developing/developing.rst
@@ -74,6 +74,8 @@
 this manner, but still want to contribute, please consider creating an external
 package, which we'll happily link to.
 
+.. _requirements-for-code-submission:
+
 Requirements for Code Submission
 ++++++++++++++++++++++++++++++++
 
@@ -88,22 +90,22 @@
   * New Features
 
     * New unit tests (possibly new answer tests) (See :ref:`testing`)
-    * Docstrings for public API
-    * Addition of new feature to the narrative documentation
-    * Addition of cookbook recipe
+    * Docstrings in the source code for the public API
+    * Addition of new feature to the narrative documentation (See :ref:`writing_documentation`)
+    * Addition of cookbook recipe (See :ref:`writing_documentation`) 
     * Issue created on issue tracker, to ensure this is added to the changelog
 
   * Extension or Breakage of API in Existing Features
 
-    * Update existing narrative docs and docstrings
-    * Update existing cookbook recipes
+    * Update existing narrative docs and docstrings (See :ref:`writing_documentation`) 
+    * Update existing cookbook recipes (See :ref:`writing_documentation`) 
     * Modify of create new unit tests (See :ref:`testing`)
     * Issue created on issue tracker, to ensure this is added to the changelog
 
   * Bug fixes
 
     * Unit test is encouraged, to ensure breakage does not happen again in the
-      future.
+      future. (See :ref:`testing`)
     * Issue created on issue tracker, to ensure this is added to the changelog
 
 When submitting, you will be asked to make sure that your changes meet all of
@@ -111,6 +113,8 @@
 out with them.  In :ref:`code-style-guide` there is a list of handy tips for
 how to structure and write your code.
 
+.. _mercurial-with-yt:
+
 How to Use Mercurial with yt
 ++++++++++++++++++++++++++++
 
@@ -135,6 +139,8 @@
   * If you run into any troubles, stop by IRC (see :ref:`irc`) or the mailing
     list.
 
+.. _building-yt:
+
 Building yt
 +++++++++++
 
@@ -148,28 +154,40 @@
 
 .. code-block:: bash
 
-   python2.7 setup.py develop
+  $ python2.7 setup.py develop
 
 If you have previously "installed" via ``setup.py install`` you have to
 re-install:
 
 .. code-block:: bash
 
-   python2.7 setup.py install
+  $ python2.7 setup.py install
 
-Only one of these two options is needed.  yt may require you to specify the
-location to libpng and hdf5.  This can be done through files named ``png.cfg``
-and ``hdf5.cfg``.  If you are using the installation script, these will already
-exist.
+Only one of these two options is needed.
+
+If you plan to develop yt on Windows, we recommend using the `MinGW <http://www.mingw.org/>`_ gcc
+compiler that can be installed using the `Anaconda Python
+Distribution <https://store.continuum.io/cshop/anaconda/>`_. Also, the syntax for the
+setup command is slightly different; you must type:
+
+.. code-block:: bash
+
+  $ python2.7 setup.py build --compiler=mingw32 develop
+
+or
+
+.. code-block:: bash
+
+  $ python2.7 setup.py build --compiler=mingw32 install
+
+.. _sharing-changes:
 
 Making and Sharing Changes
 ++++++++++++++++++++++++++
 
 The simplest way to submit changes to yt is to commit changes in your
 ``$YT_DEST/src/yt-hg`` directory, fork the repository on BitBucket,  push the
-changesets to your fork, and then issue a pull request.  If you will be
-developing much more in-depth features for yt, you will also
-likely want to edit the paths in your 
+changesets to your fork, and then issue a pull request.  
 
 Here's a more detailed flowchart of how to submit changes.
 
@@ -208,25 +226,72 @@
 
         hg push https://bitbucket.org/YourUsername/yt/
 
-  #. Update your pull request by visiting
-     https://bitbucket.org/YourUsername/yt/pull-request/new
+  #. Your pull request will be automatically updated.
 
 .. _writing_documentation:
 
 How to Write Documentation
-++++++++++++++++++++++++++
+--------------------------
 
-The process for writing documentation is identical to the above, except that
-you're modifying source files in the doc directory (i.e. ``$YT_DEST/src/yt-hg/doc``) 
-instead of the src directory (i.e. ``$YT_DEST/src/yt-hg/yt``) of the yt repository.
+Writing documentation is one of the most important but often overlooked tasks
+for increasing yt's impact in the community.  It is the way in which the 
+world will understand how to use our code, so it needs to be done concisely
+and understandably.  Typically, when a developer submits some piece of code 
+with new functionality, she should also include documentation on how to use 
+that functionality (as per :ref:`requirements-for-code-submission`).  
+Depending on the nature of the code addition, this could be a new narrative 
+docs section describing how the new code works and how to use it, it could 
+include a recipe in the cookbook section, or it could simply be adding a note 
+in the relevant docs text somewhere.
+
+The documentation exists in the main mercurial code repository for yt in the 
+``doc`` directory (i.e. ``$YT_DEST/src/yt-hg/doc/source`` on systems installed 
+using the installer script).  It is organized hierarchically into the main 
+categories of:
+
+ * Visualizing
+ * Analyzing
+ * Examining
+ * Cookbook
+ * Bootcamp
+ * Developing
+ * Reference
+ * Help
+
+You will have to figure out where your new/modified doc fits into this, but 
+browsing through the pre-built documentation is a good way to sort that out.
+
 All the source for the documentation is written in 
-`Sphinx <http://sphinx-doc.org/>`_, which uses ReST for markup.
+`Sphinx <http://sphinx-doc.org/>`_, which uses ReST for markup.  ReST is very
+straightforward to markup in a text editor, and if you are new to it, we
+recommend just using other .rst files in the existing yt documentation as 
+templates or checking out the 
+`ReST reference documentation <http://sphinx-doc.org/rest.html>`_.
 
-Cookbook recipes go in ``source/cookbook/`` and must be added to one of the
-``.rst`` files in that directory.  
+New cookbook recipes (see :ref:`cookbook`) are very helpful for the community 
+as they provide simple annotated recipes on how to use specific functionality.  
+To add one, create a concise python script which demonstrates some 
+functionality and pare it down to its minimum.  Add some comment lines to 
+describe what it is that you're doing along the way.  Place this ``.py`` file 
+in the ``source/cookbook/`` directory, and then link to it explicitly in one 
+of the relevant ``.rst`` files in that directory (e.g. ``complex_plots.rst``, 
+``cosmological_analysis.rst``, etc.), and add some description of what the script 
+actually does.  We recommend that you use one of the 
+`sample data sets <http://yt-project.org/data>`_ in your recipe.  When the full
+docs are built, each of the cookbook recipes are executed dynamically on 
+a system which has access to all of the sample datasets.  Any output images 
+generated by your script will then be attached inline in the built documentation 
+directly following your script.
 
-For more information on how to build the documentation to make sure it looks
-the way you expect it to after modifying it, see :ref:`docs_build`.
+After you have made your modifications to the docs, you will want to make sure
+that they render the way you expect them to render.  For more information on
+this, see the section on :ref:`docs_build`.  Unless you're contributing cookbook
+recipes or notebooks which require a dynamical build, you can probably get 
+away with just doing a 'quick' docs build.
+
+When you have completed your documentation additions, commit your changes 
+to your repository and make a pull request in the same way you would contribute 
+a change to the codebase, as described in the section on :ref:`sharing-changes`.
 
 How To Get The Source Code For Editing
 --------------------------------------

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/examining/Loading_Generic_Particle_Data.ipynb
--- /dev/null
+++ b/doc/source/examining/Loading_Generic_Particle_Data.ipynb
@@ -0,0 +1,156 @@
+{
+ "metadata": {
+  "name": "",
+  "signature": "sha256:6da8ec00f414307f27544fbdbc6b4fa476e5e96809003426279b2a1c898b4546"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+  {
+   "cells": [
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "This example creates a fake in-memory particle dataset and then loads it as a yt dataset using the `load_particles` function.\n",
+      "\n",
+      "Our \"fake\" dataset will be numpy arrays filled with normally distributed randoml particle positions and uniform particle masses.  Since real data is often scaled, I arbitrarily multiply by 1e6 to show how to deal with scaled data."
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "import numpy as np\n",
+      "\n",
+      "n_particles = 5e6\n",
+      "\n",
+      "ppx, ppy, ppz = 1e6*np.random.normal(size=[3, n_particles])\n",
+      "\n",
+      "ppm = np.ones(n_particles)"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "The `load_particles` function accepts a dictionary populated with particle data fields loaded in memory as numpy arrays or python lists:"
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "data = {'particle_position_x': ppx,\n",
+      "        'particle_position_y': ppy,\n",
+      "        'particle_position_z': ppz,\n",
+      "        'particle_mass': ppm}"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "To hook up with yt's internal field system, the dictionary keys must be 'particle_position_x', 'particle_position_y', 'particle_position_z', and 'particle_mass', as well as any other particle field provided by one of the particle frontends."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "The `load_particles` function transforms the `data` dictionary into an in-memory yt `Dataset` object, providing an interface for further analysis with `yt`. The example below illustrates how to load the data dictionary we created above."
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "import yt\n",
+      "from yt.units import parsec, Msun\n",
+      "\n",
+      "bbox = 1.1*np.array([[min(ppx), max(ppx)], [min(ppy), max(ppy)], [min(ppy), max(ppy)]])\n",
+      "\n",
+      "ds = yt.load_particles(data, length_unit=parsec, mass_unit=1e8*Msun, n_ref=256, bbox=bbox)"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "The `length_unit` and `mass_unit` are the conversion from the units used in the `data` dictionary to CGS.  I've arbitrarily chosen one parsec and 10^8 Msun for this example. \n",
+      "\n",
+      "The `n_ref` parameter controls how many particle it takes to accumulate in an oct-tree cell to trigger refinement.  Larger `n_ref` will decrease poisson noise at the cost of resolution in the octree.  \n",
+      "\n",
+      "Finally, the `bbox` parameter is a bounding box in the units of the dataset that contains all of the particles.  This is used to set the size of the base octree block."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "This new dataset acts like any other `yt` `Dataset` object, and can be used to create data objects and query for yt fields.  This example shows how to access \"deposit\" fields:"
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "ad = ds.all_data()\n",
+      "\n",
+      "# This is generated with \"cloud-in-cell\" interpolation.\n",
+      "cic_density = ad[\"deposit\", \"all_cic\"]\n",
+      "\n",
+      "# These three are based on nearest-neighbor cell deposition\n",
+      "nn_density = ad[\"deposit\", \"all_density\"]\n",
+      "nn_deposited_mass = ad[\"deposit\", \"all_mass\"]\n",
+      "particle_count_per_cell = ad[\"deposit\", \"all_count\"]"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "ds.field_list"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "ds.derived_field_list"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "slc = yt.SlicePlot(ds, 2, ('deposit', 'all_cic'))\n",
+      "slc.set_width((8, 'Mpc'))"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
+    }
+   ],
+   "metadata": {}
+  }
+ ]
+}
\ No newline at end of file

diff -r d4a65aa408b5793070dd789aa5c73a9cbc682155 -r 7d16cc705a6361cea06ab241d7a3a20555725122 doc/source/examining/loading_data.rst
--- a/doc/source/examining/loading_data.rst
+++ b/doc/source/examining/loading_data.rst
@@ -676,8 +676,14 @@
 Additional Options
 ++++++++++++++++++
 
+The following are additional options that may be passed to the ``load`` command when analyzing
+FITS data:
+
+``nan_mask``
+~~~~~~~~~~~~
+
 FITS image data may include ``NaNs``. If you wish to mask this data out,
-you may supply a ``nan_mask`` parameter to ``load``, which may either be a
+you may supply a ``nan_mask`` parameter, which may either be a
 single floating-point number (applies to all fields) or a Python dictionary
 containing different mask values for different fields:
 
@@ -689,9 +695,27 @@
    # passing a dict
    ds = load("m33_hi.fits", nan_mask={"intensity":-1.0,"temperature":0.0})
 
+``suppress_astropy_warnings``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 Generally, AstroPy may generate a lot of warnings about individual FITS
 files, many of which you may want to ignore. If you want to see these
-warnings, set ``suppress_astropy_warnings = False`` in the call to ``load``.
+warnings, set ``suppress_astropy_warnings = False``.
+
+``z_axis_decomp``
+~~~~~~~~~~~~~~~~~
+
+For some applications, decomposing 3D FITS data into grids that span the x-y plane with short
+strides along the z-axis may result in a significant improvement in I/O speed. To enable this feature, set ``z_axis_decomp=True``.
+
+``spectral_factor``
+~~~~~~~~~~~~~~~~~~~
+
+Often, the aspect ratio of 3D spectral cubes can be far from unity. Because yt sets the pixel
+scale as the ``code_length``, certain visualizations (such as volume renderings) may look extended
+or distended in ways that are undesirable. To adjust the width in ``code_length`` of the spectral
+ axis, set ``spectral_factor`` equal to a constant which gives the desired scaling,
+ or set it to ``"auto"`` to make the width the same as the largest axis in the sky plane.
 
 Miscellaneous Tools for Use with FITS Data
 ++++++++++++++++++++++++++++++++++++++++++
@@ -703,7 +727,6 @@
 
   from yt.frontends.fits.misc import setup_counts_fields, PlotWindowWCS, ds9_region
 
-
 ``setup_counts_fields``
 ~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -875,3 +898,4 @@
 Generic Particle Data
 ---------------------
 
+.. notebook:: Loading_Generic_Particle_Data.ipynb

This diff is so big that we needed to truncate the remainder.

https://bitbucket.org/yt_analysis/yt/commits/d65d0795af97/
Changeset:   d65d0795af97
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 00:14:30
Summary:     Updating multi_plot_slice_and_proj.py
Affected #:  1 file

diff -r 7d16cc705a6361cea06ab241d7a3a20555725122 -r d65d0795af972f425472f6f229bf5e52aa9134fd doc/source/cookbook/multi_plot_slice_and_proj.py
--- a/doc/source/cookbook/multi_plot_slice_and_proj.py
+++ b/doc/source/cookbook/multi_plot_slice_and_proj.py
@@ -1,4 +1,4 @@
-from yt.mods import * # set up our namespace
+import yt
 from yt.visualization.base_plot_types import get_multi_plot
 import matplotlib.colorbar as cb
 from matplotlib.colors import LogNorm
@@ -6,7 +6,7 @@
 fn = "GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150" # parameter file to load
 orient = 'horizontal'
 
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 # There's a lot in here:
 #   From this we get a containing figure, a list-of-lists of axes into which we
@@ -17,12 +17,11 @@
 #   bw is the base-width in inches, but 4 is about right for most cases.
 fig, axes, colorbars = get_multi_plot(3, 2, colorbar=orient, bw = 4)
 
-slc = pf.slice(2, 0.0, fields=["density","temperature","velocity_magnitude"], 
-                 center=pf.domain_center)
-proj = pf.proj("density", 2, weight_field="density", center=pf.domain_center)
+slc = yt.SlicePlot(ds, 'z', fields=["density","temperature","velocity_magnitude"])
+proj = yt.ProjectionPlot(ds, 'z', "density", weight_field="density")
 
-slc_frb = slc.to_frb((1.0, "mpc"), 512)
-proj_frb = proj.to_frb((1.0, "mpc"), 512)
+slc_frb = slc.data_source.to_frb((1.0, "mpc"), 512)
+proj_frb = proj.data_source.to_frb((1.0, "mpc"), 512)
 
 dens_axes = [axes[0][0], axes[1][0]]
 temp_axes = [axes[0][1], axes[1][1]]
@@ -66,4 +65,4 @@
     cbar.set_label(t)
 
 # And now we're done! 
-fig.savefig("%s_3x2" % pf)
+fig.savefig("%s_3x2" % ds)


https://bitbucket.org/yt_analysis/yt/commits/a95ba1fd2b92/
Changeset:   a95ba1fd2b92
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 00:22:46
Summary:     Updating multi_width_image.py recipe.
Affected #:  1 file

diff -r d65d0795af972f425472f6f229bf5e52aa9134fd -r a95ba1fd2b92ac74cd686e34dd468f074850459a doc/source/cookbook/multi_width_image.py
--- a/doc/source/cookbook/multi_width_image.py
+++ b/doc/source/cookbook/multi_width_image.py
@@ -1,15 +1,16 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a slice plot for the dataset.  With no additional arguments,
 # the width will be the size of the domain and the center will be the
 # center of the simulation box
-slc = SlicePlot(pf,2,'density')
+slc = yt.SlicePlot(ds, 'z', 'density')
 
-# Create a list of a couple of widths and units.
-widths = [(1, 'mpc'),
+# Create a list of a couple of widths and units. 
+# (N.B. Mpc (megaparsec) != mpc (milliparsec)
+widths = [(1, 'Mpc'),
           (15, 'kpc')]
 
 # Loop through the list of widths and units.
@@ -19,12 +20,12 @@
     slc.set_width(width, unit)
 
     # Write out the image with a unique name.
-    slc.save("%s_%010d_%s" % (pf, width, unit))
+    slc.save("%s_%010d_%s" % (ds, width, unit))
 
 zoomFactors = [2,4,5]
 
 # recreate the original slice
-slc = SlicePlot(pf,2,'density')
+slc = yt.SlicePlot(ds, 'z', 'density')
 
 for zoomFactor in zoomFactors:
 
@@ -32,4 +33,4 @@
     slc.zoom(zoomFactor)
 
     # Write out the image with a unique name.
-    slc.save("%s_%i" % (pf, zoomFactor))
+    slc.save("%s_%i" % (ds, zoomFactor))


https://bitbucket.org/yt_analysis/yt/commits/5e025bcd9a5a/
Changeset:   5e025bcd9a5a
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:06:47
Summary:     Updating multiplot_2x2.py recipe.
Affected #:  1 file

diff -r a95ba1fd2b92ac74cd686e34dd468f074850459a -r 5e025bcd9a5a0f7a65e4bbc181d75fb32091b850 doc/source/cookbook/multiplot_2x2.py
--- a/doc/source/cookbook/multiplot_2x2.py
+++ b/doc/source/cookbook/multiplot_2x2.py
@@ -1,9 +1,9 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 from mpl_toolkits.axes_grid1 import AxesGrid
 
 fn = "IsolatedGalaxy/galaxy0030/galaxy0030"
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 fig = plt.figure()
 
@@ -22,11 +22,16 @@
                 cbar_size="3%",
                 cbar_pad="0%")
 
-fields = ['density', 'velocity_x', 'velocity_y', 'VelocityMagnitude']
+fields = ['density', 'velocity_x', 'velocity_y', 'velocity_magnitude']
 
 # Create the plot.  Since SlicePlot accepts a list of fields, we need only
 # do this once.
-p = SlicePlot(pf, 'z', fields)
+p = yt.SlicePlot(ds, 'z', fields)
+
+# Velocity is going to be both positive and negative, so let's make these
+# slices linear
+p.set_log('velocity_x', False)
+p.set_log('velocity_y', False)
 p.zoom(2)
 
 # For each plotted field, force the SlicePlot to redraw itself onto the AxesGrid


https://bitbucket.org/yt_analysis/yt/commits/5555967a1b71/
Changeset:   5555967a1b71
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:25:29
Summary:     Updating multiplot_2x2_coordaxes_slice recipe.
Affected #:  1 file

diff -r 5e025bcd9a5a0f7a65e4bbc181d75fb32091b850 -r 5555967a1b7118f3d8ecf91757a23bdf2de4a4ea doc/source/cookbook/multiplot_2x2_coordaxes_slice.py
--- a/doc/source/cookbook/multiplot_2x2_coordaxes_slice.py
+++ b/doc/source/cookbook/multiplot_2x2_coordaxes_slice.py
@@ -1,9 +1,9 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 from mpl_toolkits.axes_grid1 import AxesGrid
 
 fn = "IsolatedGalaxy/galaxy0030/galaxy0030"
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 fig = plt.figure()
 
@@ -27,7 +27,7 @@
 
 for i, (direction, field) in enumerate(zip(cuts, fields)):
     # Load the data and create a single plot
-    p = SlicePlot(pf, direction, field)
+    p = yt.SlicePlot(ds, direction, field)
     p.zoom(40)
 
     # This forces the ProjectionPlot to redraw itself on the AxesGrid axes.


https://bitbucket.org/yt_analysis/yt/commits/d5c61735d5b6/
Changeset:   d5c61735d5b6
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:28:38
Summary:     Updating multiplot_2x2_time_series recipe.
Affected #:  1 file

diff -r 5555967a1b7118f3d8ecf91757a23bdf2de4a4ea -r d5c61735d5b6696badabddbec6a536eb7b38c9a7 doc/source/cookbook/multiplot_2x2_time_series.py
--- a/doc/source/cookbook/multiplot_2x2_time_series.py
+++ b/doc/source/cookbook/multiplot_2x2_time_series.py
@@ -1,4 +1,4 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 from mpl_toolkits.axes_grid1 import AxesGrid
 
@@ -23,8 +23,8 @@
 
 for i, fn in enumerate(fns):
     # Load the data and create a single plot
-    pf = load(fn) # load data
-    p = ProjectionPlot(pf, 'z', 'density', width=(55, 'Mpccm'))
+    ds = yt.load(fn) # load data
+    p = yt.ProjectionPlot(ds, 'z', 'density', width=(55, 'Mpccm'))
 
     # Ensure the colorbar limits match for all plots
     p.set_zlim('density', 1e-4, 1e-2)


https://bitbucket.org/yt_analysis/yt/commits/21fdb9a9c2a5/
Changeset:   21fdb9a9c2a5
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:31:05
Summary:     Updating offaxis_projection recipe.
Affected #:  1 file

diff -r d5c61735d5b6696badabddbec6a536eb7b38c9a7 -r 21fdb9a9c2a5f0373420d42955ded1736ba0483a doc/source/cookbook/offaxis_projection.py
--- a/doc/source/cookbook/offaxis_projection.py
+++ b/doc/source/cookbook/offaxis_projection.py
@@ -1,7 +1,8 @@
-from yt.mods import *
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Choose a center for the render.
 c = [0.5, 0.5, 0.5]
@@ -25,10 +26,10 @@
 # Create the off axis projection.
 # Setting no_ghost to False speeds up the process, but makes a
 # slighly lower quality image.
-image = off_axis_projection(pf, c, L, W, Npixels, "density", no_ghost=False)
+image = yt.off_axis_projection(ds, c, L, W, Npixels, "density", no_ghost=False)
 
 # Write out the final image and give it a name
 # relating to what our dataset is called.
 # We save the log of the values so that the colors do not span
 # many orders of magnitude.  Try it without and see what happens.
-write_image(np.log10(image), "%s_offaxis_projection.png" % pf)
+yt.write_image(np.log10(image), "%s_offaxis_projection.png" % ds)


https://bitbucket.org/yt_analysis/yt/commits/75db45801b8a/
Changeset:   75db45801b8a
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:33:25
Summary:     Updating offaxis_projection_colorbar recipe.
Affected #:  1 file

diff -r 21fdb9a9c2a5f0373420d42955ded1736ba0483a -r 75db45801b8a05477116a13891abdfd75c34103e doc/source/cookbook/offaxis_projection_colorbar.py
--- a/doc/source/cookbook/offaxis_projection_colorbar.py
+++ b/doc/source/cookbook/offaxis_projection_colorbar.py
@@ -1,8 +1,9 @@
-from yt.mods import * # set up our namespace
+import yt
+import numpy as np
 
 fn = "IsolatedGalaxy/galaxy0030/galaxy0030" # parameter file to load
 
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 # Now we need a center of our volume to render.  Here we'll just use
 # 0.5,0.5,0.5, because volume renderings are not periodic.
@@ -31,9 +32,9 @@
 # Also note that we set the field which we want to project as "density", but
 # really we could use any arbitrary field like "temperature", "metallicity"
 # or whatever.
-image = off_axis_projection(pf, c, L, W, Npixels, "density", no_ghost=False)
+image = yt.off_axis_projection(ds, c, L, W, Npixels, "density", no_ghost=False)
 
 # Image is now an NxN array representing the intensities of the various pixels.
 # And now, we call our direct image saver.  We save the log of the result.
-write_projection(image, "offaxis_projection_colorbar.png", 
-                 colorbar_label="Column Density (cm$^{-2}$)")
+yt.write_projection(image, "offaxis_projection_colorbar.png", 
+                    colorbar_label="Column Density (cm$^{-2}$)")


https://bitbucket.org/yt_analysis/yt/commits/e2aa4973ef49/
Changeset:   e2aa4973ef49
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:42:42
Summary:     Updating opaque_rendering recipe.
Affected #:  1 file

diff -r 75db45801b8a05477116a13891abdfd75c34103e -r e2aa4973ef49a82bbd25b2202b2725f43d36455b doc/source/cookbook/opaque_rendering.py
--- a/doc/source/cookbook/opaque_rendering.py
+++ b/doc/source/cookbook/opaque_rendering.py
@@ -7,14 +7,15 @@
 
 # Here we start by loading up a dataset, in this case galaxy0030.
 
-from yt.mods import *
+import yt
+import numpy as np
 
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # We start by building a transfer function, and initializing a camera.
 
-tf = ColorTransferFunction((-30, -22))
-cam = pf.h.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256, tf)
+tf = yt.ColorTransferFunction((-30, -22))
+cam = ds.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256, tf)
 
 # Now let's add some isocontours, and take a snapshot.
 
@@ -66,5 +67,3 @@
 
 # That looks pretty different, but the main thing is that you can see that the
 # inner contours are somewhat visible again.  
-
-


https://bitbucket.org/yt_analysis/yt/commits/38470fbbd2aa/
Changeset:   38470fbbd2aa
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:44:02
Summary:     Updating overplot_grids recipe.
Affected #:  1 file

diff -r e2aa4973ef49a82bbd25b2202b2725f43d36455b -r 38470fbbd2aac297160a1996a75d9af4260da327 doc/source/cookbook/overplot_grids.py
--- a/doc/source/cookbook/overplot_grids.py
+++ b/doc/source/cookbook/overplot_grids.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Make a density projection.
-p = ProjectionPlot(pf, "y", "density")
+p = yt.ProjectionPlot(ds, "y", "density")
 
 # Modify the projection
 # The argument specifies the region along the line of sight


https://bitbucket.org/yt_analysis/yt/commits/d30cc678dec1/
Changeset:   d30cc678dec1
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 01:46:06
Summary:     Updating overplot_particles recipe.
Affected #:  1 file

diff -r 38470fbbd2aac297160a1996a75d9af4260da327 -r d30cc678dec13c5c1f7a2e0217e538b1c0520058 doc/source/cookbook/overplot_particles.py
--- a/doc/source/cookbook/overplot_particles.py
+++ b/doc/source/cookbook/overplot_particles.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Make a density projection.
-p = ProjectionPlot(pf, "y", "density")
+p = yt.ProjectionPlot(ds, "y", "density")
 
 # Modify the projection
 # The argument specifies the region along the line of sight


https://bitbucket.org/yt_analysis/yt/commits/5cc4ba17e995/
Changeset:   5cc4ba17e995
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 02:34:58
Summary:     Updating rendering_with_box_and_grids recipe.
Affected #:  1 file

diff -r d30cc678dec13c5c1f7a2e0217e538b1c0520058 -r 5cc4ba17e995b260d3a226df98171609e6caf363 doc/source/cookbook/rendering_with_box_and_grids.py
--- a/doc/source/cookbook/rendering_with_box_and_grids.py
+++ b/doc/source/cookbook/rendering_with_box_and_grids.py
@@ -1,18 +1,19 @@
-from yt.mods import *
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Create a data container (like a sphere or region) that
 # represents the entire domain.
-dd = pf.h.all_data()
+ad = ds.all_data()
 
 # Get the minimum and maximum densities.
-mi, ma = dd.quantities["Extrema"]("density")[0]
+mi, ma = ad.quantities.extrema("density")
 
 # Create a transfer function to map field values to colors.
 # We bump up our minimum to cut out some of the background fluid
-tf = ColorTransferFunction((np.log10(mi)+2.0, np.log10(ma)))
+tf = yt.ColorTransferFunction((np.log10(mi)+2.0, np.log10(ma)))
 
 # Add three guassians, evenly spaced between the min and
 # max specified above with widths of 0.02 and using the
@@ -37,25 +38,24 @@
 # Create a camera object.
 # This object creates the images and
 # can be moved and rotated.
-cam = pf.h.camera(c, L, W, Npixels, tf)
+cam = ds.camera(c, L, W, Npixels, tf)
 
 # Create a snapshot.
 # The return value of this function could also be accepted, modified (or saved
 # for later manipulation) and then put written out using write_bitmap.
 # clip_ratio applies a maximum to the function, which is set to that value
 # times the .std() of the array.
-im = cam.snapshot("%s_volume_rendered.png" % pf, clip_ratio=8.0)
+im = cam.snapshot("%s_volume_rendered.png" % ds, clip_ratio=8.0)
 
 # Add the domain edges, with an alpha blending of 0.3:
 nim = cam.draw_domain(im, alpha=0.3)
-nim.write_png('%s_vr_domain.png' % pf)
+nim.write_png('%s_vr_domain.png' % ds)
 
 # Add the grids, colored by the grid level with the algae colormap
 nim = cam.draw_grids(im, alpha=0.3, cmap='algae')
-nim.write_png('%s_vr_grids.png' % pf)
+nim.write_png('%s_vr_grids.png' % ds)
 
 # Here we can draw the coordinate vectors on top of the image by processing
 # it through the camera. Then save it out.
 cam.draw_coordinate_vectors(nim)
-nim.write_png("%s_vr_vectors.png" % pf)
-
+nim.write_png("%s_vr_vectors.png" % ds)


https://bitbucket.org/yt_analysis/yt/commits/d870c67230a0/
Changeset:   d870c67230a0
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 03:33:50
Summary:     Updating show_hid_axes_colorbar recipe.
Affected #:  1 file

diff -r 5cc4ba17e995b260d3a226df98171609e6caf363 -r d870c67230a0d98793541f248eb8f1ca75c90ef1 doc/source/cookbook/show_hide_axes_colorbar.py
--- a/doc/source/cookbook/show_hide_axes_colorbar.py
+++ b/doc/source/cookbook/show_hide_axes_colorbar.py
@@ -1,8 +1,8 @@
-from yt.mods import *
+import yt
 
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
-slc = SlicePlot(pf, "x", "density")
+slc = yt.SlicePlot(ds, "x", "density")
 
 slc.save("default_sliceplot.png")
 


https://bitbucket.org/yt_analysis/yt/commits/c5a77514f8db/
Changeset:   c5a77514f8db
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 03:42:37
Summary:     Updating simple_contour_in_slice recipe.
Affected #:  1 file

diff -r d870c67230a0d98793541f248eb8f1ca75c90ef1 -r c5a77514f8dbd110ac33be23a6c6b8c3ff56ea58 doc/source/cookbook/simple_contour_in_slice.py
--- a/doc/source/cookbook/simple_contour_in_slice.py
+++ b/doc/source/cookbook/simple_contour_in_slice.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the data file.
-pf = load("Sedov_3d/sedov_hdf5_chk_0002")
+ds = yt.load("Sedov_3d/sedov_hdf5_chk_0002")
 
 # Make a traditional slice plot.
-sp = SlicePlot(pf,"x","density")
+sp = yt.SlicePlot(ds, "x", "density")
 
 # Overlay the slice plot with thick red contours of density.
 sp.annotate_contour("density", ncont=3, clim=(1e-2,1e-1), label=True,


https://bitbucket.org/yt_analysis/yt/commits/1a84c5546715/
Changeset:   1a84c5546715
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 03:46:35
Summary:     Updating simple_off_axis_projection recipe.
Affected #:  1 file

diff -r c5a77514f8dbd110ac33be23a6c6b8c3ff56ea58 -r 1a84c5546715e18e07c9c3cf983d59399b31d397 doc/source/cookbook/simple_off_axis_projection.py
--- a/doc/source/cookbook/simple_off_axis_projection.py
+++ b/doc/source/cookbook/simple_off_axis_projection.py
@@ -1,12 +1,12 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a 1 kpc radius sphere, centered on the max density.  Note that this
 # sphere is very small compared to the size of our final plot, and it has a
 # non-axially aligned L vector.
-sp = pf.sphere("center", (15.0, "kpc"))
+sp = ds.sphere("center", (15.0, "kpc"))
 
 # Get the angular momentum vector for the sphere.
 L = sp.quantities["AngularMomentumVector"]()
@@ -14,5 +14,5 @@
 print "Angular momentum vector: {0}".format(L)
 
 # Create an OffAxisSlicePlot on the object with the L vector as its normal
-p = OffAxisProjectionPlot(pf, L, "density", sp.center, (25, "kpc"))
+p = yt.OffAxisProjectionPlot(ds, L, "density", sp.center, (25, "kpc"))
 p.save()


https://bitbucket.org/yt_analysis/yt/commits/856c789e1fc6/
Changeset:   856c789e1fc6
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 03:55:02
Summary:     Updating simple_pdf recipe.
Affected #:  1 file

diff -r 1a84c5546715e18e07c9c3cf983d59399b31d397 -r 856c789e1fc6ec8be669bac21f9461f7e034cdd9 doc/source/cookbook/simple_pdf.py
--- a/doc/source/cookbook/simple_pdf.py
+++ b/doc/source/cookbook/simple_pdf.py
@@ -1,14 +1,14 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Create a data object that represents the whole box.
-ad = pf.h.all_data()
+ad = ds.h.all_data()
 
 # This is identical to the simple phase plot, except we supply 
 # the fractional=True keyword to divide the profile data by the sum. 
-plot = PhasePlot(ad, "density", "temperature", "cell_mass",
+plot = yt.PhasePlot(ad, "density", "temperature", "cell_mass",
                  weight_field=None, fractional=True)
 
 # Set a new title for the colorbar since it is now fractional.


https://bitbucket.org/yt_analysis/yt/commits/cd549dab9722/
Changeset:   cd549dab9722
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:00:04
Summary:     Updating simple_phase recipe.
Affected #:  1 file

diff -r 856c789e1fc6ec8be669bac21f9461f7e034cdd9 -r cd549dab9722a1ae906584a70f112a5cafb701eb doc/source/cookbook/simple_phase.py
--- a/doc/source/cookbook/simple_phase.py
+++ b/doc/source/cookbook/simple_phase.py
@@ -1,16 +1,16 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a sphere of radius 100 kpc in the center of the domain.
-my_sphere = pf.sphere("c", (100.0, "kpc"))
+my_sphere = ds.sphere("c", (100.0, "kpc"))
 
 # Create a PhasePlot object.
 # Setting weight to None will calculate a sum.
 # Setting weight to a field will calculate an average
 # weighted by that field.
-plot = PhasePlot(my_sphere, "density", "temperature", "cell_mass",
+plot = yt.PhasePlot(my_sphere, "density", "temperature", "cell_mass",
                  weight_field=None)
 
 # Save the image.


https://bitbucket.org/yt_analysis/yt/commits/8bec365f2ae0/
Changeset:   8bec365f2ae0
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:05:21
Summary:     Updating simple_profile recipe.
Affected #:  1 file

diff -r cd549dab9722a1ae906584a70f112a5cafb701eb -r 8bec365f2ae0d4166939705a1eb194a2fe60aba6 doc/source/cookbook/simple_profile.py
--- a/doc/source/cookbook/simple_profile.py
+++ b/doc/source/cookbook/simple_profile.py
@@ -1,14 +1,14 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a 1D profile within a sphere of radius 100 kpc
 # of the average temperature and average velocity_x 
 # vs. density, weighted by mass.
-sphere = pf.sphere("c", (100., "kpc"))
-plot = ProfilePlot(sphere, "density", ["temperature", "velocity_x"],
-                   weight_field="cell_mass")
+sphere = ds.sphere("c", (100., "kpc"))
+plot = yt.ProfilePlot(sphere, "density", ["temperature", "velocity_x"],
+                      weight_field="cell_mass")
 
 # Save the image.
 # Optionally, give a string as an argument


https://bitbucket.org/yt_analysis/yt/commits/5c6fc2f93ad1/
Changeset:   5c6fc2f93ad1
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:06:08
Summary:     Updating simple_pdf recipe to use Flash dataset.
Affected #:  1 file

diff -r 8bec365f2ae0d4166939705a1eb194a2fe60aba6 -r 5c6fc2f93ad1320bd69629256dbbd0d9c93ddcfa doc/source/cookbook/simple_pdf.py
--- a/doc/source/cookbook/simple_pdf.py
+++ b/doc/source/cookbook/simple_pdf.py
@@ -1,7 +1,7 @@
 import yt
 
 # Load the dataset.
-ds = yt.load("Enzo_64/DD0043/data0043")
+ds = yt.load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
 
 # Create a data object that represents the whole box.
 ad = ds.h.all_data()


https://bitbucket.org/yt_analysis/yt/commits/f64eb3244f5a/
Changeset:   f64eb3244f5a
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:07:31
Summary:     Updating simple_projection recipe.
Affected #:  1 file

diff -r 5c6fc2f93ad1320bd69629256dbbd0d9c93ddcfa -r f64eb3244f5a2747088d698017ec7d2356ab1405 doc/source/cookbook/simple_projection.py
--- a/doc/source/cookbook/simple_projection.py
+++ b/doc/source/cookbook/simple_projection.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
+ds = yt.load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
 
 # Create projections of the density-weighted mean density.
 
-ProjectionPlot(pf, "x", "density", weight_field = "density").save()
-ProjectionPlot(pf, "y", "density", weight_field = "density").save()
-ProjectionPlot(pf, "z", "density", weight_field = "density").save()
+yt.ProjectionPlot(ds, "x", "density", weight_field = "density").save()
+yt.ProjectionPlot(ds, "y", "density", weight_field = "density").save()
+yt.ProjectionPlot(ds, "z", "density", weight_field = "density").save()


https://bitbucket.org/yt_analysis/yt/commits/be344c1fb735/
Changeset:   be344c1fb735
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:23:12
Summary:     Updating simple_radial_profile recipe.
Affected #:  1 file

diff -r f64eb3244f5a2747088d698017ec7d2356ab1405 -r be344c1fb735ea3cb8347aedfa7cbf80cc214ee1 doc/source/cookbook/simple_radial_profile.py
--- a/doc/source/cookbook/simple_radial_profile.py
+++ b/doc/source/cookbook/simple_radial_profile.py
@@ -1,14 +1,17 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a sphere of radius 100 kpc in the center of the box.
-my_sphere = pf.sphere("c", (100.0, "kpc"))
+my_sphere = ds.sphere("c", (100.0, "kpc"))
 
 # Create a profile of the average density vs. radius.
-plot = ProfilePlot(my_sphere, "Radiuskpc", "density",
-                   weight_field="cell_mass")
+plot = yt.ProfilePlot(my_sphere, "radius", "density",
+                      weight_field="cell_mass")
+
+# Change the units of the radius into kpc (and not the default in cgs)
+plot.set_unit('radius', 'kpc')
 
 # Save the image.
 # Optionally, give a string as an argument


https://bitbucket.org/yt_analysis/yt/commits/577b45ef016d/
Changeset:   577b45ef016d
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:25:05
Summary:     Updating simple_phase recipe to set the mass units correctly.
Affected #:  1 file

diff -r be344c1fb735ea3cb8347aedfa7cbf80cc214ee1 -r 577b45ef016d171a75071c80c59a404939abe69e doc/source/cookbook/simple_phase.py
--- a/doc/source/cookbook/simple_phase.py
+++ b/doc/source/cookbook/simple_phase.py
@@ -13,6 +13,9 @@
 plot = yt.PhasePlot(my_sphere, "density", "temperature", "cell_mass",
                  weight_field=None)
 
+# Set the units of mass to be in solar masses (not the default in cgs)
+plot.set_unit('cell_mass', 'Msun')
+
 # Save the image.
 # Optionally, give a string as an argument
 # to name files with a keyword.


https://bitbucket.org/yt_analysis/yt/commits/7d4171bc485d/
Changeset:   7d4171bc485d
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:28:10
Summary:     Updating simple_slice recipe.
Affected #:  1 file

diff -r 577b45ef016d171a75071c80c59a404939abe69e -r 7d4171bc485de77edcc6cfab5b9b8d49583477c2 doc/source/cookbook/simple_slice.py
--- a/doc/source/cookbook/simple_slice.py
+++ b/doc/source/cookbook/simple_slice.py
@@ -1,9 +1,9 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Create density slices in all three axes.
-SlicePlot(pf, 'x', "density", width = (800.0, 'kpc')).save()
-SlicePlot(pf, 'y', "density", width = (800.0, 'kpc')).save()
-SlicePlot(pf, 'z', "density", width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'x', "density", width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'y', "density", width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'z', "density", width = (800.0, 'kpc')).save()


https://bitbucket.org/yt_analysis/yt/commits/8c365d0bc724/
Changeset:   8c365d0bc724
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:36:40
Summary:     Updating simple_slice_matplotlib_example recipe.
Affected #:  1 file

diff -r 7d4171bc485de77edcc6cfab5b9b8d49583477c2 -r 8c365d0bc7244c0374287c0905b2ddd27b0e6c0f doc/source/cookbook/simple_slice_matplotlib_example.py
--- a/doc/source/cookbook/simple_slice_matplotlib_example.py
+++ b/doc/source/cookbook/simple_slice_matplotlib_example.py
@@ -1,10 +1,11 @@
-from yt.mods import *
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Create a slice object
-slc = SlicePlot(pf,'x','density',width=(800.0,'kpc'))
+slc = yt.SlicePlot(ds,'x','density',width=(800.0,'kpc'))
 
 # Get a reference to the matplotlib axes object for the plot
 ax = slc.plots['density'].axes
@@ -12,17 +13,23 @@
 # Let's adjust the x axis tick labels
 for label in ax.xaxis.get_ticklabels():
     label.set_color('red')
-    label.set_rotation(45)
     label.set_fontsize(16)
 
 # Get a reference to the matplotlib figure object for the plot
 fig = slc.plots['density'].figure
 
+# And create a mini-panel of a gaussian histogram inside the plot
 rect = (0.2,0.2,0.2,0.2)
 new_ax = fig.add_axes(rect)
 
 n, bins, patches = new_ax.hist(np.random.randn(1000)+20, 50,
-    facecolor='yellow', edgecolor='yellow')
-new_ax.set_xlabel('Dinosaurs per furlong')
+    facecolor='black', edgecolor='black')
+
+# Make sure its visible
+new_ax.tick_params(colors='white')
+
+# And label it
+la = new_ax.set_xlabel('Dinosaurs per furlong')
+la.set_color('white')
 
 slc.save()


https://bitbucket.org/yt_analysis/yt/commits/83721f87c057/
Changeset:   83721f87c057
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 04:40:14
Summary:     Updating simple_slice_with_multiple_fields recipe.
Affected #:  1 file

diff -r 8c365d0bc7244c0374287c0905b2ddd27b0e6c0f -r 83721f87c057273fc495f7460c9650adabaa90fb doc/source/cookbook/simple_slice_with_multiple_fields.py
--- a/doc/source/cookbook/simple_slice_with_multiple_fields.py
+++ b/doc/source/cookbook/simple_slice_with_multiple_fields.py
@@ -1,8 +1,8 @@
-from yt.mods import *
+import yt
 
 # Load the dataset
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Create density slices of several fields along the x axis
-SlicePlot(pf, 'x', ['density','temperature','pressure','vorticity_squared'], 
-          width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'x', ['density','temperature','pressure','vorticity_squared'], 
+             width = (800.0, 'kpc')).save()


https://bitbucket.org/yt_analysis/yt/commits/73514c6058f7/
Changeset:   73514c6058f7
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 14:00:46
Summary:     Updating simple_volume_rendering recipe.
Affected #:  1 file

diff -r 83721f87c057273fc495f7460c9650adabaa90fb -r 73514c6058f74484b51abe4bc922771046da52c6 doc/source/cookbook/simple_volume_rendering.py
--- a/doc/source/cookbook/simple_volume_rendering.py
+++ b/doc/source/cookbook/simple_volume_rendering.py
@@ -1,18 +1,19 @@
-from yt.mods import *
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Create a data container (like a sphere or region) that
 # represents the entire domain.
-dd = pf.h.all_data()
+ad = ds.h.all_data()
 
 # Get the minimum and maximum densities.
-mi, ma = dd.quantities["Extrema"]("density")[0]
+mi, ma = ad.quantities.extrema("density")
 
 # Create a transfer function to map field values to colors.
 # We bump up our minimum to cut out some of the background fluid
-tf = ColorTransferFunction((np.log10(mi)+1, np.log10(ma)))
+tf = yt.ColorTransferFunction((np.log10(mi)+1, np.log10(ma)))
 
 # Add three guassians, evenly spaced between the min and
 # max specified above with widths of 0.02 and using the
@@ -37,11 +38,11 @@
 # Create a camera object.
 # This object creates the images and
 # can be moved and rotated.
-cam = pf.h.camera(c, L, W, Npixels, tf)
+cam = ds.camera(c, L, W, Npixels, tf)
 
 # Create a snapshot.
 # The return value of this function could also be accepted, modified (or saved
 # for later manipulation) and then put written out using write_bitmap.
 # clip_ratio applies a maximum to the function, which is set to that value
 # times the .std() of the array.
-cam.snapshot("%s_volume_rendered.png" % pf, clip_ratio=8.0)
+cam.snapshot("%s_volume_rendered.png" % ds, clip_ratio=8.0)


https://bitbucket.org/yt_analysis/yt/commits/03bc9671bf9e/
Changeset:   03bc9671bf9e
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 14:39:57
Summary:     Updating simulation_analysis recipe.
Affected #:  1 file

diff -r 73514c6058f74484b51abe4bc922771046da52c6 -r 03bc9671bf9ee40156713403e9b442228650522f doc/source/cookbook/simulation_analysis.py
--- a/doc/source/cookbook/simulation_analysis.py
+++ b/doc/source/cookbook/simulation_analysis.py
@@ -1,20 +1,28 @@
-from yt.mods import *
+import yt
+import collections
 
 # Instantiate a time series object for an Enzo simulation..
-my_sim = simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo')
+sim = yt.simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo')
 
 # Get a time series for all data made by the simulation.
-my_sim.get_time_series()
+sim.get_time_series()
 
-# Calculate and store extrema for all datasets.
-all_storage = {}
-for my_storage, pf in my_sim.piter(storage=all_storage):
-    all_data = pf.h.all_data()
-    my_extrema = all_data.quantities['Extrema']('density')
+# Calculate and store extrema for all datasets along with redshift
+# in a data dictionary with entries as tuples
 
-    # Save to storage so we can get at it afterward.
-    my_storage.result = my_extrema
+# Note that by using sim.piter(), we are automatically 
+# forcing yt to do this in parallel
+data = {}
+for ds in sim.piter():
+    ad = ds.all_data()
+    extrema = ad.quantities.extrema('density')
+    data[ds.basename] = (extrema, ds.current_redshift)
+
+# Convert dictionary to ordered dictionary to get the right order
+od = collections.OrderedDict(sorted(data.items()))
 
 # Print out all the values we calculated.
-for my_result in all_storage.values():
-    print my_result
+print "Dataset      Redshift        Density Min      Density Max"
+print "---------------------------------------------------------"
+for k, v in od.iteritems(): 
+    print "%s       %05.3f          %5.3g g/cm^3   %5.3g g/cm^3" % (k, v[1], v[0][0], v[0][1])


https://bitbucket.org/yt_analysis/yt/commits/805bc10f466c/
Changeset:   805bc10f466c
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 15:27:23
Summary:     Updating the streamlines recipe.
Affected #:  1 file

diff -r 03bc9671bf9ee40156713403e9b442228650522f -r 805bc10f466c64e3fca6a150514729403517b9a0 doc/source/cookbook/streamlines.py
--- a/doc/source/cookbook/streamlines.py
+++ b/doc/source/cookbook/streamlines.py
@@ -1,22 +1,40 @@
-from yt.mods import *
+import yt
+import numpy as np
 from yt.visualization.api import Streamlines
+import matplotlib.pylab as pl
+from mpl_toolkits.mplot3d import Axes3D
 
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+# Load the dataset 
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# Define c: the center of the box, N: the number of streamlines, 
+# scale: the spatial scale of the streamlines relative to the boxsize,
+# and then pos: the random positions of the streamlines.
 c = np.array([0.5]*3)
 N = 100
 scale = 1.0
 pos_dx = np.random.random((N,3))*scale-scale/2.
 pos = c+pos_dx
 
-streamlines = Streamlines(pf,pos,'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
+# Create the streamlines from these positions with the velocity fields as the 
+# fields to be traced
+streamlines = Streamlines(ds, pos, 'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
 streamlines.integrate_through_volume()
 
-import matplotlib.pylab as pl
-from mpl_toolkits.mplot3d import Axes3D
-fig=pl.figure() 
+# Create a 3D matplotlib figure for visualizing the streamlines
+fig = pl.figure() 
 ax = Axes3D(fig)
+
+# Trace the streamlines through the volume of the 3D figure
 for stream in streamlines.streamlines:
-    stream = stream[np.all(stream != 0.0, axis=1)]
-    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.1)
+    stream = stream[ np.all(stream != 0.0, axis=1)]
+
+    # Make the colors of each stream vary continuously from blue to red
+    # from low-x to high-x of the stream start position (each color is R, G, B)
+    color = (stream[0,0], 0, 1-stream[0,0])
+
+    # Plot the stream in 3D
+    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.3, color=color)
+
+# Save the figure
 pl.savefig('streamlines.png')
-


https://bitbucket.org/yt_analysis/yt/commits/3faf1386e0f1/
Changeset:   3faf1386e0f1
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 18:47:19
Summary:     Correcting streamlines recipe to use units.
Affected #:  1 file

diff -r 805bc10f466c64e3fca6a150514729403517b9a0 -r 3faf1386e0f1369fd168264f08e5785e2148b7ef doc/source/cookbook/streamlines.py
--- a/doc/source/cookbook/streamlines.py
+++ b/doc/source/cookbook/streamlines.py
@@ -10,9 +10,9 @@
 # Define c: the center of the box, N: the number of streamlines, 
 # scale: the spatial scale of the streamlines relative to the boxsize,
 # and then pos: the random positions of the streamlines.
-c = np.array([0.5]*3)
+c = ds.arr([0.5]*3, 'code_length')
 N = 100
-scale = 1.0
+scale = ds.arr(1.0, 'code_length')
 pos_dx = np.random.random((N,3))*scale-scale/2.
 pos = c+pos_dx
 


https://bitbucket.org/yt_analysis/yt/commits/a5266fc4da0f/
Changeset:   a5266fc4da0f
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 19:36:34
Summary:     Updating surface_plot recipe.
Affected #:  1 file

diff -r 3faf1386e0f1369fd168264f08e5785e2148b7ef -r a5266fc4da0f14b80ff13859df1f030aec0ee364 doc/source/cookbook/surface_plot.py
--- a/doc/source/cookbook/surface_plot.py
+++ b/doc/source/cookbook/surface_plot.py
@@ -1,20 +1,32 @@
+import yt
+import numpy as np
 from mpl_toolkits.mplot3d import Axes3D
 from mpl_toolkits.mplot3d.art3d import Poly3DCollection
 import matplotlib.pyplot as plt
-from yt.mods import *
 
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-sphere = pf.sphere("max", (1.0, "mpc"))
-surface = pf.surface(sphere, "density", 1e-25)
-colors = apply_colormap(np.log10(surface["temperature"]), cmap_name="hot")
+# Load the dataset
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
+# Create a sphere object centered on the highest density point in the simulation
+# with radius 1 Mpc
+sphere = ds.sphere("max", (1.0, "Mpc"))
+
+# Identify the isodensity surface in this sphere with density = 1e-24 g/cm^3
+surface = ds.surface(sphere, "density", 1e-24)
+
+# Color this isodensity surface according to the log of the temperature field
+colors = yt.apply_colormap(np.log10(surface["temperature"]), cmap_name="hot")
+
+# Create a 3D matplotlib figure for visualizing the surface
 fig = plt.figure()
 ax = fig.gca(projection='3d')
 p3dc = Poly3DCollection(surface.triangles, linewidth=0.0)
 
+# Set the surface colors in the right scaling [0,1]
 p3dc.set_facecolors(colors[0,:,:]/255.)
 ax.add_collection(p3dc)
 ax.auto_scale_xyz(surface.vertices[0,:], surface.vertices[1,:], surface.vertices[2,:])
 ax.set_aspect(1.0)
 
-plt.savefig("%s_Surface.png" % pf)
+# Save the figure
+plt.savefig("%s_Surface.png" % ds)


https://bitbucket.org/yt_analysis/yt/commits/831935dda033/
Changeset:   831935dda033
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 19:45:30
Summary:     Updating sum_mass_in_sphere recipe.
Affected #:  1 file

diff -r a5266fc4da0f14b80ff13859df1f030aec0ee364 -r 831935dda033267a6eb22705dc142a79de174045 doc/source/cookbook/sum_mass_in_sphere.py
--- a/doc/source/cookbook/sum_mass_in_sphere.py
+++ b/doc/source/cookbook/sum_mass_in_sphere.py
@@ -1,16 +1,16 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("Enzo_64/DD0029/data0029")
+ds = yt.load("Enzo_64/DD0029/data0029")
 
 # Create a 1 Mpc radius sphere, centered on the max density.
-sp = pf.sphere("max", (1.0, "mpc"))
+sp = ds.sphere("max", (1.0, "Mpc"))
 
-# Use the TotalQuantity derived quantity to sum up the
+# Use the total_quantity derived quantity to sum up the
 # values of the cell_mass and particle_mass fields
 # within the sphere.
-baryon_mass, particle_mass = sp.quantities["TotalQuantity"](
-        ["cell_mass", "particle_mass"])
+baryon_mass, particle_mass = sp.quantities.total_quantity(["cell_mass", "particle_mass"])
 
-print "Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % \
-            (baryon_mass + particle_mass, baryon_mass, particle_mass)
+print "Total mass in sphere is %0.3e Msun (gas = %0.3e Msun, particles = %0.3e Msun)" % \
+      ((baryon_mass + particle_mass).in_units('Msun'), \
+       baryon_mass.in_units('Msun'), particle_mass.in_units('Msun'))


https://bitbucket.org/yt_analysis/yt/commits/1ae487ee66f2/
Changeset:   1ae487ee66f2
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 19:48:14
Summary:     Updating thin_slice_projection.py
Affected #:  1 file

diff -r 831935dda033267a6eb22705dc142a79de174045 -r 1ae487ee66f22c7e8704f23da36550a003259d74 doc/source/cookbook/thin_slice_projection.py
--- a/doc/source/cookbook/thin_slice_projection.py
+++ b/doc/source/cookbook/thin_slice_projection.py
@@ -1,7 +1,7 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("Enzo_64/DD0030/data0030")
+ds = yt.load("Enzo_64/DD0030/data0030")
 
 # Make a projection that is the full width of the domain, 
 # but only 10 Mpc in depth.  This is done by creating a 
@@ -9,24 +9,25 @@
 # as a data_source for the projection.
 
 # Center on the domain center
-center = pf.domain_center
+center = ds.domain_center
 
 # First make the left and right corner of the region based 
 # on the full domain.
-left_corner = pf.domain_left_edge
-right_corner = pf.domain_right_edge
+left_corner = ds.domain_left_edge
+right_corner = ds.domain_right_edge
 
 # Now adjust the size of the region along the line of sight (x axis).
-depth = pf.quan(10.0,'Mpc') 
+depth = ds.quan(10.0,'Mpc') 
 left_corner[0] = center[0] - 0.5 * depth 
 left_corner[0] = center[0] + 0.5 * depth 
+
 # Create the region
-region = pf.region(center, left_corner, right_corner)
+region = ds.region(center, left_corner, right_corner)
 
 # Create a density projection and supply the region we have just created.
 # Only cells within the region will be included in the projection.
 # Try with another data container, like a sphere or disk.
-plot = ProjectionPlot(pf, "x", "density", weight_field="density", 
+plot = yt.ProjectionPlot(ds, "x", "density", weight_field="density", 
                       data_source=region)
 
 # Save the image with the keyword.


https://bitbucket.org/yt_analysis/yt/commits/67045242b073/
Changeset:   67045242b073
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 20:29:50
Summary:     Updated time_series recipe.
Affected #:  1 file

diff -r 1ae487ee66f22c7e8704f23da36550a003259d74 -r 67045242b07381571ab3b788580ee678f01eb45c doc/source/cookbook/time_series.py
--- a/doc/source/cookbook/time_series.py
+++ b/doc/source/cookbook/time_series.py
@@ -1,33 +1,26 @@
-from yt.mods import *
+import yt
 import glob
 import matplotlib.pyplot as plt
 
-keV = 1.16044e7
-mue = 1.0/0.875
-m_p = 1.673e-24
-mtt = -2./3.
-
 # Glob for a list of filenames, then sort them
-fns = glob.glob("GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0[0-6][0-9]0")
+fns = glob.glob("GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*")
 fns.sort()
 
 # Construct the time series object
-
-ts = DatasetSeries.from_filenames(fns)
+ts = yt.DatasetSeries.from_filenames(fns)
 
 storage = {}
 
 # We use the piter() method here so that this can be run in parallel.
 # Alternately, you could just iterate "for pf in ts:" and directly append to
 # times and entrs.
-for sto, pf in ts.piter(storage=storage):
-    sphere = pf.sphere("c", (100., "kpc"))
-    temp = sphere["temperature"]/keV
-    dens = sphere["density"]/(m_p*mue)
-    mgas = sphere["cell_mass"]
-    entr = (temp*(dens**mtt)*mgas).sum()/mgas.sum() 
-    sto.result = (pf.current_time, entr)
+for sto, ds in ts.piter(storage=storage):
+    sphere = ds.sphere("c", (100., "kpc"))
+    entr = sphere["entropy"].sum()
+    sto.result = (ds.current_time.in_units('Gyr'), entr)
 
+
+# Store these values in a couple of lists
 times = []
 entrs = []
 for k in storage:
@@ -35,8 +28,10 @@
     times.append(t)
     entrs.append(e)
 
-if is_root():
-    plt.semilogy(times, entrs, 'x-')
-    plt.xlabel("Time")
-    plt.ylabel("Entropy")
-    plt.savefig("time_versus_entropy.png")
+
+# Plot up the results
+
+plt.semilogy(times, entrs, '-')
+plt.xlabel("Time (Gyr)")
+plt.ylabel("Entropy (ergs/K)")
+plt.savefig("time_versus_entropy.png")


https://bitbucket.org/yt_analysis/yt/commits/89ce5b6f4b49/
Changeset:   89ce5b6f4b49
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 20:49:48
Summary:     Updated time_series_profiles recipe.
Affected #:  1 file

diff -r 67045242b07381571ab3b788580ee678f01eb45c -r 89ce5b6f4b490199691924eb2119f293d7d25021 doc/source/cookbook/time_series_profiles.py
--- a/doc/source/cookbook/time_series_profiles.py
+++ b/doc/source/cookbook/time_series_profiles.py
@@ -1,8 +1,8 @@
-from yt.mods import *
+import yt
 
 # Create a time-series object.
-es = simulation("enzo_tiny_cosmology/32Mpc_32.enzo", "Enzo")
-es.get_time_series(redshifts=[5, 4, 3, 2, 1, 0])
+sim = yt.simulation("enzo_tiny_cosmology/32Mpc_32.enzo", "Enzo")
+sim.get_time_series(redshifts=[5, 4, 3, 2, 1, 0])
 
 # Lists to hold profiles, labels, and plot specifications.
 profiles = []
@@ -10,18 +10,18 @@
 plot_specs = []
 
 # Loop over each dataset in the time-series.
-for pf in es:
+for ds in sim:
     # Create a data container to hold the whole dataset.
-    ad = pf.h.all_data()
+    ad = ds.all_data()
     # Create a 1d profile of density vs. temperature.
-    profiles.append(create_profile(ad, ["density"], 
+    profiles.append(yt.create_profile(ad, ["density"], 
                                    fields=["temperature"]))
     # Add labels and linestyles.
-    labels.append("z = %.2f" % pf.current_redshift)
+    labels.append("z = %.2f" % ds.current_redshift)
     plot_specs.append(dict(linewidth=2, alpha=0.7))
 
 # Create the profile plot from the list of profiles.
-plot = ProfilePlot.from_profiles(profiles, labels=labels,
+plot = yt.ProfilePlot.from_profiles(profiles, labels=labels,
                                  plot_specs=plot_specs)
 # Save the image.
 plot.save()


https://bitbucket.org/yt_analysis/yt/commits/6ecb928966ab/
Changeset:   6ecb928966ab
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 21:19:56
Summary:     Updated save_profiles recipe.
Affected #:  1 file

diff -r 89ce5b6f4b490199691924eb2119f293d7d25021 -r 6ecb928966ab21d5eee00f2087386895fcd6d0ac doc/source/cookbook/save_profiles.py
--- a/doc/source/cookbook/save_profiles.py
+++ b/doc/source/cookbook/save_profiles.py
@@ -1,28 +1,28 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
-import h5py
+import h5py as h5
 
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Get a sphere
 
-sp = pf.sphere(pf.domain_center, (500., "kpc"))
+sp = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Radial profile from the sphere
 
-rad_profile = BinnedProfile1D(sp, 100, "Radiuskpc", 0.0, 500., log_space=False)
-
-# Adding density and temperature fields to the profile
-
-rad_profile.add_fields(["density","temperature"])
+prof = yt.BinnedProfile1D(sp, 100, "Radiuskpc", 0.0, 500., log_space=False)
+prof = yt.ProfilePlot(sp, 'radius', ['density', 'temperature'], weight_field="cell_mass")
+prof.set_unit('radius', 'kpc')
+prof.set_log('radius', False)
+prof.set_xlim(0, 500)
 
 # Write profiles to ASCII file
 
-rad_profile.write_out("%s_profile.dat" % pf, bin_style="center")
+prof.write_out("%s_profile.dat" % ds, bin_style="center")
 
 # Write profiles to HDF5 file
 
-rad_profile.write_out_h5("%s_profile.h5" % pf, bin_style="center")
+prof.write_out_h5("%s_profile.h5" % ds, bin_style="center")
 
 # Now we will show how using NumPy, h5py, and Matplotlib the data in these
 # files may be plotted.
@@ -42,13 +42,13 @@
 ax.set_xlabel(r"$\mathrm{r\ (kpc)}$")
 ax.set_ylabel(r"$\mathrm{\rho\ (g\ cm^{-3})}$")
 ax.set_title("Density vs. Radius")
-fig1.savefig("%s_dens.png" % pf)
+fig1.savefig("%s_dens.png" % ds)
 
 # Plot temperature from HDF5 file
 
 # Get the file handle
 
-f = h5py.File("%s_profile.h5" % pf, "r")
+f = h5py.File("%s_profile.h5" % ds, "r")
 
 # Get the radius and temperature arrays from the file handle
 
@@ -66,4 +66,4 @@
 ax.set_xlabel(r"$\mathrm{r\ (kpc)}$")
 ax.set_ylabel(r"$\mathrm{T\ (K)}$")
 ax.set_title("temperature vs. Radius")
-fig2.savefig("%s_temp.png" % pf)
+fig2.savefig("%s_temp.png" % ds)


https://bitbucket.org/yt_analysis/yt/commits/832ebe9eed25/
Changeset:   832ebe9eed25
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 21:29:40
Summary:     Updating unique_light_cone_projections recipe.
Affected #:  1 file

diff -r 6ecb928966ab21d5eee00f2087386895fcd6d0ac -r 832ebe9eed25dbaa487384dedde9a253027d7255 doc/source/cookbook/unique_light_cone_projections.py
--- a/doc/source/cookbook/unique_light_cone_projections.py
+++ b/doc/source/cookbook/unique_light_cone_projections.py
@@ -1,5 +1,5 @@
-from yt.mods import *
-from yt.analysis_modules.cosmological_observation.light_cone.api import *
+import yt
+from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone
 
 # Instantiate a light cone.
 lc = LightCone("enzo_tiny_cosmology/32Mpc_32.enzo", 'Enzo', 0, 0.1,
@@ -15,9 +15,9 @@
 # The recycle=True setting tells the code to first attempt
 # to use solutions with the same projection axes as other
 # solutions.  This will save time when making the projection.
-find_unique_solutions(lc, max_overlap=0.10, failures=50,
-                      seed=123456789, recycle=True,
-                      solutions=10, filename='LC_U/unique.dat')
+yt.find_unique_solutions(lc, max_overlap=0.10, failures=50,
+                         seed=123456789, recycle=True,
+                         solutions=10, filename='LC_U/unique.dat')
 
 # Choose the field to be projected.
 field = 'SZY'
@@ -25,7 +25,7 @@
 # Make light cone projections with each of the random seeds
 # found above.  All output files will be written with unique
 # names based on the random seed numbers.
-project_unique_light_cones(lc, 'LC_U/unique.dat', field,
-                           save_stack=False,
-                           save_final_image=True,
-                           save_slice_images=False)
+yt.project_unique_light_cones(lc, 'LC_U/unique.dat', field,
+                              save_stack=False,
+                              save_final_image=True,
+                              save_slice_images=False)


https://bitbucket.org/yt_analysis/yt/commits/9e3a89a81698/
Changeset:   9e3a89a81698
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 21:35:17
Summary:     Updated velocity_vectors_on_slice recipe.
Affected #:  1 file

diff -r 832ebe9eed25dbaa487384dedde9a253027d7255 -r 9e3a89a816989940f6865311a7091d5b5700ddaf doc/source/cookbook/velocity_vectors_on_slice.py
--- a/doc/source/cookbook/velocity_vectors_on_slice.py
+++ b/doc/source/cookbook/velocity_vectors_on_slice.py
@@ -1,9 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
-p = SlicePlot(pf, "x", "density")
+p = yt.SlicePlot(ds, "x", "density")
+
 # Draw a velocity vector every 16 pixels.
 p.annotate_velocity(factor = 16)
 p.save()


https://bitbucket.org/yt_analysis/yt/commits/4b0ab3c014b4/
Changeset:   4b0ab3c014b4
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 21:39:31
Summary:     Updated zoomin_frames recipe.
Affected #:  1 file

diff -r 9e3a89a816989940f6865311a7091d5b5700ddaf -r 4b0ab3c014b4d4e840e294b893088dad59ee41ed doc/source/cookbook/zoomin_frames.py
--- a/doc/source/cookbook/zoomin_frames.py
+++ b/doc/source/cookbook/zoomin_frames.py
@@ -1,16 +1,21 @@
-from yt.mods import * # set up our namespace
+import yt
+import numpy as np
 
-fn = "IsolatedGalaxy/galaxy0030/galaxy0030" # parameter file to load
-n_frames = 5  # This is the number of frames to make -- below, you can see how
-              # this is used.
-min_dx = 40   # This is the minimum size in smallest_dx of our last frame.
-              # Usually it should be set to something like 400, but for THIS
-              # dataset, we actually don't have that great of resolution.:w
+# load data
+fn = "IsolatedGalaxy/galaxy0030/galaxy0030" 
+ds = yt.load(fn) 
 
-pf = load(fn) # load data
+# This is the number of frames to make -- below, you can see how this is used.
+n_frames = 5  
+
+# This is the minimum size in smallest_dx of our last frame.
+# Usually it should be set to something like 400, but for THIS
+# dataset, we actually don't have that great of resolution.
+min_dx = 40   
+
 frame_template = "frame_%05i" # Template for frame filenames
 
-p = SlicePlot(pf, "z", "density") # Add our slice, along z
+p = yt.SlicePlot(ds, "z", "density") # Add our slice, along z
 p.annotate_contour("temperature") # We'll contour in temperature
 
 # What we do now is a bit fun.  "enumerate" returns a tuple for every item --
@@ -19,9 +24,11 @@
 # argument to enumerate is the 'logspace' function, which takes a minimum and a
 # maximum and the number of items to generate.  It returns 10^power of each
 # item it generates.
-for i,v in enumerate(np.logspace(
-            0, np.log10(pf.index.get_smallest_dx()*min_dx), n_frames)):
-    # We set our width as necessary for this frame ...
+
+for i,v in enumerate(np.logspace(0, 
+                                 np.log10(ds.index.get_smallest_dx()*min_dx), 
+                                 n_frames)):
+    # We set our width as necessary for this frame 
     p.set_width(v, 'unitary')
-    # ... and we save!
+    # save
     p.save(frame_template % (i))


https://bitbucket.org/yt_analysis/yt/commits/bceab654fb71/
Changeset:   bceab654fb71
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 21:45:33
Summary:     Updating cookbook main doc.
Affected #:  1 file

diff -r 4b0ab3c014b4d4e840e294b893088dad59ee41ed -r bceab654fb71570e8135bd79dafd2b8890b56282 doc/source/cookbook/index.rst
--- a/doc/source/cookbook/index.rst
+++ b/doc/source/cookbook/index.rst
@@ -18,9 +18,6 @@
 `here <http://yt-project.org/data/>`_, where you will find links to download 
 individual datasets.
 
-If you want to take a look at more complex recipes, or submit your own,
-check out the `yt Hub <http://hub.yt-project.org>`_.
-
 .. note:: To contribute your own recipes, please follow the instructions 
     on how to contribute documentation code: :ref:`writing_documentation`.
 


https://bitbucket.org/yt_analysis/yt/commits/8f26e31ca6c3/
Changeset:   8f26e31ca6c3
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 22:03:09
Summary:     Updating streamlines_isocontour recipe.
Affected #:  1 file

diff -r bceab654fb71570e8135bd79dafd2b8890b56282 -r 8f26e31ca6c3c4fbe25b084eab7a207752b21213 doc/source/cookbook/streamlines_isocontour.py
--- a/doc/source/cookbook/streamlines_isocontour.py
+++ b/doc/source/cookbook/streamlines_isocontour.py
@@ -1,35 +1,63 @@
-from yt.mods import *
+import yt
+import numpy as np
 from yt.visualization.api import Streamlines
-
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-c = np.array([0.5]*3)
-N = 30
-scale = 15.0/pf['kpc']
-pos_dx = np.random.random((N,3))*scale-scale/2.
-pos = c+pos_dx
-
-streamlines = Streamlines(pf,pos,'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
-streamlines.integrate_through_volume()
-
 import matplotlib.pylab as pl
 from mpl_toolkits.mplot3d import Axes3D
 from mpl_toolkits.mplot3d.art3d import Poly3DCollection
+
+# Load the dataset
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# Define c: the center of the box, N: the number of streamlines,
+# scale: the spatial scale of the streamlines relative to the boxsize,
+# and then pos: the random positions of the streamlines.
+c = ds.arr([0.5]*3, 'code_length')
+N = 30
+scale = ds.quan(15, 'kpc').in_units('code_length')  # 15 kpc in code units
+pos_dx = np.random.random((N,3))*scale-scale/2.
+pos = c+pos_dx
+ 
+# Create the streamlines from these positions with the velocity fields as the
+# fields to be traced
+streamlines = Streamlines(ds, pos, 'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
+streamlines.integrate_through_volume()
+
+# Create a 3D matplotlib figure for visualizing the streamlines
 fig=pl.figure() 
 ax = Axes3D(fig)
+
+# Trace the streamlines through the volume of the 3D figure
 for stream in streamlines.streamlines:
     stream = stream[np.all(stream != 0.0, axis=1)]
-    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.1)
 
+    # Make the colors of each stream vary continuously from blue to red
+    # from low-x to high-x of the stream start position (each color is R, G, B)
+    # can omit and just set streamline colors to a fixed color
+    x_start_pos = ds.arr(stream[0,0], 'code_length')
+    x_start_pos -= ds.arr(0.5, 'code_length')
+    x_start_pos /= scale 
+    x_start_pos += 0.5
+    color = np.array([x_start_pos, 0, 1-x_start_pos])
 
-sphere = pf.sphere("max", (1.0, "mpc"))
-surface = pf.surface(sphere, "density", 1e-24)
-colors = apply_colormap(np.log10(surface["temperature"]), cmap_name="hot")
+    # Plot the stream in 3D
+    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.3, color=color)
 
+# Create a sphere object centered on the highest density point in the simulation
+# with radius = 1 Mpc
+sphere = ds.sphere("max", (1.0, "Mpc"))
+
+# Identify the isodensity surface in this sphere with density = 1e-24 g/cm^3
+surface = ds.surface(sphere, "density", 1e-24)
+
+# Color this isodensity surface according to the log of the temperature field
+colors = yt.apply_colormap(np.log10(surface["temperature"]), cmap_name="hot")
+
+# Render this surface 
 p3dc = Poly3DCollection(surface.triangles, linewidth=0.0)
-colors = colors[0,:,:]/255.
-colors[:,3] = 0.3
+colors = colors[0,:,:]/255.  # scale to [0,1]
+colors[:,3] = 0.3            # alpha = 0.3
 p3dc.set_facecolors(colors)
 ax.add_collection(p3dc)
 
+# Save the figure
 pl.savefig('streamlines_isocontour.png')
-


https://bitbucket.org/yt_analysis/yt/commits/4795eeb72f48/
Changeset:   4795eeb72f48
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 22:08:42
Summary:     Updating order of simple_plots cookbook doc.
Affected #:  1 file

diff -r 8f26e31ca6c3c4fbe25b084eab7a207752b21213 -r 4795eeb72f485946ce504df550f9865d8dbb8790 doc/source/cookbook/simple_plots.rst
--- a/doc/source/cookbook/simple_plots.rst
+++ b/doc/source/cookbook/simple_plots.rst
@@ -8,11 +8,26 @@
 Simple Slices
 ~~~~~~~~~~~~~
 
-This script shows the simplest way to make a slice from the scripting
-interface.
+This script shows the simplest way to make a slice through a dataset.
 
 .. yt_cookbook:: simple_slice.py
 
+Simple Projections
+~~~~~~~~~~~~~~~~~~
+
+This is the simplest way to make a projection through a dataset.
+
+.. yt_cookbook:: simple_projection.py
+
+Simple Phase Plots
+~~~~~~~~~~~~~~~~~~
+
+This demonstrates how to make a phase plot.  Phase plots can be thought of as
+two-dimensional histograms, where the value is either the weighted-average or
+the total accumulation in a cell.
+
+.. yt_cookbook:: simple_phase.py
+
 Simple Probability Distribution Functions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -22,24 +37,23 @@
 
 .. yt_cookbook:: simple_pdf.py
 
-Simple Phase Plots
-~~~~~~~~~~~~~~~~~~
+Simple 1D Histograms (Profiles)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-This demonstrates how to make a phase plot.  Phase plots can be thought of as
-two-dimensional histograms, where the value is either the weighted-average or
-the total accumulation in a cell.
-
-.. yt_cookbook:: simple_phase.py
-
-Simple 1D Histograms
-~~~~~~~~~~~~~~~~~~~~
-
-This is a "profile," which is a 1D profile.  This can be thought of as either
+This is a "profile," which is a 1D histogram.  This can be thought of as either
 the total accumulation (when weight_field is set to ``None``) or the average 
 (when a weight_field is supplied.)
 
 .. yt_cookbook:: simple_profile.py
 
+Simple Radial Profiles
+~~~~~~~~~~~~~~~~~~~~~~
+
+This shows how to make a profile of a quantity with respect to the radius, in
+this case the radius in Mpc.
+
+.. yt_cookbook:: simple_radial_profile.py
+
 1D Profiles Over Time
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -48,21 +62,6 @@
 
 .. yt_cookbook:: time_series_profiles.py
 
-Simple Projections
-~~~~~~~~~~~~~~~~~~
-
-This is the simplest way to make a projection through a dataset.
-
-.. yt_cookbook:: simple_projection.py
-
-Simple Radial Profiles
-~~~~~~~~~~~~~~~~~~~~~~
-
-This shows how to make a profile of a quantity with respect to the radius, in
-this case the radius in Mpc.
-
-.. yt_cookbook:: simple_radial_profile.py
-
 .. _cookbook-profile-variance:
 
 Profiles with Variance Values
@@ -85,6 +84,32 @@
 
 .. yt_cookbook:: simple_slice_with_multiple_fields.py 
 
+Off-Axis Slicing
+~~~~~~~~~~~~~~~~
+
+A cutting plane allows you to slice at some angle that isn't aligned with the
+axes.
+
+.. yt_cookbook:: aligned_cutting_plane.py
+
+.. _cookbook-simple-off-axis-projection:
+
+Off-Axis Projection
+~~~~~~~~~~~~~~~~~~~
+
+Like cutting planes, off-axis projections can be created from any arbitrary 
+viewing angle.
+
+.. yt_cookbook:: simple_off_axis_projection.py
+
+Simple Volume Rendering
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Volume renderings are 3D projections rendering isocontours in any arbitrary
+field (e.g. density, temperature, pressure, etc.)
+
+.. yt_cookbook:: simple_volume_rendering.py
+
 Showing and Hiding Axes Labels and Colorbars
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -104,37 +129,11 @@
 
 .. yt_cookbook:: simple_slice_matplotlib_example.py 
 
-Off-Axis Slicing
-~~~~~~~~~~~~~~~~
-
-A cutting plane allows you to slice at some angle that isn't aligned with the
-axes.
-
-.. yt_cookbook:: aligned_cutting_plane.py
-
-.. _cookbook-simple-off-axis-projection:
-
-Off-Axis Projection
-~~~~~~~~~~~~~~~~~~~
-
-Here we see how to make a off axis projection through a dataset.
-
-.. yt_cookbook:: simple_off_axis_projection.py
-
 .. _cookbook-simple_volume_rendering:
 
-Simple Volume Rendering
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Here we see how to make a very simple volume rendering, where each option is
-considered in turn.
-
-.. yt_cookbook:: simple_volume_rendering.py
-
 Image Background Colors
 ~~~~~~~~~~~~~~~~~~~~~~~
 
 Here we see how to take an image and save it using different background colors. 
 
 .. yt_cookbook:: image_background_colors.py
-


https://bitbucket.org/yt_analysis/yt/commits/f978a9664964/
Changeset:   f978a9664964
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 22:28:10
Summary:     Updating profile_with_variance recipe.
Affected #:  1 file

diff -r 4795eeb72f485946ce504df550f9865d8dbb8790 -r f978a966496424aaab620acd6bbddca01f939c27 doc/source/cookbook/profile_with_variance.py
--- a/doc/source/cookbook/profile_with_variance.py
+++ b/doc/source/cookbook/profile_with_variance.py
@@ -1,30 +1,31 @@
-from matplotlib import pyplot
-
-from yt.mods import *
+import matplotlib.pyplot as plt
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
-# Create a sphere of radius 1000 kpc centered on the max density.
-sphere = pf.sphere("max", (1000, "kpc"))
+# Create a sphere of radius 1 Mpc centered on the max density location.
+sp = ds.sphere("max", (1, "Mpc"))
 
 # Calculate and store the bulk velocity for the sphere.
-bulk_velocity = sphere.quantities['BulkVelocity']()
-sphere.set_field_parameter('bulk_velocity', bulk_velocity)
+bulk_velocity = sp.quantities['BulkVelocity']()
+sp.set_field_parameter('bulk_velocity', bulk_velocity)
 
 # Create a 1D profile object for profiles over radius
 # and add a velocity profile.
-profile = BinnedProfile1D(sphere, 100, "Radiuskpc", 0.1, 1000.)
-profile.add_fields('VelocityMagnitude')
+prof = yt.ProfilePlot(sp, 'radius', 'velocity_magnitude', 
+                      weight_field='cell_mass')
+prof.set_unit('radius', 'kpc')
+prof.set_xlim(0.1, 1000)
 
 # Plot the average velocity magnitude.
-pyplot.loglog(profile['Radiuskpc'], profile['VelocityMagnitude'],
-              label='mean')
+plt.loglog(prof['radius'], prof['velocity_magnitude'],
+              label='Mean')
 # Plot the variance of the velocity madnitude.
-pyplot.loglog(profile['Radiuskpc'], profile['VelocityMagnitude_std'],
-              label='std')
-pyplot.xlabel('r [kpc]')
-pyplot.ylabel('v [cm/s]')
-pyplot.legend()
+plt.loglog(prof['radius'], prof['velocity_magnitude_std'],
+              label='Standard Deviation')
+plt.xlabel('r [kpc]')
+plt.ylabel('v [cm/s]')
+plt.legend()
 
-pyplot.savefig('velocity_profiles.png')
+plt.savefig('velocity_profiles.png')


https://bitbucket.org/yt_analysis/yt/commits/bbeb8aa717f9/
Changeset:   bbeb8aa717f9
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 22:42:07
Summary:     Updating rad_velocity recipe.
Affected #:  1 file

diff -r f978a966496424aaab620acd6bbddca01f939c27 -r bbeb8aa717f9477540f5c194b35ed176ef95262a doc/source/cookbook/rad_velocity.py
--- a/doc/source/cookbook/rad_velocity.py
+++ b/doc/source/cookbook/rad_velocity.py
@@ -1,32 +1,35 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Get the first sphere
-
-sphere0 = pf.sphere(pf.domain_center, (500., "kpc"))
+sp0 = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Compute the bulk velocity from the cells in this sphere
+bulk_vel = sp0.quantities["BulkVelocity"]()
 
-bulk_vel = sphere0.quantities["BulkVelocity"]()
 
 # Get the second sphere
-
-sphere1 = pf.sphere(pf.domain_center, (500., "kpc"))
+sp1 = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Set the bulk velocity field parameter 
-sphere1.set_field_parameter("bulk_velocity", bulk_vel)
+sp1.set_field_parameter("bulk_velocity", bulk_vel)
 
 # Radial profile without correction
 
-rad_profile0 = BinnedProfile1D(sphere0, 100, "Radiuskpc", 0.0, 500., log_space=False)
-rad_profile0.add_fields("RadialVelocity")
+rp0 = yt.ProfilePlot(sp0, 'radius', 'radial_velocity')
+rp0.set_unit('radius', 'kpc')
+rp0.set_log('radius', False)
 
 # Radial profile with correction for bulk velocity
 
-rad_profile1 = BinnedProfile1D(sphere1, 100, "Radiuskpc", 0.0, 500., log_space=False)
-rad_profile1.add_fields("RadialVelocity")
+rp1 = yt.ProfilePlot(sp1, 'radius', 'radial_velocity')
+rp1.set_unit('radius', 'kpc')
+rp1.set_log('radius', False)
+
+#rp0.save('radial_velocity_profile_uncorrected.png')
+#rp1.save('radial_velocity_profile_corrected.png')
 
 # Make a plot using matplotlib
 
@@ -41,4 +44,4 @@
 ax.set_ylabel(r"$\mathrm{v_r\ (km/s)}$")
 ax.legend(["Without Correction", "With Correction"])
 
-fig.savefig("%s_profiles.png" % pf)
\ No newline at end of file
+fig.savefig("%s_profiles.png" % ds)


https://bitbucket.org/yt_analysis/yt/commits/cdb748e651bb/
Changeset:   cdb748e651bb
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 22:45:58
Summary:     Updating the radial_profile_styles recipe.
Affected #:  1 file

diff -r bbeb8aa717f9477540f5c194b35ed176ef95262a -r cdb748e651bbe4d71a9d530e128e8002b30dcc41 doc/source/cookbook/radial_profile_styles.py
--- a/doc/source/cookbook/radial_profile_styles.py
+++ b/doc/source/cookbook/radial_profile_styles.py
@@ -1,16 +1,19 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Get a sphere object
 
-sphere = pf.sphere(pf.domain_center, (500., "kpc"))
+sp = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Bin up the data from the sphere into a radial profile
 
-rad_profile = BinnedProfile1D(sphere, 100, "Radiuskpc", 0.0, 500., log_space=False)
-rad_profile.add_fields("density","temperature")
+#rp = BinnedProfile1D(sphere, 100, "Radiuskpc", 0.0, 500., log_space=False)
+#rp.add_fields("density","temperature")
+rp = yt.ProfilePlot(sp, 'radius', ['density', 'temperature'])
+rp.set_unit('radius', 'kpc')
+rp.set_log('radius', False)
 
 # Make plots using matplotlib
 
@@ -18,7 +21,7 @@
 ax = fig.add_subplot(111)
 
 # Plot the density as a log-log plot using the default settings
-dens_plot = ax.loglog(rad_profile["Radiuskpc"], rad_profile["density"])
+dens_plot = ax.loglog(rp["Radiuskpc"], rp["density"])
 
 # Here we set the labels of the plot axes
 
@@ -27,7 +30,7 @@
 
 # Save the default plot
 
-fig.savefig("density_profile_default.png" % pf)
+fig.savefig("density_profile_default.png" % ds)
 
 # The "dens_plot" object is a list of plot objects. In our case we only have one,
 # so we index the list by '0' to get it. 
@@ -51,10 +54,10 @@
 
 ax.lines = []
 
-# Since the rad_profile object also includes the standard deviation in each bin,
+# Since the radial profile object also includes the standard deviation in each bin,
 # we'll use these as errorbars. We have to make a new plot for this:
 
-dens_err_plot = ax.errorbar(rad_profile["Radiuskpc"], rad_profile["density"],
-                            yerr=rad_profile["Density_std"])
+dens_err_plot = ax.errorbar(pr["Radiuskpc"], rp["density"],
+                            yerr=rp["Density_std"])
                                                         
-fig.savefig("density_profile_with_errorbars.png")
\ No newline at end of file
+fig.savefig("density_profile_with_errorbars.png")


https://bitbucket.org/yt_analysis/yt/commits/37c1b67e0486/
Changeset:   37c1b67e0486
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 22:55:56
Summary:     Updating camera_movement recipe.
Affected #:  1 file

diff -r cdb748e651bbe4d71a9d530e128e8002b30dcc41 -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a doc/source/cookbook/camera_movement.py
--- a/doc/source/cookbook/camera_movement.py
+++ b/doc/source/cookbook/camera_movement.py
@@ -1,11 +1,10 @@
+import yt
 import numpy as np
 
-import yt
-
 # Follow the simple_volume_rendering cookbook for the first part of this.
 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")  # load data
-dd = ds.all_data()
-mi, ma = dd.quantities["Extrema"]("density")
+ad = ds.all_data()
+mi, ma = ad.quantities.extrema("density")
 
 # Set up transfer function
 tf = yt.ColorTransferFunction((np.log10(mi), np.log10(ma)))
@@ -40,4 +39,4 @@
 # Zoom in by a factor of 10 over 5 frames
 for i, snapshot in enumerate(cam.zoomin(10.0, 5, clip_ratio=8.0)):
     snapshot.write_png('camera_movement_%04i.png' % frame)
-    frame += 1
\ No newline at end of file
+    frame += 1


https://bitbucket.org/yt_analysis/yt/commits/ec5c9d5cf776/
Changeset:   ec5c9d5cf776
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 23:04:32
Summary:     Adding line at the top of every recipe which is broken in yt 3.0 indicating that it is broken.  This is so users who go to the 3.0 docs will know which recipes they can trust and which they cannot.
Affected #:  27 files

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/aligned_cutting_plane.py
--- a/doc/source/cookbook/aligned_cutting_plane.py
+++ b/doc/source/cookbook/aligned_cutting_plane.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 # Load the dataset.

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/amrkdtree_downsampling.py
--- a/doc/source/cookbook/amrkdtree_downsampling.py
+++ b/doc/source/cookbook/amrkdtree_downsampling.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED 
+
 # Using AMRKDTree Homogenized Volumes to examine large datasets
 # at lower resolution.
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/boolean_data_objects.py
--- a/doc/source/cookbook/boolean_data_objects.py
+++ b/doc/source/cookbook/boolean_data_objects.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 ds = yt.load("Enzo_64/DD0043/data0043")  # load data

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/camera_movement.py
--- a/doc/source/cookbook/camera_movement.py
+++ b/doc/source/cookbook/camera_movement.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 import numpy as np
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/find_clumps.py
--- a/doc/source/cookbook/find_clumps.py
+++ b/doc/source/cookbook/find_clumps.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import numpy as np
 
 import yt

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/fit_spectrum.py
--- a/doc/source/cookbook/fit_spectrum.py
+++ b/doc/source/cookbook/fit_spectrum.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 from yt.analysis_modules.cosmological_observation.light_ray.api import LightRay
 from yt.analysis_modules.absorption_spectrum.api import AbsorptionSpectrum

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/free_free_field.py
--- a/doc/source/cookbook/free_free_field.py
+++ b/doc/source/cookbook/free_free_field.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import numpy as np
 import yt
 # Need to grab the proton mass from the constants database

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/halo_merger_tree.py
--- a/doc/source/cookbook/halo_merger_tree.py
+++ b/doc/source/cookbook/halo_merger_tree.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 # This script demonstrates some of the halo merger tracking infrastructure,
 # for tracking halos across multiple datadumps in a time series.
 # Ultimately, it outputs an HDF5 file with the important quantities for the

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/halo_plotting.py
--- a/doc/source/cookbook/halo_plotting.py
+++ b/doc/source/cookbook/halo_plotting.py
@@ -1,7 +1,6 @@
-"""
-This is a mechanism for plotting circles representing identified particle halos
-on an image.  For more information, see :ref:`halo_finding`.
-"""
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 from yt.analysis_modules.halo_analysis.halo_catalog import HaloCatalog
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/halo_profiler.py
--- a/doc/source/cookbook/halo_profiler.py
+++ b/doc/source/cookbook/halo_profiler.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 from yt.mods import *
 
 from yt.analysis_modules.halo_profiler.api import *

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/hse_field.py
--- a/doc/source/cookbook/hse_field.py
+++ b/doc/source/cookbook/hse_field.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import numpy as np
 import yt
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/light_cone_projection.py
--- a/doc/source/cookbook/light_cone_projection.py
+++ b/doc/source/cookbook/light_cone_projection.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/light_cone_with_halo_mask.py
--- a/doc/source/cookbook/light_cone_with_halo_mask.py
+++ b/doc/source/cookbook/light_cone_with_halo_mask.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/make_light_ray.py
--- a/doc/source/cookbook/make_light_ray.py
+++ b/doc/source/cookbook/make_light_ray.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import os
 import sys
 import yt

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/multi_plot_3x2_FRB.py
--- a/doc/source/cookbook/multi_plot_3x2_FRB.py
+++ b/doc/source/cookbook/multi_plot_3x2_FRB.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 from yt.visualization.api import get_multi_plot
 import matplotlib.colorbar as cb

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/multi_plot_slice_and_proj.py
--- a/doc/source/cookbook/multi_plot_slice_and_proj.py
+++ b/doc/source/cookbook/multi_plot_slice_and_proj.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 from yt.visualization.base_plot_types import get_multi_plot
 import matplotlib.colorbar as cb

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/opaque_rendering.py
--- a/doc/source/cookbook/opaque_rendering.py
+++ b/doc/source/cookbook/opaque_rendering.py
@@ -1,11 +1,5 @@
-## Opaque Volume Rendering
-
-# The new version of yt also features opaque rendering, using grey opacity.
-# For example, this makes blues opaque to red and green.  In this example we
-# will explore how the opacity model you choose changes the appearance of the
-# rendering.
-
-# Here we start by loading up a dataset, in this case galaxy0030.
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
 
 import yt
 import numpy as np

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/profile_with_variance.py
--- a/doc/source/cookbook/profile_with_variance.py
+++ b/doc/source/cookbook/profile_with_variance.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import matplotlib.pyplot as plt
 import yt
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/rad_velocity.py
--- a/doc/source/cookbook/rad_velocity.py
+++ b/doc/source/cookbook/rad_velocity.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 import matplotlib.pyplot as plt
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/radial_profile_styles.py
--- a/doc/source/cookbook/radial_profile_styles.py
+++ b/doc/source/cookbook/radial_profile_styles.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 import matplotlib.pyplot as plt
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/rendering_with_box_and_grids.py
--- a/doc/source/cookbook/rendering_with_box_and_grids.py
+++ b/doc/source/cookbook/rendering_with_box_and_grids.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 import numpy as np
 

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/save_profiles.py
--- a/doc/source/cookbook/save_profiles.py
+++ b/doc/source/cookbook/save_profiles.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 import matplotlib.pyplot as plt
 import h5py as h5

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/simple_profile.py
--- a/doc/source/cookbook/simple_profile.py
+++ b/doc/source/cookbook/simple_profile.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 # Load the dataset.

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/simple_slice_with_multiple_fields.py
--- a/doc/source/cookbook/simple_slice_with_multiple_fields.py
+++ b/doc/source/cookbook/simple_slice_with_multiple_fields.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 # Load the dataset

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/surface_plot.py
--- a/doc/source/cookbook/surface_plot.py
+++ b/doc/source/cookbook/surface_plot.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 import numpy as np
 from mpl_toolkits.mplot3d import Axes3D

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/time_series_profiles.py
--- a/doc/source/cookbook/time_series_profiles.py
+++ b/doc/source/cookbook/time_series_profiles.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 # Create a time-series object.

diff -r 37c1b67e0486722acf8b50d2d5dce84fb28beb9a -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 doc/source/cookbook/unique_light_cone_projections.py
--- a/doc/source/cookbook/unique_light_cone_projections.py
+++ b/doc/source/cookbook/unique_light_cone_projections.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone
 


https://bitbucket.org/yt_analysis/yt/commits/e73008d0304f/
Changeset:   e73008d0304f
Branch:      yt-3.0
User:        chummels
Date:        2014-06-18 23:05:23
Summary:     Merging.
Affected #:  1 file

diff -r ec5c9d5cf7760635a506014b0a7ccc400dc13e46 -r e73008d0304fc2f230b59172b9b6bee20dd2e97d yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -791,8 +791,17 @@
 
             if zlim == (None, None):
                 if z_scale == 'log':
-                    zmin = data[data > 0.0].min()
-                    self._field_transform[f] = log_transform
+                    positive_values = data[data > 0.0]
+                    if len(positive_values) == 0:
+                        mylog.warning("Profiled field %s has no positive "
+                                      "values.  Max = %d." % (f, data.max()))
+                        mylog.warning("Switching to linear colorbar scaling.")
+                        zmin = data.min()
+                        z_scale = 'linear'
+                        self._field_transform[f] = linear_transform
+                    else:
+                        zmin = positive_values.min()
+                        self._field_transform[f] = log_transform
                 else:
                     zmin = data.min()
                     self._field_transform[f] = linear_transform


https://bitbucket.org/yt_analysis/yt/commits/b4b57ffd83fd/
Changeset:   b4b57ffd83fd
Branch:      yt-3.0
User:        chummels
Date:        2014-06-19 00:24:32
Summary:     Updating to use proper derived_field initialization.
Affected #:  1 file

diff -r e73008d0304fc2f230b59172b9b6bee20dd2e97d -r b4b57ffd83fde6cf885dae48c4f000badf3a324f doc/source/cookbook/fit_spectrum.py
--- a/doc/source/cookbook/fit_spectrum.py
+++ b/doc/source/cookbook/fit_spectrum.py
@@ -9,15 +9,11 @@
 # Define and add a field to simulate OVI based on a constant relationship to HI
 # Do *NOT* use this for science, because this is not how OVI actually behaves;
 # it is just an example.
-def _OVI_NumberDensity(field, data):
-    return data['HI_NumberDensity']
 
-def _convertOVI(data):
-    return 4.9E-4*.2
+ at yt.derived_field(name='OVI_number_density', units='cm**-3')
+def _OVI_number_density(field, data):
+    return data['HI_NumberDensity']*2.0
 
-yt.add_field('my_OVI_NumberDensity',
-             function=_OVI_NumberDensity,
-             convert_function=_convertOVI)
 
 # Define species and associated parameters to add to continuum
 # Parameters used for both adding the transition to the spectrum
@@ -40,7 +36,7 @@
                  'init_N': 1E14}
 
 OVI_parameters = {'name': 'OVI',
-                  'field': 'my_OVI_NumberDensity',
+                  'field': 'OVI_number_density',
                   'f': [.1325, .06580],
                   'Gamma': [4.148E8, 4.076E8],
                   'wavelength': [1031.9261, 1037.6167],


https://bitbucket.org/yt_analysis/yt/commits/ea664cc2d75e/
Changeset:   ea664cc2d75e
Branch:      yt-3.0
User:        chummels
Date:        2014-06-19 01:00:34
Summary:     Updating hse_field recipe.
Affected #:  1 file

diff -r b4b57ffd83fde6cf885dae48c4f000badf3a324f -r ea664cc2d75ef21e26556cb64d920e17feced5e8 doc/source/cookbook/hse_field.py
--- a/doc/source/cookbook/hse_field.py
+++ b/doc/source/cookbook/hse_field.py
@@ -7,8 +7,8 @@
 # Define the components of the gravitational acceleration vector field by
 # taking the gradient of the gravitational potential
 
-
-def _Grav_Accel_x(field, data):
+ at yt.derived_field(name='grav_accel_x', units='cm/s**2', take_log=False)
+def grav_accel_x(field, data):
 
     # We need to set up stencils
 
@@ -22,13 +22,14 @@
     gx -= data["gravitational_potential"][sl_left, 1:-1, 1:-1]/dx
 
     new_field = np.zeros(data["gravitational_potential"].shape,
-                         dtype='float64')
+                         dtype='float64')*gx.unit_array
     new_field[1:-1, 1:-1, 1:-1] = -gx
 
     return new_field
 
 
-def _Grav_Accel_y(field, data):
+ at yt.derived_field(name='grav_accel_y', units='cm/s**2', take_log=False)
+def grav_accel_y(field, data):
 
     # We need to set up stencils
 
@@ -42,13 +43,14 @@
     gy -= data["gravitational_potential"][1:-1, sl_left, 1:-1]/dy
 
     new_field = np.zeros(data["gravitational_potential"].shape,
-                         dtype='float64')
+                         dtype='float64')*gx.unit_array
     new_field[1:-1, 1:-1, 1:-1] = -gy
 
     return new_field
 
 
-def _Grav_Accel_z(field, data):
+ at yt.derived_field(name='grav_accel_z', units='cm/s**2', take_log=False)
+def grav_accel_z(field, data):
 
     # We need to set up stencils
 
@@ -62,7 +64,7 @@
     gz -= data["gravitational_potential"][1:-1, 1:-1, sl_left]/dz
 
     new_field = np.zeros(data["gravitational_potential"].shape,
-                         dtype='float64')
+                         dtype='float64')*gx.unit_array
     new_field[1:-1, 1:-1, 1:-1] = -gz
 
     return new_field
@@ -71,7 +73,8 @@
 # Define the components of the pressure gradient field
 
 
-def _Grad_Pressure_x(field, data):
+ at yt.derived_field(name='grad_pressure_x', units='g/(cm*s)**2', take_log=False)
+def grad_pressure_x(field, data):
 
     # We need to set up stencils
 
@@ -84,13 +87,14 @@
     px = data["pressure"][sl_right, 1:-1, 1:-1]/dx
     px -= data["pressure"][sl_left, 1:-1, 1:-1]/dx
 
-    new_field = np.zeros(data["pressure"].shape, dtype='float64')
+    new_field = np.zeros(data["pressure"].shape, dtype='float64')*px.unit_array
     new_field[1:-1, 1:-1, 1:-1] = px
 
     return new_field
 
 
-def _Grad_Pressure_y(field, data):
+ at yt.derived_field(name='grad_pressure_y', units='g/(cm*s)**2', take_log=False)
+def grad_pressure_y(field, data):
 
     # We need to set up stencils
 
@@ -103,13 +107,14 @@
     py = data["pressure"][1:-1, sl_right, 1:-1]/dy
     py -= data["pressure"][1:-1, sl_left, 1:-1]/dy
 
-    new_field = np.zeros(data["pressure"].shape, dtype='float64')
+    new_field = np.zeros(data["pressure"].shape, dtype='float64')*px.unit_array
     new_field[1:-1, 1:-1, 1:-1] = py
 
     return new_field
 
 
-def _Grad_Pressure_z(field, data):
+ at yt.derived_field(name='grad_pressure_z', units='g/(cm*s)**2', take_log=False)
+def grad_pressure_z(field, data):
 
     # We need to set up stencils
 
@@ -122,7 +127,7 @@
     pz = data["pressure"][1:-1, 1:-1, sl_right]/dz
     pz -= data["pressure"][1:-1, 1:-1, sl_left]/dz
 
-    new_field = np.zeros(data["pressure"].shape, dtype='float64')
+    new_field = np.zeros(data["pressure"].shape, dtype='float64')*px.unit_array
     new_field[1:-1, 1:-1, 1:-1] = pz
 
     return new_field
@@ -130,8 +135,8 @@
 
 # Define the "degree of hydrostatic equilibrium" field
 
-
-def _HSE(field, data):
+ at yt.derived_field(name='HSE', units=None, take_log=False)
+def HSE(field, data):
 
     gx = data["density"]*data["Grav_Accel_x"]
     gy = data["density"]*data["Grav_Accel_y"]
@@ -141,31 +146,10 @@
     hy = data["Grad_Pressure_y"] - gy
     hz = data["Grad_Pressure_z"] - gz
 
-    h = np.sqrt((hx*hx+hy*hy+hz*hz)/(gx*gx+gy*gy+gz*gz))
+    h = np.sqrt((hx*hx+hy*hy+hz*hz)/(gx*gx+gy*gy+gz*gz))*gx.unit_array
 
     return h
 
-# Now add the fields to the database
-
-yt.add_field("Grav_Accel_x", function=_Grav_Accel_x, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["gravitational_potential"])])
-
-yt.add_field("Grav_Accel_y", function=_Grav_Accel_y, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["gravitational_potential"])])
-
-yt.add_field("Grav_Accel_z", function=_Grav_Accel_z, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["gravitational_potential"])])
-
-yt.add_field("Grad_Pressure_x", function=_Grad_Pressure_x, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["pressure"])])
-
-yt.add_field("Grad_Pressure_y", function=_Grad_Pressure_y, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["pressure"])])
-
-yt.add_field("Grad_Pressure_z", function=_Grad_Pressure_z, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["pressure"])])
-
-yt.add_field("HSE", function=_HSE, take_log=False)
 
 # Open two files, one at the beginning and the other at a later time when
 # there's a lot of sloshing going on.
@@ -176,8 +160,8 @@
 # Sphere objects centered at the cluster potential minimum with a radius
 # of 200 kpc
 
-sphere_i = dsi.h.sphere(dsi.domain_center, (200, "kpc"))
-sphere_f = dsf.h.sphere(dsf.domain_center, (200, "kpc"))
+sphere_i = dsi.sphere(dsi.domain_center, (200, "kpc"))
+sphere_f = dsf.sphere(dsf.domain_center, (200, "kpc"))
 
 # Average "degree of hydrostatic equilibrium" in these spheres
 
@@ -191,9 +175,9 @@
 # of the two files
 
 slc_i = yt.SlicePlot(dsi, 2, ["density", "HSE"], center=dsi.domain_center,
-                     width=(1.0, "mpc"))
+                     width=(1.0, "Mpc"))
 slc_f = yt.SlicePlot(dsf, 2, ["density", "HSE"], center=dsf.domain_center,
-                     width=(1.0, "mpc"))
+                     width=(1.0, "Mpc"))
 
 slc_i.save("initial")
 slc_f.save("final")


https://bitbucket.org/yt_analysis/yt/commits/eb067d662c16/
Changeset:   eb067d662c16
Branch:      yt-3.0
User:        chummels
Date:        2014-06-19 01:06:57
Summary:     Updating multi_plot_3x2 recipe.
Affected #:  1 file

diff -r ea664cc2d75ef21e26556cb64d920e17feced5e8 -r eb067d662c16300f3340c101675460adb8e07cf3 doc/source/cookbook/multi_plot_3x2_FRB.py
--- a/doc/source/cookbook/multi_plot_3x2_FRB.py
+++ b/doc/source/cookbook/multi_plot_3x2_FRB.py
@@ -2,6 +2,7 @@
 ### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
 
 import yt
+import numpy as np
 from yt.visualization.api import get_multi_plot
 import matplotlib.colorbar as cb
 from matplotlib.colors import LogNorm
@@ -43,11 +44,16 @@
         ax.xaxis.set_visible(False)
         ax.yaxis.set_visible(False)
 
-    plots.append(den_axis.imshow(frb['density'], norm=LogNorm()))
+    # converting our fixed resolution buffers to NDarray so matplotlib can
+    # render them
+    dens = np.array(frb['density'])
+    temp = np.array(frb['temperature'])
+
+    plots.append(den_axis.imshow(dens, norm=LogNorm()))
     plots[-1].set_clim((5e-32, 1e-29))
     plots[-1].set_cmap("bds_highcontrast")
 
-    plots.append(temp_axis.imshow(frb['temperature'], norm=LogNorm()))
+    plots.append(temp_axis.imshow(temp, norm=LogNorm()))
     plots[-1].set_clim((1e3, 1e8))
     plots[-1].set_cmap("hot")
     


https://bitbucket.org/yt_analysis/yt/commits/c5f796801706/
Changeset:   c5f796801706
Branch:      yt-3.0
User:        chummels
Date:        2014-06-19 01:14:59
Summary:     Updating multi_plot_slice_and_proj recipe.
Affected #:  1 file

diff -r eb067d662c16300f3340c101675460adb8e07cf3 -r c5f796801706aedc1e92a5991da3e08304906a9a doc/source/cookbook/multi_plot_slice_and_proj.py
--- a/doc/source/cookbook/multi_plot_slice_and_proj.py
+++ b/doc/source/cookbook/multi_plot_slice_and_proj.py
@@ -1,7 +1,5 @@
-### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
-### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
-
 import yt
+import numpy as np
 from yt.visualization.base_plot_types import get_multi_plot
 import matplotlib.colorbar as cb
 from matplotlib.colors import LogNorm
@@ -23,8 +21,8 @@
 slc = yt.SlicePlot(ds, 'z', fields=["density","temperature","velocity_magnitude"])
 proj = yt.ProjectionPlot(ds, 'z', "density", weight_field="density")
 
-slc_frb = slc.data_source.to_frb((1.0, "mpc"), 512)
-proj_frb = proj.data_source.to_frb((1.0, "mpc"), 512)
+slc_frb = slc.data_source.to_frb((1.0, "Mpc"), 512)
+proj_frb = proj.data_source.to_frb((1.0, "Mpc"), 512)
 
 dens_axes = [axes[0][0], axes[1][0]]
 temp_axes = [axes[0][1], axes[1][1]]
@@ -39,12 +37,22 @@
     vax.xaxis.set_visible(False)
     vax.yaxis.set_visible(False)
 
-plots = [dens_axes[0].imshow(slc_frb["density"], origin='lower', norm=LogNorm()),
-         dens_axes[1].imshow(proj_frb["density"], origin='lower', norm=LogNorm()),
-         temp_axes[0].imshow(slc_frb["temperature"], origin='lower'),    
-         temp_axes[1].imshow(proj_frb["temperature"], origin='lower'),
-         vels_axes[0].imshow(slc_frb["velocity_magnitude"], origin='lower', norm=LogNorm()),
-         vels_axes[1].imshow(proj_frb["velocity_magnitude"], origin='lower', norm=LogNorm())]
+# Converting our Fixed Resolution Buffers to numpy arrays so that matplotlib
+# can render them
+
+slc_dens = np.array(slc_frb['density'])
+proj_dens = np.array(proj_frb['density'])
+slc_temp = np.array(slc_frb['temperature'])
+proj_temp = np.array(proj_frb['temperature'])
+slc_vel = np.array(slc_frb['velocity_magnitude'])
+proj_vel = np.array(proj_frb['velocity_magnitude'])
+
+plots = [dens_axes[0].imshow(slc_dens, origin='lower', norm=LogNorm()),
+         dens_axes[1].imshow(proj_dens, origin='lower', norm=LogNorm()),
+         temp_axes[0].imshow(slc_temp, origin='lower'),    
+         temp_axes[1].imshow(proj_temp, origin='lower'),
+         vels_axes[0].imshow(slc_vel, origin='lower', norm=LogNorm()),
+         vels_axes[1].imshow(proj_vel, origin='lower', norm=LogNorm())]
          
 plots[0].set_clim((1.0e-27,1.0e-25))
 plots[0].set_cmap("bds_highcontrast")
@@ -60,8 +68,8 @@
 plots[5].set_cmap("gist_rainbow")
 
 titles=[r'$\mathrm{Density}\ (\mathrm{g\ cm^{-3}})$', 
-        r'$\mathrm{temperature}\ (\mathrm{K})$',
-        r'$\mathrm{VelocityMagnitude}\ (\mathrm{cm\ s^{-1}})$']
+        r'$\mathrm{Temperature}\ (\mathrm{K})$',
+        r'$\mathrm{Velocity Magnitude}\ (\mathrm{cm\ s^{-1}})$']
 
 for p, cax, t in zip(plots[0:6:2], colorbars, titles):
     cbar = fig.colorbar(p, cax=cax, orientation=orient)


https://bitbucket.org/yt_analysis/yt/commits/338e8631f7f3/
Changeset:   338e8631f7f3
Branch:      yt-3.0
User:        chummels
Date:        2014-06-19 01:15:32
Summary:     Updating multi_plot_3x2_FRB recipe.
Affected #:  1 file

diff -r c5f796801706aedc1e92a5991da3e08304906a9a -r 338e8631f7f3728046ca7c03ed5ca489d9502131 doc/source/cookbook/multi_plot_3x2_FRB.py
--- a/doc/source/cookbook/multi_plot_3x2_FRB.py
+++ b/doc/source/cookbook/multi_plot_3x2_FRB.py
@@ -1,6 +1,3 @@
-### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
-### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
-
 import yt
 import numpy as np
 from yt.visualization.api import get_multi_plot


https://bitbucket.org/yt_analysis/yt/commits/1d4b798712da/
Changeset:   1d4b798712da
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-06-19 02:23:47
Summary:     Merged in chummels/yt/yt-3.0 (pull request #958)

Updating 3.0 cookbook recipes (and some bug fixes)
Affected #:  65 files

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/aligned_cutting_plane.py
--- a/doc/source/cookbook/aligned_cutting_plane.py
+++ b/doc/source/cookbook/aligned_cutting_plane.py
@@ -1,18 +1,20 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 # Load the dataset.
 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
-# Create a 1 kpc radius sphere, centered on the maximum gas density.  Note
-# that this sphere is very small compared to the size of our final plot,
-# and it has a non-axially aligned L vector.
-sp = ds.sphere("m", (1.0, "kpc"))
+# Create a 15 kpc radius sphere, centered on the center of the sim volume
+sp = ds.sphere("center", (15.0, "kpc"))
 
 # Get the angular momentum vector for the sphere.
 L = sp.quantities.angular_momentum_vector()
 
 print "Angular momentum vector: {0}".format(L)
 
-# Create an OffAxisSlicePlot on the object with the L vector as its normal
-p = yt.OffAxisSlicePlot(ds, L, "density", sp.center, (15, "kpc"))
+# Create an OffAxisSlicePlot of density centered on the object with the L 
+# vector as its normal and a width of 25 kpc on a side
+p = yt.OffAxisSlicePlot(ds, L, "density", sp.center, (25, "kpc"))
 p.save()

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/amrkdtree_downsampling.py
--- a/doc/source/cookbook/amrkdtree_downsampling.py
+++ b/doc/source/cookbook/amrkdtree_downsampling.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED 
+
 # Using AMRKDTree Homogenized Volumes to examine large datasets
 # at lower resolution.
 
@@ -10,17 +13,17 @@
 import yt
 from yt.utilities.amr_kdtree.api import AMRKDTree
 
-# Load up a data and print out the maximum refinement level
+# Load up a dataset
 ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
 
 kd = AMRKDTree(ds)
-# Print out the total volume of all the bricks
-print kd.count_volume()
-# Print out the number of cells
-print kd.count_cells()
+
+# Print out specifics of KD Tree
+print "Total volume of all bricks = %i" % kd.count_volume()
+print "Total number of cells = %i" % kd.count_cells()
 
 tf = yt.ColorTransferFunction((-30, -22))
-cam = ds.h.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256,
+cam = ds.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256,
                   tf, volume=kd)
 tf.add_layers(4, 0.01, col_bounds=[-27.5, -25.5], colormap='RdBu_r')
 cam.snapshot("v1.png", clip_ratio=6.0)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/average_value.py
--- a/doc/source/cookbook/average_value.py
+++ b/doc/source/cookbook/average_value.py
@@ -5,9 +5,10 @@
 field = "temperature"  # The field to average
 weight = "cell_mass"  # The weight for the average
 
-dd = ds.h.all_data()  # This is a region describing the entire box,
-                      # but note it doesn't read anything in yet!
+ad = ds.all_data()  # This is a region describing the entire box,
+                    # but note it doesn't read anything in yet!
+
 # We now use our 'quantities' call to get the average quantity
-average_value = dd.quantities["WeightedAverageQuantity"](field, weight)
+average_value = ad.quantities.weighted_average_quantity(field, weight)
 
-print "Average %s (weighted by %s) is %0.5e" % (field, weight, average_value)
+print "Average %s (weighted by %s) is %0.3e %s" % (field, weight, average_value, average_value.units)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/boolean_data_objects.py
--- a/doc/source/cookbook/boolean_data_objects.py
+++ b/doc/source/cookbook/boolean_data_objects.py
@@ -1,23 +1,32 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 
 ds = yt.load("Enzo_64/DD0043/data0043")  # load data
-# Make a few data ojbects to start.
+# Make a few data ojbects to start. Two boxes and two spheres.
 re1 = ds.region([0.5, 0.5, 0.5], [0.4, 0.4, 0.4], [0.6, 0.6, 0.6])
 re2 = ds.region([0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [0.6, 0.6, 0.6])
 sp1 = ds.sphere([0.5, 0.5, 0.5], 0.05)
 sp2 = ds.sphere([0.1, 0.2, 0.3], 0.1)
+
 # The "AND" operator. This will make a region identical to re2.
 bool1 = ds.boolean([re1, "AND", re2])
 xp = bool1["particle_position_x"]
+
 # The "OR" operator. This will make a region identical to re1.
 bool2 = ds.boolean([re1, "OR", re2])
+
 # The "NOT" operator. This will make a region like re1, but with the corner
 # that re2 covers cut out.
 bool3 = ds.boolean([re1, "NOT", re2])
+
 # Disjoint regions can be combined with the "OR" operator.
 bool4 = ds.boolean([sp1, "OR", sp2])
+
 # Find oddly-shaped overlapping regions.
 bool5 = ds.boolean([re2, "AND", sp1])
+
 # Nested logic with parentheses.
 # This is re1 with the oddly-shaped region cut out.
 bool6 = ds.boolean([re1, "NOT", "(", re1, "AND", sp1, ")"])

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/camera_movement.py
--- a/doc/source/cookbook/camera_movement.py
+++ b/doc/source/cookbook/camera_movement.py
@@ -1,11 +1,13 @@
-import numpy as np
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
 
 import yt
+import numpy as np
 
 # Follow the simple_volume_rendering cookbook for the first part of this.
 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")  # load data
-dd = ds.all_data()
-mi, ma = dd.quantities["Extrema"]("density")
+ad = ds.all_data()
+mi, ma = ad.quantities.extrema("density")
 
 # Set up transfer function
 tf = yt.ColorTransferFunction((np.log10(mi), np.log10(ma)))
@@ -40,4 +42,4 @@
 # Zoom in by a factor of 10 over 5 frames
 for i, snapshot in enumerate(cam.zoomin(10.0, 5, clip_ratio=8.0)):
     snapshot.write_png('camera_movement_%04i.png' % frame)
-    frame += 1
\ No newline at end of file
+    frame += 1

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/contours_on_slice.py
--- a/doc/source/cookbook/contours_on_slice.py
+++ b/doc/source/cookbook/contours_on_slice.py
@@ -1,13 +1,12 @@
 import yt
 
 # first add density contours on a density slice
-pf = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")  # load data
-p = yt.SlicePlot(pf, "x", "density")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")  
+p = yt.SlicePlot(ds, "x", "density")
 p.annotate_contour("density")
 p.save()
 
-# then add temperature contours on the same densty slice
-pf = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")  # load data
-p = yt.SlicePlot(pf, "x", "density")
+# then add temperature contours on the same density slice
+p = yt.SlicePlot(ds, "x", "density")
 p.annotate_contour("temperature")
-p.save(str(pf)+'_T_contour')
+p.save(str(ds)+'_T_contour')

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/extract_fixed_resolution_data.py
--- a/doc/source/cookbook/extract_fixed_resolution_data.py
+++ b/doc/source/cookbook/extract_fixed_resolution_data.py
@@ -8,21 +8,26 @@
 level = 2
 dims = ds.domain_dimensions * ds.refine_by**level
 
-# Now, we construct an object that describes the data region and structure we
-# want
-cube = ds.covering_grid(2,  # The level we are willing to extract to; higher
-                            # levels than this will not contribute to the data!
+# We construct an object that describes the data region and structure we want
+# In this case, we want all data up to the maximum "level" of refinement 
+# across the entire simulation volume.  Higher levels than this will not 
+# contribute to our covering grid.
+cube = ds.covering_grid(level,  
                         left_edge=[0.0, 0.0, 0.0],
+                        dims=dims,
                         # And any fields to preload (this is optional!)
-                        dims=dims,
                         fields=["density"])
 
 # Now we open our output file using h5py
-# Note that we open with 'w' which will overwrite existing files!
+# Note that we open with 'w' (write), which will overwrite existing files!
 f = h5py.File("my_data.h5", "w")
 
-# We create a dataset at the root note, calling it density...
+# We create a dataset at the root, calling it "density"
 f.create_dataset("/density", data=cube["density"])
 
 # We close our file
 f.close()
+
+# If we want to then access this datacube in the h5 file, we can now...
+f = h5py.File("my_data.h5", "r")
+print f["density"].value

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/find_clumps.py
--- a/doc/source/cookbook/find_clumps.py
+++ b/doc/source/cookbook/find_clumps.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import numpy as np
 
 import yt

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/fit_spectrum.py
--- a/doc/source/cookbook/fit_spectrum.py
+++ b/doc/source/cookbook/fit_spectrum.py
@@ -1,22 +1,21 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import yt
 from yt.analysis_modules.cosmological_observation.light_ray.api import LightRay
-from yt.analysis_modules.api import AbsorptionSpectrum
+from yt.analysis_modules.absorption_spectrum.api import AbsorptionSpectrum
 from yt.analysis_modules.absorption_spectrum.api import generate_total_fit
 
 # Define and add a field to simulate OVI based on a constant relationship to HI
-def _OVI_NumberDensity(field, data):
-    return data['HI_NumberDensity']
+# Do *NOT* use this for science, because this is not how OVI actually behaves;
+# it is just an example.
 
+ at yt.derived_field(name='OVI_number_density', units='cm**-3')
+def _OVI_number_density(field, data):
+    return data['HI_NumberDensity']*2.0
 
-def _convertOVI(data):
-    return 4.9E-4*.2
 
-yt.add_field('my_OVI_NumberDensity',
-             function=_OVI_NumberDensity,
-             convert_function=_convertOVI)
-
-
-# Define species andi associated parameters to add to continuum
+# Define species and associated parameters to add to continuum
 # Parameters used for both adding the transition to the spectrum
 # and for fitting
 # Note that for single species that produce multiple lines
@@ -37,7 +36,7 @@
                  'init_N': 1E14}
 
 OVI_parameters = {'name': 'OVI',
-                  'field': 'my_OVI_NumberDensity',
+                  'field': 'OVI_number_density',
                   'f': [.1325, .06580],
                   'Gamma': [4.148E8, 4.076E8],
                   'wavelength': [1031.9261, 1037.6167],

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/free_free_field.py
--- a/doc/source/cookbook/free_free_field.py
+++ b/doc/source/cookbook/free_free_field.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import numpy as np
 import yt
 # Need to grab the proton mass from the constants database

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/global_phase_plots.py
--- a/doc/source/cookbook/global_phase_plots.py
+++ b/doc/source/cookbook/global_phase_plots.py
@@ -4,10 +4,10 @@
 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # This is an object that describes the entire box
-ad = ds.h.all_data()
+ad = ds.all_data()
 
-# We plot the average VelocityMagnitude (mass-weighted) in our object
-# as a function of Density and temperature
+# We plot the average velocity magnitude (mass-weighted) in our object
+# as a function of density and temperature
 plot = yt.PhasePlot(ad, "density", "temperature", "velocity_magnitude")
 
 # save the plot

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/halo_merger_tree.py
--- a/doc/source/cookbook/halo_merger_tree.py
+++ b/doc/source/cookbook/halo_merger_tree.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 # This script demonstrates some of the halo merger tracking infrastructure,
 # for tracking halos across multiple datadumps in a time series.
 # Ultimately, it outputs an HDF5 file with the important quantities for the

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/halo_plotting.py
--- a/doc/source/cookbook/halo_plotting.py
+++ b/doc/source/cookbook/halo_plotting.py
@@ -1,16 +1,20 @@
-"""
-This is a mechanism for plotting circles representing identified particle halos
-on an image.  For more information, see :ref:`halo_finding`.
-"""
-from yt.mods import * # set up our namespace
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
 
-data_pf = load("Enzo_64/RD0006/RedshiftOutput0006")
+import yt
+from yt.analysis_modules.halo_analysis.halo_catalog import HaloCatalog
 
-halo_pf = load('rockstar_halos/halos_0.0.bin')
+# Load the dataset
+ds = yt.load("Enzo_64/RD0006/RedshiftOutput0006")
 
-hc - HaloCatalog(halos_pf = halo_pf)
+# Load the halo list from a rockstar output for this dataset
+halos = yt.load('rockstar_halos/halos_0.0.bin')
+
+# Create the halo catalog from this halo list
+hc = HaloCatalog(halos_pf = halos)
 hc.load()
 
-p = ProjectionPlot(pf, "x", "density")
+# Create a projection with the halos overplot on top
+p = yt.ProjectionPlot(ds, "x", "density")
 p.annotate_halos(hc)
 p.save()

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/halo_profiler.py
--- a/doc/source/cookbook/halo_profiler.py
+++ b/doc/source/cookbook/halo_profiler.py
@@ -1,3 +1,6 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 from yt.mods import *
 
 from yt.analysis_modules.halo_profiler.api import *

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/hse_field.py
--- a/doc/source/cookbook/hse_field.py
+++ b/doc/source/cookbook/hse_field.py
@@ -1,11 +1,14 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import numpy as np
 import yt
 
 # Define the components of the gravitational acceleration vector field by
 # taking the gradient of the gravitational potential
 
-
-def _Grav_Accel_x(field, data):
+ at yt.derived_field(name='grav_accel_x', units='cm/s**2', take_log=False)
+def grav_accel_x(field, data):
 
     # We need to set up stencils
 
@@ -19,13 +22,14 @@
     gx -= data["gravitational_potential"][sl_left, 1:-1, 1:-1]/dx
 
     new_field = np.zeros(data["gravitational_potential"].shape,
-                         dtype='float64')
+                         dtype='float64')*gx.unit_array
     new_field[1:-1, 1:-1, 1:-1] = -gx
 
     return new_field
 
 
-def _Grav_Accel_y(field, data):
+ at yt.derived_field(name='grav_accel_y', units='cm/s**2', take_log=False)
+def grav_accel_y(field, data):
 
     # We need to set up stencils
 
@@ -39,13 +43,14 @@
     gy -= data["gravitational_potential"][1:-1, sl_left, 1:-1]/dy
 
     new_field = np.zeros(data["gravitational_potential"].shape,
-                         dtype='float64')
+                         dtype='float64')*gx.unit_array
     new_field[1:-1, 1:-1, 1:-1] = -gy
 
     return new_field
 
 
-def _Grav_Accel_z(field, data):
+ at yt.derived_field(name='grav_accel_z', units='cm/s**2', take_log=False)
+def grav_accel_z(field, data):
 
     # We need to set up stencils
 
@@ -59,7 +64,7 @@
     gz -= data["gravitational_potential"][1:-1, 1:-1, sl_left]/dz
 
     new_field = np.zeros(data["gravitational_potential"].shape,
-                         dtype='float64')
+                         dtype='float64')*gx.unit_array
     new_field[1:-1, 1:-1, 1:-1] = -gz
 
     return new_field
@@ -68,7 +73,8 @@
 # Define the components of the pressure gradient field
 
 
-def _Grad_Pressure_x(field, data):
+ at yt.derived_field(name='grad_pressure_x', units='g/(cm*s)**2', take_log=False)
+def grad_pressure_x(field, data):
 
     # We need to set up stencils
 
@@ -81,13 +87,14 @@
     px = data["pressure"][sl_right, 1:-1, 1:-1]/dx
     px -= data["pressure"][sl_left, 1:-1, 1:-1]/dx
 
-    new_field = np.zeros(data["pressure"].shape, dtype='float64')
+    new_field = np.zeros(data["pressure"].shape, dtype='float64')*px.unit_array
     new_field[1:-1, 1:-1, 1:-1] = px
 
     return new_field
 
 
-def _Grad_Pressure_y(field, data):
+ at yt.derived_field(name='grad_pressure_y', units='g/(cm*s)**2', take_log=False)
+def grad_pressure_y(field, data):
 
     # We need to set up stencils
 
@@ -100,13 +107,14 @@
     py = data["pressure"][1:-1, sl_right, 1:-1]/dy
     py -= data["pressure"][1:-1, sl_left, 1:-1]/dy
 
-    new_field = np.zeros(data["pressure"].shape, dtype='float64')
+    new_field = np.zeros(data["pressure"].shape, dtype='float64')*px.unit_array
     new_field[1:-1, 1:-1, 1:-1] = py
 
     return new_field
 
 
-def _Grad_Pressure_z(field, data):
+ at yt.derived_field(name='grad_pressure_z', units='g/(cm*s)**2', take_log=False)
+def grad_pressure_z(field, data):
 
     # We need to set up stencils
 
@@ -119,7 +127,7 @@
     pz = data["pressure"][1:-1, 1:-1, sl_right]/dz
     pz -= data["pressure"][1:-1, 1:-1, sl_left]/dz
 
-    new_field = np.zeros(data["pressure"].shape, dtype='float64')
+    new_field = np.zeros(data["pressure"].shape, dtype='float64')*px.unit_array
     new_field[1:-1, 1:-1, 1:-1] = pz
 
     return new_field
@@ -127,8 +135,8 @@
 
 # Define the "degree of hydrostatic equilibrium" field
 
-
-def _HSE(field, data):
+ at yt.derived_field(name='HSE', units=None, take_log=False)
+def HSE(field, data):
 
     gx = data["density"]*data["Grav_Accel_x"]
     gy = data["density"]*data["Grav_Accel_y"]
@@ -138,31 +146,10 @@
     hy = data["Grad_Pressure_y"] - gy
     hz = data["Grad_Pressure_z"] - gz
 
-    h = np.sqrt((hx*hx+hy*hy+hz*hz)/(gx*gx+gy*gy+gz*gz))
+    h = np.sqrt((hx*hx+hy*hy+hz*hz)/(gx*gx+gy*gy+gz*gz))*gx.unit_array
 
     return h
 
-# Now add the fields to the database
-
-yt.add_field("Grav_Accel_x", function=_Grav_Accel_x, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["gravitational_potential"])])
-
-yt.add_field("Grav_Accel_y", function=_Grav_Accel_y, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["gravitational_potential"])])
-
-yt.add_field("Grav_Accel_z", function=_Grav_Accel_z, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["gravitational_potential"])])
-
-yt.add_field("Grad_Pressure_x", function=_Grad_Pressure_x, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["pressure"])])
-
-yt.add_field("Grad_Pressure_y", function=_Grad_Pressure_y, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["pressure"])])
-
-yt.add_field("Grad_Pressure_z", function=_Grad_Pressure_z, take_log=False,
-             validators=[yt.ValidateSpatial(1, ["pressure"])])
-
-yt.add_field("HSE", function=_HSE, take_log=False)
 
 # Open two files, one at the beginning and the other at a later time when
 # there's a lot of sloshing going on.
@@ -173,8 +160,8 @@
 # Sphere objects centered at the cluster potential minimum with a radius
 # of 200 kpc
 
-sphere_i = dsi.h.sphere(dsi.domain_center, (200, "kpc"))
-sphere_f = dsf.h.sphere(dsf.domain_center, (200, "kpc"))
+sphere_i = dsi.sphere(dsi.domain_center, (200, "kpc"))
+sphere_f = dsf.sphere(dsf.domain_center, (200, "kpc"))
 
 # Average "degree of hydrostatic equilibrium" in these spheres
 
@@ -188,9 +175,9 @@
 # of the two files
 
 slc_i = yt.SlicePlot(dsi, 2, ["density", "HSE"], center=dsi.domain_center,
-                     width=(1.0, "mpc"))
+                     width=(1.0, "Mpc"))
 slc_f = yt.SlicePlot(dsf, 2, ["density", "HSE"], center=dsf.domain_center,
-                     width=(1.0, "mpc"))
+                     width=(1.0, "Mpc"))
 
 slc_i.save("initial")
 slc_f.save("final")

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/image_background_colors.py
--- a/doc/source/cookbook/image_background_colors.py
+++ b/doc/source/cookbook/image_background_colors.py
@@ -1,21 +1,24 @@
-from yt.mods import *
-
 # This shows how to save ImageArray objects, such as those returned from 
 # volume renderings, to pngs with varying backgrounds.
 
+import yt
+import numpy as np
+
 # Lets make a fake "rendering" that has 4 channels and looks like a linear
 # gradient from the bottom to top.
+
 im = np.zeros([64,128,4])
 for i in xrange(im.shape[0]):
     for k in xrange(im.shape[2]):
         im[i,:,k] = np.linspace(0.,10.*k, im.shape[1])
-im_arr = ImageArray(im)
+im_arr = yt.ImageArray(im)
 
 # in this case you would have gotten im_arr from something like:
 # im_arr = cam.snapshot() 
 
 # To save it with the default settings, we can just use write_png, where it 
 # rescales the image and uses a black background.
+
 im_arr.write_png('standard.png')
  
 # write_png accepts a background keyword argument that defaults to 'black'.
@@ -24,12 +27,8 @@
 # white (1.,1.,1.,1.)
 # None  (0.,0.,0.,0.) <-- Transparent!
 # any rgba list/array: [r,g,b,a], bounded by 0..1
+
 im_arr.write_png('black_bg.png', background='black')
 im_arr.write_png('white_bg.png', background='white')
 im_arr.write_png('green_bg.png', background=[0.,1.,0.,1.])
 im_arr.write_png('transparent_bg.png', background=None)
-
-
-
-
-

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/index.rst
--- a/doc/source/cookbook/index.rst
+++ b/doc/source/cookbook/index.rst
@@ -18,9 +18,6 @@
 `here <http://yt-project.org/data/>`_, where you will find links to download 
 individual datasets.
 
-If you want to take a look at more complex recipes, or submit your own,
-check out the `yt Hub <http://hub.yt-project.org>`_.
-
 .. note:: To contribute your own recipes, please follow the instructions 
     on how to contribute documentation code: :ref:`writing_documentation`.
 

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/light_cone_projection.py
--- a/doc/source/cookbook/light_cone_projection.py
+++ b/doc/source/cookbook/light_cone_projection.py
@@ -1,9 +1,13 @@
-from yt.mods import *
-from yt.analysis_modules.api import LightCone
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
+import yt
+from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone
 
 # Create a LightCone object extending from z = 0 to z = 0.1
 # with a 600 arcminute field of view and a resolution of
 # 60 arcseconds.
+
 # We have already set up the redshift dumps to be
 # used for this, so we will not use any of the time
 # data dumps.

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/light_cone_with_halo_mask.py
--- a/doc/source/cookbook/light_cone_with_halo_mask.py
+++ b/doc/source/cookbook/light_cone_with_halo_mask.py
@@ -1,7 +1,10 @@
-from yt.mods import *
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
 
-from yt.analysis_modules.api import LightCone
-from yt.analysis_modules.halo_profiler.api import *
+import yt
+
+from yt.analysis_modules.cosmological_observation.light_cone.light_cone import LightCone
+from yt.analysis_modules.halo_profiler.api import HaloProfiler
 
 # Instantiate a light cone object as usual.
 lc = LightCone('enzo_tiny_cosmology/32Mpc_32.enzo',

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/make_light_ray.py
--- a/doc/source/cookbook/make_light_ray.py
+++ b/doc/source/cookbook/make_light_ray.py
@@ -1,13 +1,16 @@
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
 import os
 import sys
-
-from yt.mods import *
-
-from yt.analysis_modules.halo_profiler.api import *
-from yt.analysis_modules.cosmological_observation.light_ray.api import \
+import yt
+from yt.analysis_modules.halo_profiler.api import HaloProfiler
+from yt.analysis_modules.cosmological_observation.light_ray.light_ray import \
      LightRay
 
-if not os.path.isdir("LR"): os.mkdir('LR')
+# Create a directory for the light rays
+if not os.path.isdir("LR"): 
+    os.mkdir('LR')
      
 # Create a LightRay object extending from z = 0 to z = 0.1
 # and use only the redshift dumps.

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/multi_plot_3x2_FRB.py
--- a/doc/source/cookbook/multi_plot_3x2_FRB.py
+++ b/doc/source/cookbook/multi_plot_3x2_FRB.py
@@ -1,12 +1,14 @@
-from yt.mods import * # set up our namespace
+import yt
+import numpy as np
+from yt.visualization.api import get_multi_plot
 import matplotlib.colorbar as cb
 from matplotlib.colors import LogNorm
 
 fn = "Enzo_64/RD0006/RedshiftOutput0006" # parameter file to load
 
-
-pf = load(fn) # load data
-v, c = pf.h.find_max("density")
+# load data and get center value and center location as maximum density location
+ds = yt.load(fn) 
+v, c = ds.find_max("density")
 
 # set up our Fixed Resolution Buffer parameters: a width, resolution, and center
 width = (1.0, 'unitary')
@@ -28,7 +30,7 @@
 # over the columns, which will become axes of slicing.
 plots = []
 for ax in range(3):
-    sli = pf.slice(ax, c[ax])
+    sli = ds.slice(ax, c[ax])
     frb = sli.to_frb(width, res)
     den_axis = axes[ax][0]
     temp_axis = axes[ax][1]
@@ -39,11 +41,16 @@
         ax.xaxis.set_visible(False)
         ax.yaxis.set_visible(False)
 
-    plots.append(den_axis.imshow(frb['density'], norm=LogNorm()))
+    # converting our fixed resolution buffers to NDarray so matplotlib can
+    # render them
+    dens = np.array(frb['density'])
+    temp = np.array(frb['temperature'])
+
+    plots.append(den_axis.imshow(dens, norm=LogNorm()))
     plots[-1].set_clim((5e-32, 1e-29))
     plots[-1].set_cmap("bds_highcontrast")
 
-    plots.append(temp_axis.imshow(frb['temperature'], norm=LogNorm()))
+    plots.append(temp_axis.imshow(temp, norm=LogNorm()))
     plots[-1].set_clim((1e3, 1e8))
     plots[-1].set_cmap("hot")
     
@@ -60,4 +67,4 @@
     cbar.set_label(t)
 
 # And now we're done!  
-fig.savefig("%s_3x2.png" % pf)
+fig.savefig("%s_3x2.png" % ds)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/multi_plot_slice_and_proj.py
--- a/doc/source/cookbook/multi_plot_slice_and_proj.py
+++ b/doc/source/cookbook/multi_plot_slice_and_proj.py
@@ -1,4 +1,5 @@
-from yt.mods import * # set up our namespace
+import yt
+import numpy as np
 from yt.visualization.base_plot_types import get_multi_plot
 import matplotlib.colorbar as cb
 from matplotlib.colors import LogNorm
@@ -6,7 +7,7 @@
 fn = "GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150" # parameter file to load
 orient = 'horizontal'
 
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 # There's a lot in here:
 #   From this we get a containing figure, a list-of-lists of axes into which we
@@ -17,12 +18,11 @@
 #   bw is the base-width in inches, but 4 is about right for most cases.
 fig, axes, colorbars = get_multi_plot(3, 2, colorbar=orient, bw = 4)
 
-slc = pf.slice(2, 0.0, fields=["density","temperature","velocity_magnitude"], 
-                 center=pf.domain_center)
-proj = pf.proj("density", 2, weight_field="density", center=pf.domain_center)
+slc = yt.SlicePlot(ds, 'z', fields=["density","temperature","velocity_magnitude"])
+proj = yt.ProjectionPlot(ds, 'z', "density", weight_field="density")
 
-slc_frb = slc.to_frb((1.0, "mpc"), 512)
-proj_frb = proj.to_frb((1.0, "mpc"), 512)
+slc_frb = slc.data_source.to_frb((1.0, "Mpc"), 512)
+proj_frb = proj.data_source.to_frb((1.0, "Mpc"), 512)
 
 dens_axes = [axes[0][0], axes[1][0]]
 temp_axes = [axes[0][1], axes[1][1]]
@@ -37,12 +37,22 @@
     vax.xaxis.set_visible(False)
     vax.yaxis.set_visible(False)
 
-plots = [dens_axes[0].imshow(slc_frb["density"], origin='lower', norm=LogNorm()),
-         dens_axes[1].imshow(proj_frb["density"], origin='lower', norm=LogNorm()),
-         temp_axes[0].imshow(slc_frb["temperature"], origin='lower'),    
-         temp_axes[1].imshow(proj_frb["temperature"], origin='lower'),
-         vels_axes[0].imshow(slc_frb["velocity_magnitude"], origin='lower', norm=LogNorm()),
-         vels_axes[1].imshow(proj_frb["velocity_magnitude"], origin='lower', norm=LogNorm())]
+# Converting our Fixed Resolution Buffers to numpy arrays so that matplotlib
+# can render them
+
+slc_dens = np.array(slc_frb['density'])
+proj_dens = np.array(proj_frb['density'])
+slc_temp = np.array(slc_frb['temperature'])
+proj_temp = np.array(proj_frb['temperature'])
+slc_vel = np.array(slc_frb['velocity_magnitude'])
+proj_vel = np.array(proj_frb['velocity_magnitude'])
+
+plots = [dens_axes[0].imshow(slc_dens, origin='lower', norm=LogNorm()),
+         dens_axes[1].imshow(proj_dens, origin='lower', norm=LogNorm()),
+         temp_axes[0].imshow(slc_temp, origin='lower'),    
+         temp_axes[1].imshow(proj_temp, origin='lower'),
+         vels_axes[0].imshow(slc_vel, origin='lower', norm=LogNorm()),
+         vels_axes[1].imshow(proj_vel, origin='lower', norm=LogNorm())]
          
 plots[0].set_clim((1.0e-27,1.0e-25))
 plots[0].set_cmap("bds_highcontrast")
@@ -58,12 +68,12 @@
 plots[5].set_cmap("gist_rainbow")
 
 titles=[r'$\mathrm{Density}\ (\mathrm{g\ cm^{-3}})$', 
-        r'$\mathrm{temperature}\ (\mathrm{K})$',
-        r'$\mathrm{VelocityMagnitude}\ (\mathrm{cm\ s^{-1}})$']
+        r'$\mathrm{Temperature}\ (\mathrm{K})$',
+        r'$\mathrm{Velocity Magnitude}\ (\mathrm{cm\ s^{-1}})$']
 
 for p, cax, t in zip(plots[0:6:2], colorbars, titles):
     cbar = fig.colorbar(p, cax=cax, orientation=orient)
     cbar.set_label(t)
 
 # And now we're done! 
-fig.savefig("%s_3x2" % pf)
+fig.savefig("%s_3x2" % ds)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/multi_width_image.py
--- a/doc/source/cookbook/multi_width_image.py
+++ b/doc/source/cookbook/multi_width_image.py
@@ -1,15 +1,16 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a slice plot for the dataset.  With no additional arguments,
 # the width will be the size of the domain and the center will be the
 # center of the simulation box
-slc = SlicePlot(pf,2,'density')
+slc = yt.SlicePlot(ds, 'z', 'density')
 
-# Create a list of a couple of widths and units.
-widths = [(1, 'mpc'),
+# Create a list of a couple of widths and units. 
+# (N.B. Mpc (megaparsec) != mpc (milliparsec)
+widths = [(1, 'Mpc'),
           (15, 'kpc')]
 
 # Loop through the list of widths and units.
@@ -19,12 +20,12 @@
     slc.set_width(width, unit)
 
     # Write out the image with a unique name.
-    slc.save("%s_%010d_%s" % (pf, width, unit))
+    slc.save("%s_%010d_%s" % (ds, width, unit))
 
 zoomFactors = [2,4,5]
 
 # recreate the original slice
-slc = SlicePlot(pf,2,'density')
+slc = yt.SlicePlot(ds, 'z', 'density')
 
 for zoomFactor in zoomFactors:
 
@@ -32,4 +33,4 @@
     slc.zoom(zoomFactor)
 
     # Write out the image with a unique name.
-    slc.save("%s_%i" % (pf, zoomFactor))
+    slc.save("%s_%i" % (ds, zoomFactor))

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/multiplot_2x2.py
--- a/doc/source/cookbook/multiplot_2x2.py
+++ b/doc/source/cookbook/multiplot_2x2.py
@@ -1,9 +1,9 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 from mpl_toolkits.axes_grid1 import AxesGrid
 
 fn = "IsolatedGalaxy/galaxy0030/galaxy0030"
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 fig = plt.figure()
 
@@ -22,11 +22,16 @@
                 cbar_size="3%",
                 cbar_pad="0%")
 
-fields = ['density', 'velocity_x', 'velocity_y', 'VelocityMagnitude']
+fields = ['density', 'velocity_x', 'velocity_y', 'velocity_magnitude']
 
 # Create the plot.  Since SlicePlot accepts a list of fields, we need only
 # do this once.
-p = SlicePlot(pf, 'z', fields)
+p = yt.SlicePlot(ds, 'z', fields)
+
+# Velocity is going to be both positive and negative, so let's make these
+# slices linear
+p.set_log('velocity_x', False)
+p.set_log('velocity_y', False)
 p.zoom(2)
 
 # For each plotted field, force the SlicePlot to redraw itself onto the AxesGrid

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/multiplot_2x2_coordaxes_slice.py
--- a/doc/source/cookbook/multiplot_2x2_coordaxes_slice.py
+++ b/doc/source/cookbook/multiplot_2x2_coordaxes_slice.py
@@ -1,9 +1,9 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 from mpl_toolkits.axes_grid1 import AxesGrid
 
 fn = "IsolatedGalaxy/galaxy0030/galaxy0030"
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 fig = plt.figure()
 
@@ -27,7 +27,7 @@
 
 for i, (direction, field) in enumerate(zip(cuts, fields)):
     # Load the data and create a single plot
-    p = SlicePlot(pf, direction, field)
+    p = yt.SlicePlot(ds, direction, field)
     p.zoom(40)
 
     # This forces the ProjectionPlot to redraw itself on the AxesGrid axes.

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/multiplot_2x2_time_series.py
--- a/doc/source/cookbook/multiplot_2x2_time_series.py
+++ b/doc/source/cookbook/multiplot_2x2_time_series.py
@@ -1,4 +1,4 @@
-from yt.mods import *
+import yt
 import matplotlib.pyplot as plt
 from mpl_toolkits.axes_grid1 import AxesGrid
 
@@ -23,8 +23,8 @@
 
 for i, fn in enumerate(fns):
     # Load the data and create a single plot
-    pf = load(fn) # load data
-    p = ProjectionPlot(pf, 'z', 'density', width=(55, 'Mpccm'))
+    ds = yt.load(fn) # load data
+    p = yt.ProjectionPlot(ds, 'z', 'density', width=(55, 'Mpccm'))
 
     # Ensure the colorbar limits match for all plots
     p.set_zlim('density', 1e-4, 1e-2)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/offaxis_projection.py
--- a/doc/source/cookbook/offaxis_projection.py
+++ b/doc/source/cookbook/offaxis_projection.py
@@ -1,7 +1,8 @@
-from yt.mods import *
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Choose a center for the render.
 c = [0.5, 0.5, 0.5]
@@ -25,10 +26,10 @@
 # Create the off axis projection.
 # Setting no_ghost to False speeds up the process, but makes a
 # slighly lower quality image.
-image = off_axis_projection(pf, c, L, W, Npixels, "density", no_ghost=False)
+image = yt.off_axis_projection(ds, c, L, W, Npixels, "density", no_ghost=False)
 
 # Write out the final image and give it a name
 # relating to what our dataset is called.
 # We save the log of the values so that the colors do not span
 # many orders of magnitude.  Try it without and see what happens.
-write_image(np.log10(image), "%s_offaxis_projection.png" % pf)
+yt.write_image(np.log10(image), "%s_offaxis_projection.png" % ds)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/offaxis_projection_colorbar.py
--- a/doc/source/cookbook/offaxis_projection_colorbar.py
+++ b/doc/source/cookbook/offaxis_projection_colorbar.py
@@ -1,8 +1,9 @@
-from yt.mods import * # set up our namespace
+import yt
+import numpy as np
 
 fn = "IsolatedGalaxy/galaxy0030/galaxy0030" # parameter file to load
 
-pf = load(fn) # load data
+ds = yt.load(fn) # load data
 
 # Now we need a center of our volume to render.  Here we'll just use
 # 0.5,0.5,0.5, because volume renderings are not periodic.
@@ -31,9 +32,9 @@
 # Also note that we set the field which we want to project as "density", but
 # really we could use any arbitrary field like "temperature", "metallicity"
 # or whatever.
-image = off_axis_projection(pf, c, L, W, Npixels, "density", no_ghost=False)
+image = yt.off_axis_projection(ds, c, L, W, Npixels, "density", no_ghost=False)
 
 # Image is now an NxN array representing the intensities of the various pixels.
 # And now, we call our direct image saver.  We save the log of the result.
-write_projection(image, "offaxis_projection_colorbar.png", 
-                 colorbar_label="Column Density (cm$^{-2}$)")
+yt.write_projection(image, "offaxis_projection_colorbar.png", 
+                    colorbar_label="Column Density (cm$^{-2}$)")

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/opaque_rendering.py
--- a/doc/source/cookbook/opaque_rendering.py
+++ b/doc/source/cookbook/opaque_rendering.py
@@ -1,20 +1,15 @@
-## Opaque Volume Rendering
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
 
-# The new version of yt also features opaque rendering, using grey opacity.
-# For example, this makes blues opaque to red and green.  In this example we
-# will explore how the opacity model you choose changes the appearance of the
-# rendering.
+import yt
+import numpy as np
 
-# Here we start by loading up a dataset, in this case galaxy0030.
-
-from yt.mods import *
-
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # We start by building a transfer function, and initializing a camera.
 
-tf = ColorTransferFunction((-30, -22))
-cam = pf.h.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256, tf)
+tf = yt.ColorTransferFunction((-30, -22))
+cam = ds.camera([0.5, 0.5, 0.5], [0.2, 0.3, 0.4], 0.10, 256, tf)
 
 # Now let's add some isocontours, and take a snapshot.
 
@@ -66,5 +61,3 @@
 
 # That looks pretty different, but the main thing is that you can see that the
 # inner contours are somewhat visible again.  
-
-

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/overplot_grids.py
--- a/doc/source/cookbook/overplot_grids.py
+++ b/doc/source/cookbook/overplot_grids.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Make a density projection.
-p = ProjectionPlot(pf, "y", "density")
+p = yt.ProjectionPlot(ds, "y", "density")
 
 # Modify the projection
 # The argument specifies the region along the line of sight

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/overplot_particles.py
--- a/doc/source/cookbook/overplot_particles.py
+++ b/doc/source/cookbook/overplot_particles.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Make a density projection.
-p = ProjectionPlot(pf, "y", "density")
+p = yt.ProjectionPlot(ds, "y", "density")
 
 # Modify the projection
 # The argument specifies the region along the line of sight

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/profile_with_variance.py
--- a/doc/source/cookbook/profile_with_variance.py
+++ b/doc/source/cookbook/profile_with_variance.py
@@ -1,30 +1,34 @@
-from matplotlib import pyplot
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
 
-from yt.mods import *
+import matplotlib.pyplot as plt
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
-# Create a sphere of radius 1000 kpc centered on the max density.
-sphere = pf.sphere("max", (1000, "kpc"))
+# Create a sphere of radius 1 Mpc centered on the max density location.
+sp = ds.sphere("max", (1, "Mpc"))
 
 # Calculate and store the bulk velocity for the sphere.
-bulk_velocity = sphere.quantities['BulkVelocity']()
-sphere.set_field_parameter('bulk_velocity', bulk_velocity)
+bulk_velocity = sp.quantities['BulkVelocity']()
+sp.set_field_parameter('bulk_velocity', bulk_velocity)
 
 # Create a 1D profile object for profiles over radius
 # and add a velocity profile.
-profile = BinnedProfile1D(sphere, 100, "Radiuskpc", 0.1, 1000.)
-profile.add_fields('VelocityMagnitude')
+prof = yt.ProfilePlot(sp, 'radius', 'velocity_magnitude', 
+                      weight_field='cell_mass')
+prof.set_unit('radius', 'kpc')
+prof.set_xlim(0.1, 1000)
 
 # Plot the average velocity magnitude.
-pyplot.loglog(profile['Radiuskpc'], profile['VelocityMagnitude'],
-              label='mean')
+plt.loglog(prof['radius'], prof['velocity_magnitude'],
+              label='Mean')
 # Plot the variance of the velocity madnitude.
-pyplot.loglog(profile['Radiuskpc'], profile['VelocityMagnitude_std'],
-              label='std')
-pyplot.xlabel('r [kpc]')
-pyplot.ylabel('v [cm/s]')
-pyplot.legend()
+plt.loglog(prof['radius'], prof['velocity_magnitude_std'],
+              label='Standard Deviation')
+plt.xlabel('r [kpc]')
+plt.ylabel('v [cm/s]')
+plt.legend()
 
-pyplot.savefig('velocity_profiles.png')
+plt.savefig('velocity_profiles.png')

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/rad_velocity.py
--- a/doc/source/cookbook/rad_velocity.py
+++ b/doc/source/cookbook/rad_velocity.py
@@ -1,32 +1,38 @@
-from yt.mods import *
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
+import yt
 import matplotlib.pyplot as plt
 
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Get the first sphere
-
-sphere0 = pf.sphere(pf.domain_center, (500., "kpc"))
+sp0 = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Compute the bulk velocity from the cells in this sphere
+bulk_vel = sp0.quantities["BulkVelocity"]()
 
-bulk_vel = sphere0.quantities["BulkVelocity"]()
 
 # Get the second sphere
-
-sphere1 = pf.sphere(pf.domain_center, (500., "kpc"))
+sp1 = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Set the bulk velocity field parameter 
-sphere1.set_field_parameter("bulk_velocity", bulk_vel)
+sp1.set_field_parameter("bulk_velocity", bulk_vel)
 
 # Radial profile without correction
 
-rad_profile0 = BinnedProfile1D(sphere0, 100, "Radiuskpc", 0.0, 500., log_space=False)
-rad_profile0.add_fields("RadialVelocity")
+rp0 = yt.ProfilePlot(sp0, 'radius', 'radial_velocity')
+rp0.set_unit('radius', 'kpc')
+rp0.set_log('radius', False)
 
 # Radial profile with correction for bulk velocity
 
-rad_profile1 = BinnedProfile1D(sphere1, 100, "Radiuskpc", 0.0, 500., log_space=False)
-rad_profile1.add_fields("RadialVelocity")
+rp1 = yt.ProfilePlot(sp1, 'radius', 'radial_velocity')
+rp1.set_unit('radius', 'kpc')
+rp1.set_log('radius', False)
+
+#rp0.save('radial_velocity_profile_uncorrected.png')
+#rp1.save('radial_velocity_profile_corrected.png')
 
 # Make a plot using matplotlib
 
@@ -41,4 +47,4 @@
 ax.set_ylabel(r"$\mathrm{v_r\ (km/s)}$")
 ax.legend(["Without Correction", "With Correction"])
 
-fig.savefig("%s_profiles.png" % pf)
\ No newline at end of file
+fig.savefig("%s_profiles.png" % ds)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/radial_profile_styles.py
--- a/doc/source/cookbook/radial_profile_styles.py
+++ b/doc/source/cookbook/radial_profile_styles.py
@@ -1,16 +1,22 @@
-from yt.mods import *
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
+import yt
 import matplotlib.pyplot as plt
 
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Get a sphere object
 
-sphere = pf.sphere(pf.domain_center, (500., "kpc"))
+sp = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Bin up the data from the sphere into a radial profile
 
-rad_profile = BinnedProfile1D(sphere, 100, "Radiuskpc", 0.0, 500., log_space=False)
-rad_profile.add_fields("density","temperature")
+#rp = BinnedProfile1D(sphere, 100, "Radiuskpc", 0.0, 500., log_space=False)
+#rp.add_fields("density","temperature")
+rp = yt.ProfilePlot(sp, 'radius', ['density', 'temperature'])
+rp.set_unit('radius', 'kpc')
+rp.set_log('radius', False)
 
 # Make plots using matplotlib
 
@@ -18,7 +24,7 @@
 ax = fig.add_subplot(111)
 
 # Plot the density as a log-log plot using the default settings
-dens_plot = ax.loglog(rad_profile["Radiuskpc"], rad_profile["density"])
+dens_plot = ax.loglog(rp["Radiuskpc"], rp["density"])
 
 # Here we set the labels of the plot axes
 
@@ -27,7 +33,7 @@
 
 # Save the default plot
 
-fig.savefig("density_profile_default.png" % pf)
+fig.savefig("density_profile_default.png" % ds)
 
 # The "dens_plot" object is a list of plot objects. In our case we only have one,
 # so we index the list by '0' to get it. 
@@ -51,10 +57,10 @@
 
 ax.lines = []
 
-# Since the rad_profile object also includes the standard deviation in each bin,
+# Since the radial profile object also includes the standard deviation in each bin,
 # we'll use these as errorbars. We have to make a new plot for this:
 
-dens_err_plot = ax.errorbar(rad_profile["Radiuskpc"], rad_profile["density"],
-                            yerr=rad_profile["Density_std"])
+dens_err_plot = ax.errorbar(pr["Radiuskpc"], rp["density"],
+                            yerr=rp["Density_std"])
                                                         
-fig.savefig("density_profile_with_errorbars.png")
\ No newline at end of file
+fig.savefig("density_profile_with_errorbars.png")

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/rendering_with_box_and_grids.py
--- a/doc/source/cookbook/rendering_with_box_and_grids.py
+++ b/doc/source/cookbook/rendering_with_box_and_grids.py
@@ -1,18 +1,22 @@
-from yt.mods import *
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Create a data container (like a sphere or region) that
 # represents the entire domain.
-dd = pf.h.all_data()
+ad = ds.all_data()
 
 # Get the minimum and maximum densities.
-mi, ma = dd.quantities["Extrema"]("density")[0]
+mi, ma = ad.quantities.extrema("density")
 
 # Create a transfer function to map field values to colors.
 # We bump up our minimum to cut out some of the background fluid
-tf = ColorTransferFunction((np.log10(mi)+2.0, np.log10(ma)))
+tf = yt.ColorTransferFunction((np.log10(mi)+2.0, np.log10(ma)))
 
 # Add three guassians, evenly spaced between the min and
 # max specified above with widths of 0.02 and using the
@@ -37,25 +41,24 @@
 # Create a camera object.
 # This object creates the images and
 # can be moved and rotated.
-cam = pf.h.camera(c, L, W, Npixels, tf)
+cam = ds.camera(c, L, W, Npixels, tf)
 
 # Create a snapshot.
 # The return value of this function could also be accepted, modified (or saved
 # for later manipulation) and then put written out using write_bitmap.
 # clip_ratio applies a maximum to the function, which is set to that value
 # times the .std() of the array.
-im = cam.snapshot("%s_volume_rendered.png" % pf, clip_ratio=8.0)
+im = cam.snapshot("%s_volume_rendered.png" % ds, clip_ratio=8.0)
 
 # Add the domain edges, with an alpha blending of 0.3:
 nim = cam.draw_domain(im, alpha=0.3)
-nim.write_png('%s_vr_domain.png' % pf)
+nim.write_png('%s_vr_domain.png' % ds)
 
 # Add the grids, colored by the grid level with the algae colormap
 nim = cam.draw_grids(im, alpha=0.3, cmap='algae')
-nim.write_png('%s_vr_grids.png' % pf)
+nim.write_png('%s_vr_grids.png' % ds)
 
 # Here we can draw the coordinate vectors on top of the image by processing
 # it through the camera. Then save it out.
 cam.draw_coordinate_vectors(nim)
-nim.write_png("%s_vr_vectors.png" % pf)
-
+nim.write_png("%s_vr_vectors.png" % ds)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/save_profiles.py
--- a/doc/source/cookbook/save_profiles.py
+++ b/doc/source/cookbook/save_profiles.py
@@ -1,28 +1,31 @@
-from yt.mods import *
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
+import yt
 import matplotlib.pyplot as plt
-import h5py
+import h5py as h5
 
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Get a sphere
 
-sp = pf.sphere(pf.domain_center, (500., "kpc"))
+sp = ds.sphere(ds.domain_center, (500., "kpc"))
 
 # Radial profile from the sphere
 
-rad_profile = BinnedProfile1D(sp, 100, "Radiuskpc", 0.0, 500., log_space=False)
-
-# Adding density and temperature fields to the profile
-
-rad_profile.add_fields(["density","temperature"])
+prof = yt.BinnedProfile1D(sp, 100, "Radiuskpc", 0.0, 500., log_space=False)
+prof = yt.ProfilePlot(sp, 'radius', ['density', 'temperature'], weight_field="cell_mass")
+prof.set_unit('radius', 'kpc')
+prof.set_log('radius', False)
+prof.set_xlim(0, 500)
 
 # Write profiles to ASCII file
 
-rad_profile.write_out("%s_profile.dat" % pf, bin_style="center")
+prof.write_out("%s_profile.dat" % ds, bin_style="center")
 
 # Write profiles to HDF5 file
 
-rad_profile.write_out_h5("%s_profile.h5" % pf, bin_style="center")
+prof.write_out_h5("%s_profile.h5" % ds, bin_style="center")
 
 # Now we will show how using NumPy, h5py, and Matplotlib the data in these
 # files may be plotted.
@@ -42,13 +45,13 @@
 ax.set_xlabel(r"$\mathrm{r\ (kpc)}$")
 ax.set_ylabel(r"$\mathrm{\rho\ (g\ cm^{-3})}$")
 ax.set_title("Density vs. Radius")
-fig1.savefig("%s_dens.png" % pf)
+fig1.savefig("%s_dens.png" % ds)
 
 # Plot temperature from HDF5 file
 
 # Get the file handle
 
-f = h5py.File("%s_profile.h5" % pf, "r")
+f = h5py.File("%s_profile.h5" % ds, "r")
 
 # Get the radius and temperature arrays from the file handle
 
@@ -66,4 +69,4 @@
 ax.set_xlabel(r"$\mathrm{r\ (kpc)}$")
 ax.set_ylabel(r"$\mathrm{T\ (K)}$")
 ax.set_title("temperature vs. Radius")
-fig2.savefig("%s_temp.png" % pf)
+fig2.savefig("%s_temp.png" % ds)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/show_hide_axes_colorbar.py
--- a/doc/source/cookbook/show_hide_axes_colorbar.py
+++ b/doc/source/cookbook/show_hide_axes_colorbar.py
@@ -1,8 +1,8 @@
-from yt.mods import *
+import yt
 
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
-slc = SlicePlot(pf, "x", "density")
+slc = yt.SlicePlot(ds, "x", "density")
 
 slc.save("default_sliceplot.png")
 

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_contour_in_slice.py
--- a/doc/source/cookbook/simple_contour_in_slice.py
+++ b/doc/source/cookbook/simple_contour_in_slice.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the data file.
-pf = load("Sedov_3d/sedov_hdf5_chk_0002")
+ds = yt.load("Sedov_3d/sedov_hdf5_chk_0002")
 
 # Make a traditional slice plot.
-sp = SlicePlot(pf,"x","density")
+sp = yt.SlicePlot(ds, "x", "density")
 
 # Overlay the slice plot with thick red contours of density.
 sp.annotate_contour("density", ncont=3, clim=(1e-2,1e-1), label=True,

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_off_axis_projection.py
--- a/doc/source/cookbook/simple_off_axis_projection.py
+++ b/doc/source/cookbook/simple_off_axis_projection.py
@@ -1,12 +1,12 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a 1 kpc radius sphere, centered on the max density.  Note that this
 # sphere is very small compared to the size of our final plot, and it has a
 # non-axially aligned L vector.
-sp = pf.sphere("center", (15.0, "kpc"))
+sp = ds.sphere("center", (15.0, "kpc"))
 
 # Get the angular momentum vector for the sphere.
 L = sp.quantities["AngularMomentumVector"]()
@@ -14,5 +14,5 @@
 print "Angular momentum vector: {0}".format(L)
 
 # Create an OffAxisSlicePlot on the object with the L vector as its normal
-p = OffAxisProjectionPlot(pf, L, "density", sp.center, (25, "kpc"))
+p = yt.OffAxisProjectionPlot(ds, L, "density", sp.center, (25, "kpc"))
 p.save()

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_pdf.py
--- a/doc/source/cookbook/simple_pdf.py
+++ b/doc/source/cookbook/simple_pdf.py
@@ -1,14 +1,14 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
+ds = yt.load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
 
 # Create a data object that represents the whole box.
-ad = pf.h.all_data()
+ad = ds.h.all_data()
 
 # This is identical to the simple phase plot, except we supply 
 # the fractional=True keyword to divide the profile data by the sum. 
-plot = PhasePlot(ad, "density", "temperature", "cell_mass",
+plot = yt.PhasePlot(ad, "density", "temperature", "cell_mass",
                  weight_field=None, fractional=True)
 
 # Set a new title for the colorbar since it is now fractional.

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_phase.py
--- a/doc/source/cookbook/simple_phase.py
+++ b/doc/source/cookbook/simple_phase.py
@@ -1,18 +1,21 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a sphere of radius 100 kpc in the center of the domain.
-my_sphere = pf.sphere("c", (100.0, "kpc"))
+my_sphere = ds.sphere("c", (100.0, "kpc"))
 
 # Create a PhasePlot object.
 # Setting weight to None will calculate a sum.
 # Setting weight to a field will calculate an average
 # weighted by that field.
-plot = PhasePlot(my_sphere, "density", "temperature", "cell_mass",
+plot = yt.PhasePlot(my_sphere, "density", "temperature", "cell_mass",
                  weight_field=None)
 
+# Set the units of mass to be in solar masses (not the default in cgs)
+plot.set_unit('cell_mass', 'Msun')
+
 # Save the image.
 # Optionally, give a string as an argument
 # to name files with a keyword.

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_plots.rst
--- a/doc/source/cookbook/simple_plots.rst
+++ b/doc/source/cookbook/simple_plots.rst
@@ -8,11 +8,26 @@
 Simple Slices
 ~~~~~~~~~~~~~
 
-This script shows the simplest way to make a slice from the scripting
-interface.
+This script shows the simplest way to make a slice through a dataset.
 
 .. yt_cookbook:: simple_slice.py
 
+Simple Projections
+~~~~~~~~~~~~~~~~~~
+
+This is the simplest way to make a projection through a dataset.
+
+.. yt_cookbook:: simple_projection.py
+
+Simple Phase Plots
+~~~~~~~~~~~~~~~~~~
+
+This demonstrates how to make a phase plot.  Phase plots can be thought of as
+two-dimensional histograms, where the value is either the weighted-average or
+the total accumulation in a cell.
+
+.. yt_cookbook:: simple_phase.py
+
 Simple Probability Distribution Functions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -22,24 +37,23 @@
 
 .. yt_cookbook:: simple_pdf.py
 
-Simple Phase Plots
-~~~~~~~~~~~~~~~~~~
+Simple 1D Histograms (Profiles)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-This demonstrates how to make a phase plot.  Phase plots can be thought of as
-two-dimensional histograms, where the value is either the weighted-average or
-the total accumulation in a cell.
-
-.. yt_cookbook:: simple_phase.py
-
-Simple 1D Histograms
-~~~~~~~~~~~~~~~~~~~~
-
-This is a "profile," which is a 1D profile.  This can be thought of as either
+This is a "profile," which is a 1D histogram.  This can be thought of as either
 the total accumulation (when weight_field is set to ``None``) or the average 
 (when a weight_field is supplied.)
 
 .. yt_cookbook:: simple_profile.py
 
+Simple Radial Profiles
+~~~~~~~~~~~~~~~~~~~~~~
+
+This shows how to make a profile of a quantity with respect to the radius, in
+this case the radius in Mpc.
+
+.. yt_cookbook:: simple_radial_profile.py
+
 1D Profiles Over Time
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -48,21 +62,6 @@
 
 .. yt_cookbook:: time_series_profiles.py
 
-Simple Projections
-~~~~~~~~~~~~~~~~~~
-
-This is the simplest way to make a projection through a dataset.
-
-.. yt_cookbook:: simple_projection.py
-
-Simple Radial Profiles
-~~~~~~~~~~~~~~~~~~~~~~
-
-This shows how to make a profile of a quantity with respect to the radius, in
-this case the radius in Mpc.
-
-.. yt_cookbook:: simple_radial_profile.py
-
 .. _cookbook-profile-variance:
 
 Profiles with Variance Values
@@ -85,6 +84,32 @@
 
 .. yt_cookbook:: simple_slice_with_multiple_fields.py 
 
+Off-Axis Slicing
+~~~~~~~~~~~~~~~~
+
+A cutting plane allows you to slice at some angle that isn't aligned with the
+axes.
+
+.. yt_cookbook:: aligned_cutting_plane.py
+
+.. _cookbook-simple-off-axis-projection:
+
+Off-Axis Projection
+~~~~~~~~~~~~~~~~~~~
+
+Like cutting planes, off-axis projections can be created from any arbitrary 
+viewing angle.
+
+.. yt_cookbook:: simple_off_axis_projection.py
+
+Simple Volume Rendering
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Volume renderings are 3D projections rendering isocontours in any arbitrary
+field (e.g. density, temperature, pressure, etc.)
+
+.. yt_cookbook:: simple_volume_rendering.py
+
 Showing and Hiding Axes Labels and Colorbars
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -104,37 +129,11 @@
 
 .. yt_cookbook:: simple_slice_matplotlib_example.py 
 
-Off-Axis Slicing
-~~~~~~~~~~~~~~~~
-
-A cutting plane allows you to slice at some angle that isn't aligned with the
-axes.
-
-.. yt_cookbook:: aligned_cutting_plane.py
-
-.. _cookbook-simple-off-axis-projection:
-
-Off-Axis Projection
-~~~~~~~~~~~~~~~~~~~
-
-Here we see how to make a off axis projection through a dataset.
-
-.. yt_cookbook:: simple_off_axis_projection.py
-
 .. _cookbook-simple_volume_rendering:
 
-Simple Volume Rendering
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Here we see how to make a very simple volume rendering, where each option is
-considered in turn.
-
-.. yt_cookbook:: simple_volume_rendering.py
-
 Image Background Colors
 ~~~~~~~~~~~~~~~~~~~~~~~
 
 Here we see how to take an image and save it using different background colors. 
 
 .. yt_cookbook:: image_background_colors.py
-

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_profile.py
--- a/doc/source/cookbook/simple_profile.py
+++ b/doc/source/cookbook/simple_profile.py
@@ -1,14 +1,17 @@
-from yt.mods import *
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a 1D profile within a sphere of radius 100 kpc
 # of the average temperature and average velocity_x 
 # vs. density, weighted by mass.
-sphere = pf.sphere("c", (100., "kpc"))
-plot = ProfilePlot(sphere, "density", ["temperature", "velocity_x"],
-                   weight_field="cell_mass")
+sphere = ds.sphere("c", (100., "kpc"))
+plot = yt.ProfilePlot(sphere, "density", ["temperature", "velocity_x"],
+                      weight_field="cell_mass")
 
 # Save the image.
 # Optionally, give a string as an argument

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_projection.py
--- a/doc/source/cookbook/simple_projection.py
+++ b/doc/source/cookbook/simple_projection.py
@@ -1,10 +1,10 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
+ds = yt.load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
 
 # Create projections of the density-weighted mean density.
 
-ProjectionPlot(pf, "x", "density", weight_field = "density").save()
-ProjectionPlot(pf, "y", "density", weight_field = "density").save()
-ProjectionPlot(pf, "z", "density", weight_field = "density").save()
+yt.ProjectionPlot(ds, "x", "density", weight_field = "density").save()
+yt.ProjectionPlot(ds, "y", "density", weight_field = "density").save()
+yt.ProjectionPlot(ds, "z", "density", weight_field = "density").save()

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_radial_profile.py
--- a/doc/source/cookbook/simple_radial_profile.py
+++ b/doc/source/cookbook/simple_radial_profile.py
@@ -1,14 +1,17 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 # Create a sphere of radius 100 kpc in the center of the box.
-my_sphere = pf.sphere("c", (100.0, "kpc"))
+my_sphere = ds.sphere("c", (100.0, "kpc"))
 
 # Create a profile of the average density vs. radius.
-plot = ProfilePlot(my_sphere, "Radiuskpc", "density",
-                   weight_field="cell_mass")
+plot = yt.ProfilePlot(my_sphere, "radius", "density",
+                      weight_field="cell_mass")
+
+# Change the units of the radius into kpc (and not the default in cgs)
+plot.set_unit('radius', 'kpc')
 
 # Save the image.
 # Optionally, give a string as an argument

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_slice.py
--- a/doc/source/cookbook/simple_slice.py
+++ b/doc/source/cookbook/simple_slice.py
@@ -1,9 +1,9 @@
-from yt.mods import *
+import yt
 
 # Load the dataset.
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Create density slices in all three axes.
-SlicePlot(pf, 'x', "density", width = (800.0, 'kpc')).save()
-SlicePlot(pf, 'y', "density", width = (800.0, 'kpc')).save()
-SlicePlot(pf, 'z', "density", width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'x', "density", width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'y', "density", width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'z', "density", width = (800.0, 'kpc')).save()

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_slice_matplotlib_example.py
--- a/doc/source/cookbook/simple_slice_matplotlib_example.py
+++ b/doc/source/cookbook/simple_slice_matplotlib_example.py
@@ -1,10 +1,11 @@
-from yt.mods import *
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Create a slice object
-slc = SlicePlot(pf,'x','density',width=(800.0,'kpc'))
+slc = yt.SlicePlot(ds,'x','density',width=(800.0,'kpc'))
 
 # Get a reference to the matplotlib axes object for the plot
 ax = slc.plots['density'].axes
@@ -12,17 +13,23 @@
 # Let's adjust the x axis tick labels
 for label in ax.xaxis.get_ticklabels():
     label.set_color('red')
-    label.set_rotation(45)
     label.set_fontsize(16)
 
 # Get a reference to the matplotlib figure object for the plot
 fig = slc.plots['density'].figure
 
+# And create a mini-panel of a gaussian histogram inside the plot
 rect = (0.2,0.2,0.2,0.2)
 new_ax = fig.add_axes(rect)
 
 n, bins, patches = new_ax.hist(np.random.randn(1000)+20, 50,
-    facecolor='yellow', edgecolor='yellow')
-new_ax.set_xlabel('Dinosaurs per furlong')
+    facecolor='black', edgecolor='black')
+
+# Make sure its visible
+new_ax.tick_params(colors='white')
+
+# And label it
+la = new_ax.set_xlabel('Dinosaurs per furlong')
+la.set_color('white')
 
 slc.save()

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_slice_with_multiple_fields.py
--- a/doc/source/cookbook/simple_slice_with_multiple_fields.py
+++ b/doc/source/cookbook/simple_slice_with_multiple_fields.py
@@ -1,8 +1,11 @@
-from yt.mods import *
+### THIS RECIPE IS CURRENTLY BROKEN IN YT-3.0
+### DO NOT TRUST THIS RECIPE UNTIL THIS LINE IS REMOVED
+
+import yt
 
 # Load the dataset
-pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Create density slices of several fields along the x axis
-SlicePlot(pf, 'x', ['density','temperature','pressure','vorticity_squared'], 
-          width = (800.0, 'kpc')).save()
+yt.SlicePlot(ds, 'x', ['density','temperature','pressure','vorticity_squared'], 
+             width = (800.0, 'kpc')).save()

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simple_volume_rendering.py
--- a/doc/source/cookbook/simple_volume_rendering.py
+++ b/doc/source/cookbook/simple_volume_rendering.py
@@ -1,18 +1,19 @@
-from yt.mods import *
+import yt
+import numpy as np
 
 # Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+ds = yt.load("Enzo_64/DD0043/data0043")
 
 # Create a data container (like a sphere or region) that
 # represents the entire domain.
-dd = pf.h.all_data()
+ad = ds.h.all_data()
 
 # Get the minimum and maximum densities.
-mi, ma = dd.quantities["Extrema"]("density")[0]
+mi, ma = ad.quantities.extrema("density")
 
 # Create a transfer function to map field values to colors.
 # We bump up our minimum to cut out some of the background fluid
-tf = ColorTransferFunction((np.log10(mi)+1, np.log10(ma)))
+tf = yt.ColorTransferFunction((np.log10(mi)+1, np.log10(ma)))
 
 # Add three guassians, evenly spaced between the min and
 # max specified above with widths of 0.02 and using the
@@ -37,11 +38,11 @@
 # Create a camera object.
 # This object creates the images and
 # can be moved and rotated.
-cam = pf.h.camera(c, L, W, Npixels, tf)
+cam = ds.camera(c, L, W, Npixels, tf)
 
 # Create a snapshot.
 # The return value of this function could also be accepted, modified (or saved
 # for later manipulation) and then put written out using write_bitmap.
 # clip_ratio applies a maximum to the function, which is set to that value
 # times the .std() of the array.
-cam.snapshot("%s_volume_rendered.png" % pf, clip_ratio=8.0)
+cam.snapshot("%s_volume_rendered.png" % ds, clip_ratio=8.0)

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/simulation_analysis.py
--- a/doc/source/cookbook/simulation_analysis.py
+++ b/doc/source/cookbook/simulation_analysis.py
@@ -1,20 +1,28 @@
-from yt.mods import *
+import yt
+import collections
 
 # Instantiate a time series object for an Enzo simulation..
-my_sim = simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo')
+sim = yt.simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo')
 
 # Get a time series for all data made by the simulation.
-my_sim.get_time_series()
+sim.get_time_series()
 
-# Calculate and store extrema for all datasets.
-all_storage = {}
-for my_storage, pf in my_sim.piter(storage=all_storage):
-    all_data = pf.h.all_data()
-    my_extrema = all_data.quantities['Extrema']('density')
+# Calculate and store extrema for all datasets along with redshift
+# in a data dictionary with entries as tuples
 
-    # Save to storage so we can get at it afterward.
-    my_storage.result = my_extrema
+# Note that by using sim.piter(), we are automatically 
+# forcing yt to do this in parallel
+data = {}
+for ds in sim.piter():
+    ad = ds.all_data()
+    extrema = ad.quantities.extrema('density')
+    data[ds.basename] = (extrema, ds.current_redshift)
+
+# Convert dictionary to ordered dictionary to get the right order
+od = collections.OrderedDict(sorted(data.items()))
 
 # Print out all the values we calculated.
-for my_result in all_storage.values():
-    print my_result
+print "Dataset      Redshift        Density Min      Density Max"
+print "---------------------------------------------------------"
+for k, v in od.iteritems(): 
+    print "%s       %05.3f          %5.3g g/cm^3   %5.3g g/cm^3" % (k, v[1], v[0][0], v[0][1])

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/streamlines.py
--- a/doc/source/cookbook/streamlines.py
+++ b/doc/source/cookbook/streamlines.py
@@ -1,22 +1,40 @@
-from yt.mods import *
+import yt
+import numpy as np
 from yt.visualization.api import Streamlines
+import matplotlib.pylab as pl
+from mpl_toolkits.mplot3d import Axes3D
 
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-c = np.array([0.5]*3)
+# Load the dataset 
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# Define c: the center of the box, N: the number of streamlines, 
+# scale: the spatial scale of the streamlines relative to the boxsize,
+# and then pos: the random positions of the streamlines.
+c = ds.arr([0.5]*3, 'code_length')
 N = 100
-scale = 1.0
+scale = ds.arr(1.0, 'code_length')
 pos_dx = np.random.random((N,3))*scale-scale/2.
 pos = c+pos_dx
 
-streamlines = Streamlines(pf,pos,'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
+# Create the streamlines from these positions with the velocity fields as the 
+# fields to be traced
+streamlines = Streamlines(ds, pos, 'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
 streamlines.integrate_through_volume()
 
-import matplotlib.pylab as pl
-from mpl_toolkits.mplot3d import Axes3D
-fig=pl.figure() 
+# Create a 3D matplotlib figure for visualizing the streamlines
+fig = pl.figure() 
 ax = Axes3D(fig)
+
+# Trace the streamlines through the volume of the 3D figure
 for stream in streamlines.streamlines:
-    stream = stream[np.all(stream != 0.0, axis=1)]
-    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.1)
+    stream = stream[ np.all(stream != 0.0, axis=1)]
+
+    # Make the colors of each stream vary continuously from blue to red
+    # from low-x to high-x of the stream start position (each color is R, G, B)
+    color = (stream[0,0], 0, 1-stream[0,0])
+
+    # Plot the stream in 3D
+    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.3, color=color)
+
+# Save the figure
 pl.savefig('streamlines.png')
-

diff -r 462244d11e3315d3098cc411cf7a9cd0b824764e -r 1d4b798712da4baa056d633ee73bd6b6b7e89cc1 doc/source/cookbook/streamlines_isocontour.py
--- a/doc/source/cookbook/streamlines_isocontour.py
+++ b/doc/source/cookbook/streamlines_isocontour.py
@@ -1,35 +1,63 @@
-from yt.mods import *
+import yt
+import numpy as np
 from yt.visualization.api import Streamlines
-
-pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-c = np.array([0.5]*3)
-N = 30
-scale = 15.0/pf['kpc']
-pos_dx = np.random.random((N,3))*scale-scale/2.
-pos = c+pos_dx
-
-streamlines = Streamlines(pf,pos,'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
-streamlines.integrate_through_volume()
-
 import matplotlib.pylab as pl
 from mpl_toolkits.mplot3d import Axes3D
 from mpl_toolkits.mplot3d.art3d import Poly3DCollection
+
+# Load the dataset
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# Define c: the center of the box, N: the number of streamlines,
+# scale: the spatial scale of the streamlines relative to the boxsize,
+# and then pos: the random positions of the streamlines.
+c = ds.arr([0.5]*3, 'code_length')
+N = 30
+scale = ds.quan(15, 'kpc').in_units('code_length')  # 15 kpc in code units
+pos_dx = np.random.random((N,3))*scale-scale/2.
+pos = c+pos_dx
+ 
+# Create the streamlines from these positions with the velocity fields as the
+# fields to be traced
+streamlines = Streamlines(ds, pos, 'velocity_x', 'velocity_y', 'velocity_z', length=1.0) 
+streamlines.integrate_through_volume()
+
+# Create a 3D matplotlib figure for visualizing the streamlines
 fig=pl.figure() 
 ax = Axes3D(fig)
+
+# Trace the streamlines through the volume of the 3D figure
 for stream in streamlines.streamlines:
     stream = stream[np.all(stream != 0.0, axis=1)]
-    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.1)
 
+    # Make the colors of each stream vary continuously from blue to red
+    # from low-x to high-x of the stream start position (each color is R, G, B)
+    # can omit and just set streamline colors to a fixed color
+    x_start_pos = ds.arr(stream[0,0], 'code_length')
+    x_start_pos -= ds.arr(0.5, 'code_length')
+    x_start_pos /= scale 
+    x_start_pos += 0.5
+    color = np.array([x_start_pos, 0, 1-x_start_pos])
 
-sphere = pf.sphere("max", (1.0, "mpc"))
-surface = pf.surface(sphere, "density", 1e-24)
-colors = apply_colormap(np.log10(surface["temperature"]), cmap_name="hot")
+    # Plot the stream in 3D
+    ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.3, color=color)
 
+# Create a sphere object centered on the highest density point in the simulation
+# with radius = 1 Mpc
+sphere = ds.sphere("max", (1.0, "Mpc"))
+
+# Identify the isodensity surface in this sphere with density = 1e-24 g/cm^3
+surface = ds.surface(sphere, "density", 1e-24)
+
+# Color this isodensity surface according to the log of the temperature field
+colors = yt.apply_colormap(np.log10(surface["temperature"]), cmap_name="hot")
+
+# Render this surface 
 p3dc = Poly3DCollection(surface.triangles, linewidth=0.0)
-colors = colors[0,:,:]/255.
-colors[:,3] = 0.3
+colors = colors[0,:,:]/255.  # scale to [0,1]
+colors[:,3] = 0.3            # alpha = 0.3
 p3dc.set_facecolors(colors)
 ax.add_collection(p3dc)
 
+# Save the figure
 pl.savefig('streamlines_isocontour.png')
-

This diff is so big that we needed to truncate the remainder.

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