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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sun Jul 20 07:18:16 PDT 2014


10 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/270869ba8672/
Changeset:   270869ba8672
Branch:      yt-3.0
User:        chummels
Date:        2014-07-18 05:01:55
Summary:     Adding simple_derived_field recipe to cookbook.
Affected #:  2 files

diff -r b58796ca19881fca5b1244e13152816ad2164200 -r 270869ba8672ddc63e65013f245444b4ae426a56 doc/source/cookbook/calculating_information.rst
--- a/doc/source/cookbook/calculating_information.rst
+++ b/doc/source/cookbook/calculating_information.rst
@@ -58,6 +58,14 @@
 
 .. yt_cookbook:: time_series.py
 
+Simple Derived Fields
+~~~~~~~~~~~~~~~~~~~~~
+
+This recipe demonstrates how to create a simple derived field, number_density,
+ and then generate a projection from it.
+
+.. yt_cookbook:: derived_field.py
+
 Complex Derived Fields
 ~~~~~~~~~~~~~~~~~~~~~~
 

diff -r b58796ca19881fca5b1244e13152816ad2164200 -r 270869ba8672ddc63e65013f245444b4ae426a56 doc/source/cookbook/derived_field.py
--- /dev/null
+++ b/doc/source/cookbook/derived_field.py
@@ -0,0 +1,23 @@
+import yt
+
+# Load the dataset.
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# You can create a derived field by manipulating any existing derived fields
+# in any way you choose.  In this case, let's just make a simple one:
+# number_density = density / mass
+
+# First create a function which yields your new derived field
+def number_density(field, data):
+    return data['gas', 'density']/data['gas', 'mass']
+
+# Then add it to your dataset and define the units
+ds.add_field(("gas", "number_density"), units="cm**-3", function=number_density)
+
+# It will now show up in your derived_field_list
+for i in sorted(ds.derived_field_list): 
+    print i
+
+# Let's use it to make a projection of the entire volume!
+ad = ds.all_data()
+yt.ProjectionPlot(ds, "x", "number_density").save()


https://bitbucket.org/yt_analysis/yt/commits/9bf9978452e1/
Changeset:   9bf9978452e1
Branch:      yt-3.0
User:        chummels
Date:        2014-07-18 05:24:05
Summary:     Updating simulation_analysis recipe.
Affected #:  1 file

diff -r 270869ba8672ddc63e65013f245444b4ae426a56 -r 9bf9978452e10210471af53fd42913420a48b582 doc/source/cookbook/simulation_analysis.py
--- a/doc/source/cookbook/simulation_analysis.py
+++ b/doc/source/cookbook/simulation_analysis.py
@@ -1,21 +1,27 @@
 import yt
 import collections
 
-# Instantiate a time series object for an Enzo simulation..
-sim = yt.simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo')
+# Enable parallelism in the script (assuming it was called with 
+# `mpirun -np <n_procs>` )
+yt.enable_parallelism()
 
-# Get a time series for all data made by the simulation.
-sim.get_time_series()
+# By using wildcards such as ? and * with the load command, we can load up a 
+# Time Series containing all of these datasets simultaneously.
+ts = yt.load('enzo_tiny_cosmology/DD????/DD????')
 
-# Calculate and store extrema for all datasets along with redshift
+# Calculate and store density extrema for all datasets along with redshift
 # in a data dictionary with entries as tuples
 
-# Note that by using sim.piter(), we are automatically 
-# forcing yt to do this in parallel
+# Create an empty dictionary
 data = {}
-for ds in sim.piter():
+
+# Iterate through each dataset in the Time Series (using piter allows it 
+# to happen in parallel automatically across available processors)
+for ds in ts.piter():
     ad = ds.all_data()
     extrema = ad.quantities.extrema('density')
+
+    # Fill the dictionary with extrema and redshift information for each dataset
     data[ds.basename] = (extrema, ds.current_redshift)
 
 # Convert dictionary to ordered dictionary to get the right order
@@ -24,5 +30,6 @@
 # Print out all the values we calculated.
 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])
+for key, val in od.iteritems(): 
+    print "%s       %05.3f          %5.3g g/cm^3   %5.3g g/cm^3" % \
+           (key, val[1], val[0][0], val[0][1])


https://bitbucket.org/yt_analysis/yt/commits/8305dae36d7e/
Changeset:   8305dae36d7e
Branch:      yt-3.0
User:        chummels
Date:        2014-07-18 06:11:55
Summary:     Updating time_series recipe.
Affected #:  1 file

diff -r 9bf9978452e10210471af53fd42913420a48b582 -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 doc/source/cookbook/time_series.py
--- a/doc/source/cookbook/time_series.py
+++ b/doc/source/cookbook/time_series.py
@@ -1,37 +1,40 @@
 import yt
-import glob
 import matplotlib.pyplot as plt
+import numpy as np
 
-# Glob for a list of filenames, then sort them
-fns = glob.glob("GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*")
-fns.sort()
+# Enable parallelism in the script (assuming it was called with
+# `mpirun -np <n_procs>` )
+yt.enable_parallelism()
 
-# Construct the time series object
-ts = yt.DatasetSeries.from_filenames(fns)
+# By using wildcards such as ? and * with the load command, we can load up a
+# Time Series containing all of these datasets simultaneously.
+ts = yt.load('GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*')
 
 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, ds in ts.piter(storage=storage):
+# By using the piter() function, we can iterate on every dataset in 
+# the TimeSeries object.  By using the storage keyword, we can populate
+# a dictionary where the dataset is the key, and sto.result is the value
+# for later use when the loop is complete.
+
+# The serial equivalent of piter() here is just "for ds in ts:" .
+
+for store, ds in ts.piter(storage=storage):
+
+    # Create a sphere of radius 100 kpc at the center of the dataset volume
     sphere = ds.sphere("c", (100., "kpc"))
+    # Calculate the entropy within that sphere
     entr = sphere["entropy"].sum()
-    sto.result = (ds.current_time.in_units('Gyr'), entr)
+    # Store the current time and sphere entropy for this dataset in our 
+    # storage dictionary as a tuple
+    store.result = (ds.current_time.in_units('Gyr'), entr)
 
+# Convert the storage dictionary values to a Nx2 array, so the can be easily
+# plotted
+arr = np.array(storage.values())
 
-# Store these values in a couple of lists
-times = []
-entrs = []
-for k in storage:
-    t, e = storage[k]
-    times.append(t)
-    entrs.append(e)
-
-
-# Plot up the results
-
-plt.semilogy(times, entrs, '-')
+# Plot up the results: time versus entropy
+plt.semilogy(arr[:,0], arr[:,1], 'r-')
 plt.xlabel("Time (Gyr)")
 plt.ylabel("Entropy (ergs/K)")
 plt.savefig("time_versus_entropy.png")


https://bitbucket.org/yt_analysis/yt/commits/dcaab4784007/
Changeset:   dcaab4784007
Branch:      yt-3.0
User:        chummels
Date:        2014-07-18 16:12:16
Summary:     Merging.
Affected #:  9 files

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a doc/source/cookbook/profile_with_variance.py
--- a/doc/source/cookbook/profile_with_variance.py
+++ b/doc/source/cookbook/profile_with_variance.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 matplotlib.pyplot as plt
 import yt
 
@@ -16,15 +13,16 @@
 
 # Create a 1D profile object for profiles over radius
 # and add a velocity profile.
-prof = yt.create_profile(sp, 'radius', 'velocity_magnitude',
+prof = yt.create_profile(sp, 'radius', ('gas', 'velocity_magnitude'),
                          units = {'radius': 'kpc'},
                          extrema = {'radius': ((0.1, 'kpc'), (1000.0, 'kpc'))},
                          weight_field='cell_mass')
 
 # Plot the average velocity magnitude.
-plt.loglog(prof.x, prof['velocity_magnitude'], label='Mean')
+plt.loglog(prof.x, prof['gas', 'velocity_magnitude'], label='Mean')
 # Plot the variance of the velocity madnitude.
-plt.loglog(prof.x, prof['velocity_magnitude_std'], label='Standard Deviation')
+plt.loglog(prof.x, prof.variance['gas', 'velocity_magnitude'],
+           label='Standard Deviation')
 plt.xlabel('r [kpc]')
 plt.ylabel('v [cm/s]')
 plt.legend()

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/data_objects/particle_filters.py
--- a/yt/data_objects/particle_filters.py
+++ b/yt/data_objects/particle_filters.py
@@ -72,6 +72,8 @@
     def wrap_func(self, field_name, old_fi):
         new_fi = copy.copy(old_fi)
         new_fi.name = (self.filtered_type, field_name[1])
+        if old_fi._function == NullFunc:
+            new_fi._function = TranslationFunc(old_fi.name)
         return new_fi
 
 def add_particle_filter(name, function, requires = None, filtered_type = "all"):

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -759,6 +759,8 @@
         self.data_source = data_source
         self.pf = data_source.pf
         self.field_data = YTFieldData()
+        if weight_field is not None:
+            self.variance = YTFieldData()
         self.weight_field = weight_field
         self.field_units = {}
         ParallelAnalysisInterface.__init__(self, comm=data_source.comm)
@@ -805,20 +807,77 @@
     def _finalize_storage(self, fields, temp_storage):
         # We use our main comm here
         # This also will fill _field_data
-        temp_storage.values = self.comm.mpi_allreduce(temp_storage.values, op="sum", dtype="float64")
-        temp_storage.weight_values = self.comm.mpi_allreduce(temp_storage.weight_values, op="sum", dtype="float64")
-        temp_storage.used = self.comm.mpi_allreduce(temp_storage.used, op="sum", dtype="bool")
-        blank = ~temp_storage.used
-        self.used = temp_storage.used
-        if self.weight_field is not None:
-            # This is unnecessary, but it will suppress division errors.
-            temp_storage.weight_values[blank] = 1e-30
-            temp_storage.values /= temp_storage.weight_values[...,None]
-            self.weight = temp_storage.weight_values[...,None]
-            self.weight[blank] = 0.0
+
+        for i, field in enumerate(fields):
+            # q values are returned as q * weight but we want just q
+            temp_storage.qvalues[..., i][temp_storage.used] /= \
+              temp_storage.weight_values[temp_storage.used]
+
+        # get the profile data from all procs
+        all_store = {self.comm.rank: temp_storage}
+        all_store = self.comm.par_combine_object(all_store,
+                                                 "join", datatype="dict")
+
+        all_val = np.zeros_like(temp_storage.values)
+        all_mean = np.zeros_like(temp_storage.mvalues)
+        all_var = np.zeros_like(temp_storage.qvalues)
+        all_weight = np.zeros_like(temp_storage.weight_values)
+        all_used = np.zeros_like(temp_storage.used, dtype="bool")
+
+        # Combine the weighted mean and variance from each processor.
+        # For two samples with total weight, mean, and variance 
+        # given by w, m, and s, their combined mean and variance are:
+        # m12 = (m1 * w1 + m2 * w2) / (w1 + w2)
+        # s12 = (m1 * (s1**2 + (m1 - m12)**2) + 
+        #        m2 * (s2**2 + (m2 - m12)**2)) / (w1 + w2)
+        # Here, the mvalues are m and the qvalues are s**2.
+        for p in sorted(all_store.keys()):
+            all_used += all_store[p].used
+            old_mean = all_mean.copy()
+            old_weight = all_weight.copy()
+            all_weight[all_store[p].used] += \
+              all_store[p].weight_values[all_store[p].used]
+            for i, field in enumerate(fields):
+                all_val[..., i][all_store[p].used] += \
+                  all_store[p].values[..., i][all_store[p].used]
+
+                all_mean[..., i][all_store[p].used] = \
+                  (all_mean[..., i] * old_weight +
+                   all_store[p].mvalues[..., i] *
+                   all_store[p].weight_values)[all_store[p].used] / \
+                   all_weight[all_store[p].used]
+
+                all_var[..., i][all_store[p].used] = \
+                  (old_weight * (all_var[..., i] +
+                                 (old_mean[..., i] - all_mean[..., i])**2) +
+                   all_store[p].weight_values *
+                   (all_store[p].qvalues[..., i] + 
+                    (all_store[p].mvalues[..., i] -
+                     all_mean[..., i])**2))[all_store[p].used] / \
+                    all_weight[all_store[p].used]
+
+        all_var = np.sqrt(all_var)
+        del all_store
+        self.used = all_used
+        blank = ~all_used
+
+        self.weight = all_weight
+        self.weight[blank] = 0.0
+            
         self.field_map = {}
         for i, field in enumerate(fields):
-            self.field_data[field] = array_like_field(self.data_source, temp_storage.values[...,i], field)
+            if self.weight_field is None:
+                self.field_data[field] = \
+                  array_like_field(self.data_source, 
+                                   all_val[...,i], field)
+            else:
+                self.field_data[field] = \
+                  array_like_field(self.data_source, 
+                                   all_mean[...,i], field)
+                self.variance[field] = \
+                  array_like_field(self.data_source,
+                                   all_var[...,i], field)
+                self.variance[field][blank] = 0.0
             self.field_data[field][blank] = 0.0
             self.field_units[field] = self.field_data[field].units
             if isinstance(field, tuple):
@@ -1305,13 +1364,27 @@
             if not acc: continue
             temp = obj.field_data[field]
             temp = np.rollaxis(temp, axis)
+            if weight_field is not None:
+                temp_weight = obj.weight
+                temp_weight = np.rollaxis(temp_weight, axis)
             if acc < 0:
                 temp = temp[::-1]
-            temp = temp.cumsum(axis=0)
+                if weight_field is not None:
+                    temp_weight = temp_weight[::-1]
+            if weight_field is None:
+                temp = temp.cumsum(axis=0)
+            else:
+                temp = (temp * temp_weight).cumsum(axis=0) / \
+                  temp_weight.cumsum(axis=0)
             if acc < 0:
                 temp = temp[::-1]
+                if weight_field is not None:
+                    temp_weight = temp_weight[::-1]
             temp = np.rollaxis(temp, axis)
             obj.field_data[field] = temp
+            if weight_field is not None:
+                temp_weight = np.rollaxis(temp_weight, axis)
+                obj.weight = temp_weight
     if units is not None:
         for field, unit in units.iteritems():
             field = data_source._determine_fields(field)[0]

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -431,7 +431,9 @@
         if available:
             self.particle_types += (filter.name,)
             self.filtered_particle_types.append(filter.name)
-            self._setup_particle_types([filter.name])
+            new_fields = self._setup_particle_types([filter.name])
+            deps, _ = self.field_info.check_derived_fields(new_fields)
+            self.field_dependencies.update(deps)
         return available
 
     def _setup_particle_types(self, ptypes = None):

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/fields/field_info_container.py
--- a/yt/fields/field_info_container.py
+++ b/yt/fields/field_info_container.py
@@ -75,11 +75,11 @@
                 output_units = str(u.get_cgs_equivalent())
             else:
                 output_units = units
+            if (ptype, f) not in self.field_list:
+                continue
             self.add_output_field((ptype, f),
                 units = units, particle_type = True, display_name = dn,
                 output_units = output_units)
-            if (ptype, f) not in self.field_list:
-                continue
             for alias in aliases:
                 self.alias((ptype, alias), (ptype, f), units = output_units)
 

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/frontends/sdf/data_structures.py
--- a/yt/frontends/sdf/data_structures.py
+++ b/yt/frontends/sdf/data_structures.py
@@ -191,7 +191,6 @@
     @classmethod
     def _is_valid(cls, *args, **kwargs):
         sdf_header = kwargs.get('sdf_header', args[0])
-        print 'Parsing sdf_header: %s' % sdf_header
         if sdf_header.startswith("http"):
             if requests is None: return False
             hreq = requests.get(sdf_header, stream=True)

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/utilities/lib/image_utilities.pyx
--- a/yt/utilities/lib/image_utilities.pyx
+++ b/yt/utilities/lib/image_utilities.pyx
@@ -43,7 +43,15 @@
         np.ndarray[np.float64_t, ndim=1] px, 
         np.ndarray[np.float64_t, ndim=1] py, 
         np.ndarray[np.float64_t, ndim=2] rgba,
-        ):  
+        ):
+    """
+    Splat rgba points onto an image
+
+    Given an image buffer, add colors to
+    pixels defined by fractional positions px and py,
+    with colors rgba.  px and py are one dimensional
+    arrays, and rgba is a an array of rgba values.
+    """
     cdef int i, j, k, pi
     cdef int npart = px.shape[0]
     cdef int xs = buffer.shape[0]
@@ -53,7 +61,7 @@
     for pi in range(npart):
         j = <int> (xs * px[pi])
         i = <int> (ys * py[pi])
-        if i < 0 or j < 0 or i >= xs or j >= ys: 
+        if i < 0 or j < 0 or i >= xs or j >= ys:
             continue
         for k in range(4):
             buffer[i, j, k] += rgba[pi, k]

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/visualization/image_writer.py
--- a/yt/visualization/image_writer.py
+++ b/yt/visualization/image_writer.py
@@ -18,6 +18,7 @@
 
 from yt.funcs import *
 from yt.utilities.exceptions import YTNotInsideNotebook
+from color_maps import mcm
 import _colormap_data as cmd
 import yt.utilities.lib.image_utilities as au
 import yt.utilities.png_writer as pw
@@ -157,7 +158,7 @@
     if transpose:
         bitmap_array = bitmap_array.swapaxes(0,1)
     if filename is not None:
-        pw.write_png(bitmap_array.copy(), filename)
+        pw.write_png(bitmap_array, filename)
     else:
         return pw.write_png_to_string(bitmap_array.copy())
     return bitmap_array
@@ -243,10 +244,18 @@
     return to_plot
 
 def map_to_colors(buff, cmap_name):
-    if cmap_name not in cmd.color_map_luts:
-        print ("Your color map was not found in the extracted colormap file.")
-        raise KeyError(cmap_name)
-    lut = cmd.color_map_luts[cmap_name]
+    try:
+        lut = cmd.color_map_luts[cmap_name]
+    except KeyError:
+        try:
+            cmap = mcm.get_cmap(cmap_name)
+            dummy = cmap(0.0)
+            lut = cmap._lut.T
+        except ValueError:
+            print "Your color map was not found in either the extracted" +\
+                " colormap file or matplotlib colormaps"
+            raise KeyError(cmap_name)
+
     x = np.mgrid[0.0:1.0:lut[0].shape[0]*1j]
     shape = buff.shape
     mapped = np.dstack(

diff -r 8305dae36d7ef557f091138f1bdb8c7c2217e582 -r dcaab4784007461a7a0e995a51f9c62d27b5fc2a yt/visualization/tests/test_splat.py
--- /dev/null
+++ b/yt/visualization/tests/test_splat.py
@@ -0,0 +1,58 @@
+"""
+Test for write_bitmap and add_rgba_points
+
+
+
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (c) 2013, yt Development Team.
+#
+# Distributed under the terms of the Modified BSD License.
+#
+# The full license is in the file COPYING.txt, distributed with this software.
+#-----------------------------------------------------------------------------
+import os
+import os.path
+import tempfile
+import shutil
+import numpy as np
+import yt
+from yt.testing import \
+    assert_equal, expand_keywords
+from yt.utilities.lib.api import add_rgba_points_to_image
+
+
+def setup():
+    """Test specific setup."""
+    from yt.config import ytcfg
+    ytcfg["yt", "__withintesting"] = "True"
+
+
+def test_splat():
+    """Tests functionality of off_axis_projection and write_projection."""
+    # Perform I/O in safe place instead of yt main dir
+    tmpdir = tempfile.mkdtemp()
+    curdir = os.getcwd()
+    os.chdir(tmpdir)
+
+    N = 16 
+    Np = int(1e2)
+    image = np.zeros([N,N,4])
+    xs = np.random.random(Np)
+    ys = np.random.random(Np)
+
+    cbx = yt.visualization.color_maps.mcm.RdBu
+    cs = cbx(np.random.random(Np))
+    add_rgba_points_to_image(image, xs, ys, cs)
+
+    before_hash = image.copy()
+    fn = 'tmp.png'
+    yt.write_bitmap(image, fn)
+    yield assert_equal, os.path.exists(fn), True
+    os.remove(fn)
+    yield assert_equal, before_hash, image
+
+    os.chdir(curdir)
+    # clean up
+    shutil.rmtree(tmpdir)


https://bitbucket.org/yt_analysis/yt/commits/eceb0c4887c1/
Changeset:   eceb0c4887c1
Branch:      yt-3.0
User:        chummels
Date:        2014-07-19 21:31:52
Summary:     Updating some of the derived fields docs to reflect the fact that derived fields don't have to be defined prior to a dataset is loaded.
Affected #:  1 file

diff -r 894d44f837d4d259550bb7b741091424226375b7 -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 doc/source/analyzing/units/data_selection_and_fields.rst
--- a/doc/source/analyzing/units/data_selection_and_fields.rst
+++ b/doc/source/analyzing/units/data_selection_and_fields.rst
@@ -11,31 +11,28 @@
 .. This needs to be added outside the notebook since user-defined derived fields
    require a 'fresh' kernel.
 
-.. warning:: Note: derived field definitions need to happen *before* a dataset
-             is loaded.  This means changes to the following cells will only be
-             picked up on a fresh kernel.  Select Kernel -> Restart on the
-             IPython menu bar to restart the kernel.
-
-New derived fields can be added just like in old vesions of yt.  The most
-straightforward way to do this is to apply the `derived_field` decorator on a
-function that defines a field.
-
 The following example creates a derived field for the square root of the cell
 volume.
 
 .. notebook-cell::
 
-   from yt.mods import *
+   import yt
    import numpy as np
 
-   @derived_field(name='root_cell_volume', units='cm**(3/2)')
+   # Function defining the derived field
    def root_cell_volume(field, data):
-     return np.sqrt(data['cell_volume'])
+      return np.sqrt(data['cell_volume'])
 
-   ds = load('HiresIsolatedGalaxy/DD0044/DD0044')
+   # Load the dataset
+   ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
 
-   dd = ds.h.all_data()
-   dd['root_cell_volume']
+   # Add the field to the dataset, linking to the derived field function and 
+   # units of the field
+   ds.add_field(("gas", "root_cell_volume"), units="cm**(3/2)", function=root_cell_volume)
+
+   # Access the derived field like any other field
+   ad = ds.all_data()
+   ad['root_cell_volume']
 
 No special unit logic needs to happen inside of the function - `np.sqrt` will
 convert the units of the `density` field appropriately:
@@ -43,17 +40,17 @@
 .. notebook-cell::
    :skip_exceptions:
 
-   from yt.mods import *
+   import yt
    import numpy as np
 
-   ds = load('HiresIsolatedGalaxy/DD0044/DD0044')
-   dd = ds.h.all_data()
+   ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
+   ad = ds.all_data()
 
-   print dd['cell_volume'].in_cgs()
-   print np.sqrt(dd['cell_volume'].in_cgs())
+   print ad['cell_volume'].in_cgs()
+   print np.sqrt(ad['cell_volume'].in_cgs())
 
 That said, it is necessary to specify the units in the call to the
-:code:`@derived_field` decorator.  Not only does this ensure the returned units
+:code:`add_field` function.  Not only does this ensure the returned units
 will be exactly what you expect, it also allows an in-place conversion of units,
 just in case the function returns a field with dimensionally equivalent units.
 
@@ -62,13 +59,16 @@
 
 .. notebook-cell::
 
-   from yt.mods import *
+   import yt
+   import numpy as np
 
-   @derived_field(name='root_cell_volume', units='Mpc**(3/2)')
    def root_cell_volume(field, data):
-     return np.sqrt(data['cell_volume'])
+      return np.sqrt(data['cell_volume'])
 
-   ds = load('HiresIsolatedGalaxy/DD0044/DD0044')
+   ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
 
-   dd = ds.h.all_data()
-   dd['root_cell_volume']
+   # Here we set the default units to Mpc^(3/2)
+   ds.add_field(("gas", "root_cell_volume"), units="Mpc**(3/2)", function=root_cell_volume)
+
+   ad = ds.all_data()
+   ad['root_cell_volume']


https://bitbucket.org/yt_analysis/yt/commits/fda46944799e/
Changeset:   fda46944799e
Branch:      yt-3.0
User:        chummels
Date:        2014-07-20 03:50:22
Summary:     Merging.
Affected #:  340 files

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/cheatsheet.tex
--- a/doc/cheatsheet.tex
+++ b/doc/cheatsheet.tex
@@ -208,38 +208,38 @@
 After that, simulation data is generally accessed in yt using {\it Data Containers} which are Python objects
 that define a region of simulation space from which data should be selected.
 \settowidth{\MyLen}{\texttt{multicol} }
-\texttt{pf = load(}{\it dataset}\texttt{)} \textemdash\   Reference a single snapshot.\\
-\texttt{dd = pf.h.all\_data()} \textemdash\ Select the entire volume.\\
+\texttt{ds = load(}{\it dataset}\texttt{)} \textemdash\   Reference a single snapshot.\\
+\texttt{dd = ds.all\_data()} \textemdash\ Select the entire volume.\\
 \texttt{a = dd[}{\it field\_name}\texttt{]} \textemdash\ Saves the contents of {\it field} into the
 numpy array \texttt{a}. Similarly for other data containers.\\
-\texttt{pf.h.field\_list} \textemdash\ A list of available fields in the snapshot. \\
-\texttt{pf.h.derived\_field\_list} \textemdash\ A list of available derived fields
+\texttt{ds.field\_list} \textemdash\ A list of available fields in the snapshot. \\
+\texttt{ds.derived\_field\_list} \textemdash\ A list of available derived fields
 in the snapshot. \\
-\texttt{val, loc = pf.h.find\_max("Density")} \textemdash\ Find the \texttt{val}ue of
+\texttt{val, loc = ds.find\_max("Density")} \textemdash\ Find the \texttt{val}ue of
 the maximum of the field \texttt{Density} and its \texttt{loc}ation. \\
-\texttt{sp = pf.sphere(}{\it cen}\texttt{,}{\it radius}\texttt{)} \textemdash\   Create a spherical data 
+\texttt{sp = ds.sphere(}{\it cen}\texttt{,}{\it radius}\texttt{)} \textemdash\   Create a spherical data 
 container. {\it cen} may be a coordinate, or ``max'' which 
 centers on the max density point. {\it radius} may be a float in 
 code units or a tuple of ({\it length, unit}).\\
 
-\texttt{re = pf.region({\it cen}, {\it left edge}, {\it right edge})} \textemdash\ Create a
+\texttt{re = ds.region({\it cen}, {\it left edge}, {\it right edge})} \textemdash\ Create a
 rectilinear data container. {\it cen} is required but not used.
 {\it left} and {\it right edge} are coordinate values that define the region.
 
-\texttt{di = pf.disk({\it cen}, {\it normal}, {\it radius}, {\it height})} \textemdash\ 
+\texttt{di = ds.disk({\it cen}, {\it normal}, {\it radius}, {\it height})} \textemdash\ 
 Create a cylindrical data container centered at {\it cen} along the 
 direction set by {\it normal},with total length
  2$\times${\it height} and with radius {\it radius}. \\
  
- \texttt{bl = pf.boolean({\it constructor})} \textemdash\ Create a boolean data
+ \texttt{bl = ds.boolean({\it constructor})} \textemdash\ Create a boolean data
  container. {\it constructor} is a list of pre-defined non-boolean 
  data containers with nested boolean logic using the
  ``AND'', ``NOT'', or ``OR'' operators. E.g. {\it constructor=}
  {\it [sp, ``NOT'', (di, ``OR'', re)]} gives a volume defined
  by {\it sp} minus the patches covered by {\it di} and {\it re}.\\
  
-\texttt{pf.h.save\_object(sp, {\it ``sp\_for\_later''})} \textemdash\ Save an object (\texttt{sp}) for later use.\\
-\texttt{sp = pf.h.load\_object({\it ``sp\_for\_later''})} \textemdash\ Recover a saved object.\\
+\texttt{ds.save\_object(sp, {\it ``sp\_for\_later''})} \textemdash\ Save an object (\texttt{sp}) for later use.\\
+\texttt{sp = ds.load\_object({\it ``sp\_for\_later''})} \textemdash\ Recover a saved object.\\
 
 
 \subsection{Defining New Fields \& Quantities}
@@ -261,15 +261,15 @@
 
 \subsection{Slices and Projections}
 \settowidth{\MyLen}{\texttt{multicol} }
-\texttt{slc = SlicePlot(pf, {\it axis}, {\it field}, {\it center=}, {\it width=}, {\it weight\_field=}, {\it additional parameters})} \textemdash\ Make a slice plot
+\texttt{slc = SlicePlot(ds, {\it axis}, {\it field}, {\it center=}, {\it width=}, {\it weight\_field=}, {\it additional parameters})} \textemdash\ Make a slice plot
 perpendicular to {\it axis} of {\it field} weighted by {\it weight\_field} at (code-units) {\it center} with 
 {\it width} in code units or a (value, unit) tuple. Hint: try {\it SlicePlot?} in IPython to see additional parameters.\\
 \texttt{slc.save({\it file\_prefix})} \textemdash\ Save the slice to a png with name prefix {\it file\_prefix}.
 \texttt{.save()} works similarly for the commands below.\\
 
-\texttt{prj = ProjectionPlot(pf, {\it axis}, {\it field}, {\it addit. params})} \textemdash\ Make a projection. \\
-\texttt{prj = OffAxisSlicePlot(pf, {\it normal}, {\it fields}, {\it center=}, {\it width=}, {\it depth=},{\it north\_vector=},{\it weight\_field=})} \textemdash Make an off-axis slice. Note this takes an array of fields. \\
-\texttt{prj = OffAxisProjectionPlot(pf, {\it normal}, {\it fields}, {\it center=}, {\it width=}, {\it depth=},{\it north\_vector=},{\it weight\_field=})} \textemdash Make an off axis projection. Note this takes an array of fields. \\
+\texttt{prj = ProjectionPlot(ds, {\it axis}, {\it field}, {\it addit. params})} \textemdash\ Make a projection. \\
+\texttt{prj = OffAxisSlicePlot(ds, {\it normal}, {\it fields}, {\it center=}, {\it width=}, {\it depth=},{\it north\_vector=},{\it weight\_field=})} \textemdash Make an off-axis slice. Note this takes an array of fields. \\
+\texttt{prj = OffAxisProjectionPlot(ds, {\it normal}, {\it fields}, {\it center=}, {\it width=}, {\it depth=},{\it north\_vector=},{\it weight\_field=})} \textemdash Make an off axis projection. Note this takes an array of fields. \\
 
 \subsection{Plot Annotations}
 \settowidth{\MyLen}{\texttt{multicol} }
@@ -365,8 +365,8 @@
 \subsection{FAQ}
 \settowidth{\MyLen}{\texttt{multicol}}
 
-\texttt{pf.field\_info[`field'].take\_log = False} \textemdash\ When plotting \texttt{field}, do not take log.
-Must enter \texttt{pf.h} before this command. \\
+\texttt{ds.field\_info[`field'].take\_log = False} \textemdash\ When plotting \texttt{field}, do not take log.
+Must enter \texttt{ds.index} before this command. \\
 
 
 %\rule{0.3\linewidth}{0.25pt}

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/coding_styleguide.txt
--- a/doc/coding_styleguide.txt
+++ b/doc/coding_styleguide.txt
@@ -49,7 +49,7 @@
  * Don't create a new class to replicate the functionality of an old class --
    replace the old class.  Too many options makes for a confusing user
    experience.
- * Parameter files are a last resort.
+ * Parameter files external to yt are a last resort.
  * The usage of the **kwargs construction should be avoided.  If they cannot
    be avoided, they must be explained, even if they are only to be passed on to
    a nested function.
@@ -61,7 +61,7 @@
    * Hard-coding parameter names that are the same as those in Enzo.  The
      following translation table should be of some help.  Note that the
      parameters are now properties on a Dataset subclass: you access them
-     like pf.refine_by .
+     like ds.refine_by .
      * RefineBy => refine_by
      * TopGridRank => dimensionality
      * TopGridDimensions => domain_dimensions

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/docstring_example.txt
--- a/doc/docstring_example.txt
+++ b/doc/docstring_example.txt
@@ -73,7 +73,7 @@
     Examples
     --------
     These are written in doctest format, and should illustrate how to
-    use the function.  Use the variables 'pf' for the parameter file, 'pc' for
+    use the function.  Use the variables 'ds' for the dataset, 'pc' for
     a plot collection, 'c' for a center, and 'L' for a vector. 
 
     >>> a=[1,2,3]

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/docstring_idioms.txt
--- a/doc/docstring_idioms.txt
+++ b/doc/docstring_idioms.txt
@@ -19,7 +19,7 @@
 useful variable names that correspond to specific instances that the user is
 presupposed to have created.
 
-   * `pf`: a parameter file, loaded successfully
+   * `ds`: a dataset, loaded successfully
    * `sp`: a sphere
    * `c`: a 3-component "center"
    * `L`: a 3-component vector that corresponds to either angular momentum or a

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/helper_scripts/parse_cb_list.py
--- a/doc/helper_scripts/parse_cb_list.py
+++ b/doc/helper_scripts/parse_cb_list.py
@@ -2,7 +2,7 @@
 import inspect
 from textwrap import TextWrapper
 
-pf = load("RD0005-mine/RedshiftOutput0005")
+ds = load("RD0005-mine/RedshiftOutput0005")
 
 output = open("source/visualizing/_cb_docstrings.inc", "w")
 

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/helper_scripts/parse_dq_list.py
--- a/doc/helper_scripts/parse_dq_list.py
+++ b/doc/helper_scripts/parse_dq_list.py
@@ -2,7 +2,7 @@
 import inspect
 from textwrap import TextWrapper
 
-pf = load("RD0005-mine/RedshiftOutput0005")
+ds = load("RD0005-mine/RedshiftOutput0005")
 
 output = open("source/analyzing/_dq_docstrings.inc", "w")
 
@@ -29,7 +29,7 @@
                             docstring = docstring))
                             #docstring = "\n".join(tw.wrap(docstring))))
 
-dd = pf.h.all_data()
+dd = ds.all_data()
 for n,func in sorted(dd.quantities.functions.items()):
     print n, func
     write_docstring(output, n, func[1])

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/helper_scripts/parse_object_list.py
--- a/doc/helper_scripts/parse_object_list.py
+++ b/doc/helper_scripts/parse_object_list.py
@@ -2,7 +2,7 @@
 import inspect
 from textwrap import TextWrapper
 
-pf = load("RD0005-mine/RedshiftOutput0005")
+ds = load("RD0005-mine/RedshiftOutput0005")
 
 output = open("source/analyzing/_obj_docstrings.inc", "w")
 
@@ -27,7 +27,7 @@
     f.write(template % dict(clsname = clsname, sig = sig, clsproxy=clsproxy,
                             docstring = 'physical-object-api'))
 
-for n,c in sorted(pf.h.__dict__.items()):
+for n,c in sorted(ds.__dict__.items()):
     if hasattr(c, '_con_args'):
         print n
         write_docstring(output, n, c)

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/helper_scripts/show_fields.py
--- a/doc/helper_scripts/show_fields.py
+++ b/doc/helper_scripts/show_fields.py
@@ -17,15 +17,15 @@
 everywhere, "Enzo" fields in Enzo datasets, "Orion" fields in Orion datasets,
 and so on.
 
-Try using the ``pf.field_list`` and ``pf.derived_field_list`` to view the
+Try using the ``ds.field_list`` and ``ds.derived_field_list`` to view the
 native and derived fields available for your dataset respectively. For example
 to display the native fields in alphabetical order:
 
 .. notebook-cell::
 
   from yt.mods import *
-  pf = load("Enzo_64/DD0043/data0043")
-  for i in sorted(pf.field_list):
+  ds = load("Enzo_64/DD0043/data0043")
+  for i in sorted(ds.field_list):
     print i
 
 .. note:: Universal fields will be overridden by a code-specific field.

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/_obj_docstrings.inc
--- a/doc/source/analyzing/_obj_docstrings.inc
+++ b/doc/source/analyzing/_obj_docstrings.inc
@@ -1,12 +1,12 @@
 
 
-.. class:: boolean(self, regions, fields=None, pf=None, **field_parameters):
+.. class:: boolean(self, regions, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRBooleanRegionBase`.)
 
 
-.. class:: covering_grid(self, level, left_edge, dims, fields=None, pf=None, num_ghost_zones=0, use_pbar=True, **field_parameters):
+.. class:: covering_grid(self, level, left_edge, dims, fields=None, ds=None, num_ghost_zones=0, use_pbar=True, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRCoveringGridBase`.)
@@ -24,13 +24,13 @@
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRCuttingPlaneBase`.)
 
 
-.. class:: disk(self, center, normal, radius, height, fields=None, pf=None, **field_parameters):
+.. class:: disk(self, center, normal, radius, height, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRCylinderBase`.)
 
 
-.. class:: ellipsoid(self, center, A, B, C, e0, tilt, fields=None, pf=None, **field_parameters):
+.. class:: ellipsoid(self, center, A, B, C, e0, tilt, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMREllipsoidBase`.)
@@ -48,79 +48,79 @@
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRFixedResCuttingPlaneBase`.)
 
 
-.. class:: fixed_res_proj(self, axis, level, left_edge, dims, fields=None, pf=None, **field_parameters):
+.. class:: fixed_res_proj(self, axis, level, left_edge, dims, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRFixedResProjectionBase`.)
 
 
-.. class:: grid_collection(self, center, grid_list, fields=None, pf=None, **field_parameters):
+.. class:: grid_collection(self, center, grid_list, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRGridCollectionBase`.)
 
 
-.. class:: grid_collection_max_level(self, center, max_level, fields=None, pf=None, **field_parameters):
+.. class:: grid_collection_max_level(self, center, max_level, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRMaxLevelCollectionBase`.)
 
 
-.. class:: inclined_box(self, origin, box_vectors, fields=None, pf=None, **field_parameters):
+.. class:: inclined_box(self, origin, box_vectors, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRInclinedBoxBase`.)
 
 
-.. class:: ortho_ray(self, axis, coords, fields=None, pf=None, **field_parameters):
+.. class:: ortho_ray(self, axis, coords, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMROrthoRayBase`.)
 
 
-.. class:: overlap_proj(self, axis, field, weight_field=None, max_level=None, center=None, pf=None, source=None, node_name=None, field_cuts=None, preload_style='level', serialize=True, **field_parameters):
+.. class:: overlap_proj(self, axis, field, weight_field=None, max_level=None, center=None, ds=None, source=None, node_name=None, field_cuts=None, preload_style='level', serialize=True, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRProjBase`.)
 
 
-.. class:: periodic_region(self, center, left_edge, right_edge, fields=None, pf=None, **field_parameters):
+.. class:: periodic_region(self, center, left_edge, right_edge, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRPeriodicRegionBase`.)
 
 
-.. class:: periodic_region_strict(self, center, left_edge, right_edge, fields=None, pf=None, **field_parameters):
+.. class:: periodic_region_strict(self, center, left_edge, right_edge, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRPeriodicRegionStrictBase`.)
 
 
-.. class:: proj(self, axis, field, weight_field=None, max_level=None, center=None, pf=None, source=None, node_name=None, field_cuts=None, preload_style=None, serialize=True, style='integrate', **field_parameters):
+.. class:: proj(self, axis, field, weight_field=None, max_level=None, center=None, ds=None, source=None, node_name=None, field_cuts=None, preload_style=None, serialize=True, style='integrate', **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRQuadTreeProjBase`.)
 
 
-.. class:: ray(self, start_point, end_point, fields=None, pf=None, **field_parameters):
+.. class:: ray(self, start_point, end_point, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRRayBase`.)
 
 
-.. class:: region(self, center, left_edge, right_edge, fields=None, pf=None, **field_parameters):
+.. class:: region(self, center, left_edge, right_edge, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRRegionBase`.)
 
 
-.. class:: region_strict(self, center, left_edge, right_edge, fields=None, pf=None, **field_parameters):
+.. class:: region_strict(self, center, left_edge, right_edge, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRRegionStrictBase`.)
 
 
-.. class:: slice(self, axis, coord, fields=None, center=None, pf=None, node_name=False, **field_parameters):
+.. class:: slice(self, axis, coord, fields=None, center=None, ds=None, node_name=False, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRSliceBase`.)
@@ -132,13 +132,13 @@
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRSmoothedCoveringGridBase`.)
 
 
-.. class:: sphere(self, center, radius, fields=None, pf=None, **field_parameters):
+.. class:: sphere(self, center, radius, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRSphereBase`.)
 
 
-.. class:: streamline(self, positions, length=1.0, fields=None, pf=None, **field_parameters):
+.. class:: streamline(self, positions, length=1.0, fields=None, ds=None, **field_parameters):
 
    For more information, see :ref:`physical-object-api`
    (This is a proxy for :class:`~yt.data_objects.data_containers.AMRStreamlineBase`.)

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/Halo_Analysis.ipynb
--- a/doc/source/analyzing/analysis_modules/Halo_Analysis.ipynb
+++ b/doc/source/analyzing/analysis_modules/Halo_Analysis.ipynb
@@ -44,7 +44,7 @@
       "tmpdir = tempfile.mkdtemp()\n",
       "\n",
       "# Load the data set with the full simulation information\n",
-      "data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')"
+      "data_ds = load('Enzo_64/RD0006/RedshiftOutput0006')"
      ],
      "language": "python",
      "metadata": {},
@@ -62,7 +62,7 @@
      "collapsed": false,
      "input": [
       "# Load the rockstar data files\n",
-      "halos_pf = load('rockstar_halos/halos_0.0.bin')"
+      "halos_ds = load('rockstar_halos/halos_0.0.bin')"
      ],
      "language": "python",
      "metadata": {},
@@ -80,7 +80,7 @@
      "collapsed": false,
      "input": [
       "# Instantiate a catalog using those two paramter files\n",
-      "hc = HaloCatalog(data_pf=data_pf, halos_pf=halos_pf, \n",
+      "hc = HaloCatalog(data_ds=data_ds, halos_ds=halos_ds, \n",
       "                 output_dir=os.path.join(tmpdir, 'halo_catalog'))"
      ],
      "language": "python",
@@ -295,9 +295,9 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "halos_pf =  load(os.path.join(tmpdir, 'halo_catalog/halo_catalog.0.h5'))\n",
+      "halos_ds =  load(os.path.join(tmpdir, 'halo_catalog/halo_catalog.0.h5'))\n",
       "\n",
-      "hc_reloaded = HaloCatalog(halos_pf=halos_pf,\n",
+      "hc_reloaded = HaloCatalog(halos_ds=halos_ds,\n",
       "                          output_dir=os.path.join(tmpdir, 'halo_catalog'))"
      ],
      "language": "python",
@@ -407,4 +407,4 @@
    "metadata": {}
   }
  ]
-}
\ No newline at end of file
+}

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/PPVCube.ipynb
--- a/doc/source/analyzing/analysis_modules/PPVCube.ipynb
+++ b/doc/source/analyzing/analysis_modules/PPVCube.ipynb
@@ -222,7 +222,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "pf = load(\"cube.fits\")"
+      "ds = load(\"cube.fits\")"
      ],
      "language": "python",
      "metadata": {},
@@ -233,7 +233,7 @@
      "collapsed": false,
      "input": [
       "# Specifying no center gives us the center slice\n",
-      "slc = SlicePlot(pf, \"z\", [\"density\"])\n",
+      "slc = SlicePlot(ds, \"z\", [\"density\"])\n",
       "slc.show()"
      ],
      "language": "python",
@@ -246,9 +246,9 @@
      "input": [
       "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",
+      "new_center = ds.domain_center\n",
+      "new_center[2] = ds.spec2pixel(-1.0*u.km/u.s)\n",
+      "slc = SlicePlot(ds, \"z\", [\"density\"], center=new_center)\n",
       "slc.show()"
      ],
      "language": "python",
@@ -259,8 +259,8 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "new_center[2] = pf.spec2pixel(0.7*u.km/u.s)\n",
-      "slc = SlicePlot(pf, \"z\", [\"density\"], center=new_center)\n",
+      "new_center[2] = ds.spec2pixel(0.7*u.km/u.s)\n",
+      "slc = SlicePlot(ds, \"z\", [\"density\"], center=new_center)\n",
       "slc.show()"
      ],
      "language": "python",
@@ -271,8 +271,8 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "new_center[2] = pf.spec2pixel(-0.3*u.km/u.s)\n",
-      "slc = SlicePlot(pf, \"z\", [\"density\"], center=new_center)\n",
+      "new_center[2] = ds.spec2pixel(-0.3*u.km/u.s)\n",
+      "slc = SlicePlot(ds, \"z\", [\"density\"], center=new_center)\n",
       "slc.show()"
      ],
      "language": "python",
@@ -290,7 +290,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "prj = ProjectionPlot(pf, \"z\", [\"density\"], proj_style=\"sum\")\n",
+      "prj = ProjectionPlot(ds, \"z\", [\"density\"], proj_style=\"sum\")\n",
       "prj.set_log(\"density\", True)\n",
       "prj.set_zlim(\"density\", 1.0e-3, 0.2)\n",
       "prj.show()"
@@ -303,4 +303,4 @@
    "metadata": {}
   }
  ]
-}
\ No newline at end of file
+}

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/clump_finding.rst
--- a/doc/source/analyzing/analysis_modules/clump_finding.rst
+++ b/doc/source/analyzing/analysis_modules/clump_finding.rst
@@ -84,8 +84,8 @@
   
   from yt.mods import *
   
-  pf = load("DD0000")
-  sp = pf.sphere([0.5, 0.5, 0.5], radius=0.1)
+  ds = load("DD0000")
+  sp = ds.sphere([0.5, 0.5, 0.5], radius=0.1)
   
   ratio = sp.quantities["IsBound"](truncate=False, include_thermal_energy=True,
       treecode=True, opening_angle=2.0)
@@ -97,8 +97,8 @@
   
   from yt.mods import *
   
-  pf = load("DD0000")
-  sp = pf.sphere([0.5, 0.5, 0.5], radius=0.1)
+  ds = load("DD0000")
+  sp = ds.sphere([0.5, 0.5, 0.5], radius=0.1)
   
   ratio = sp.quantities["IsBound"](truncate=False, include_thermal_energy=True,
       treecode=False)

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/ellipsoid_analysis.rst
--- a/doc/source/analyzing/analysis_modules/ellipsoid_analysis.rst
+++ b/doc/source/analyzing/analysis_modules/ellipsoid_analysis.rst
@@ -58,8 +58,8 @@
   from yt.mods import *
   from yt.analysis_modules.halo_finding.api import *
 
-  pf=load('Enzo_64/RD0006/RedshiftOutput0006')
-  halo_list = parallelHF(pf)
+  ds=load('Enzo_64/RD0006/RedshiftOutput0006')
+  halo_list = parallelHF(ds)
   halo_list.dump('MyHaloList')
 
 Ellipsoid Parameters
@@ -69,8 +69,8 @@
   from yt.mods import *
   from yt.analysis_modules.halo_finding.api import *
 
-  pf=load('Enzo_64/RD0006/RedshiftOutput0006')
-  haloes = LoadHaloes(pf, 'MyHaloList')
+  ds=load('Enzo_64/RD0006/RedshiftOutput0006')
+  haloes = LoadHaloes(ds, 'MyHaloList')
 
 Once the halo information is saved you can load it into the data
 object "haloes", you can get loop over the list of haloes and do
@@ -107,7 +107,7 @@
 
 .. code-block:: python
 
-  ell = pf.ellipsoid(ell_param[0],
+  ell = ds.ellipsoid(ell_param[0],
   ell_param[1],
   ell_param[2],
   ell_param[3],

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/halo_analysis.rst
--- a/doc/source/analyzing/analysis_modules/halo_analysis.rst
+++ b/doc/source/analyzing/analysis_modules/halo_analysis.rst
@@ -8,6 +8,7 @@
    :maxdepth: 1
 
    halo_catalogs
+   halo_transition
    halo_finding
    halo_mass_function
    halo_analysis_example

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b 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
@@ -7,9 +7,11 @@
 together into a single framework. This framework is substantially
 different from the limited framework included in yt-2.x and is only 
 backwards compatible in that output from old halo finders may be loaded.
+For a direct translation of various halo analysis tasks using yt-2.x
+to yt-3.0 please see :ref:`halo_transition`.
 
 A catalog of halos can be created from any initial dataset given to halo 
-catalog through data_pf. These halos can be found using friends-of-friends,
+catalog through data_ds. These halos can be found using friends-of-friends,
 HOP, and Rockstar. The finder_method keyword dictates which halo finder to
 use. The available arguments are 'fof', 'hop', and'rockstar'. For more
 details on the relative differences between these halo finders see 
@@ -19,32 +21,32 @@
 
    from yt.mods import *
    from yt.analysis_modules.halo_analysis.api import HaloCatalog
-   data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
-   hc = HaloCatalog(data_pf=data_pf, finder_method='hop')
+   data_ds = load('Enzo_64/RD0006/RedshiftOutput0006')
+   hc = HaloCatalog(data_ds=data_ds, finder_method='hop')
 
 A halo catalog may also be created from already run rockstar outputs. 
 This method is not implemented for previously run friends-of-friends or 
 HOP finders. Even though rockstar creates one file per processor, 
 specifying any one file allows the full catalog to be loaded. Here we 
 only specify the file output by the processor with ID 0. Note that the 
-argument for supplying a rockstar output is `halos_pf`, not `data_pf`.
+argument for supplying a rockstar output is `halos_ds`, not `data_ds`.
 
 .. code-block:: python
 
-   halos_pf = load(path+'rockstar_halos/halos_0.0.bin')
-   hc = HaloCatalog(halos_pf=halos_pf)
+   halos_ds = load(path+'rockstar_halos/halos_0.0.bin')
+   hc = HaloCatalog(halos_ds=halos_ds)
 
 Although supplying only the binary output of the rockstar halo finder 
 is sufficient for creating a halo catalog, it is not possible to find 
 any new information about the identified halos. To associate the halos 
 with the dataset from which they were found, supply arguments to both 
-halos_pf and data_pf.
+halos_ds and data_ds.
 
 .. code-block:: python
 
-   halos_pf = load(path+'rockstar_halos/halos_0.0.bin')
-   data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
-   hc = HaloCatalog(data_pf=data_pf, halos_pf=halos_pf)
+   halos_ds = load(path+'rockstar_halos/halos_0.0.bin')
+   data_ds = load('Enzo_64/RD0006/RedshiftOutput0006')
+   hc = HaloCatalog(data_ds=data_ds, halos_ds=halos_ds)
 
 A data container can also be supplied via keyword data_source, 
 associated with either dataset, to control the spatial region in 
@@ -215,8 +217,8 @@
 
 .. code-block:: python
 
-   hpf = load(path+"halo_catalogs/catalog_0046/catalog_0046.0.h5")
-   hc = HaloCatalog(halos_pf=hpf,
+   hds = load(path+"halo_catalogs/catalog_0046/catalog_0046.0.h5")
+   hc = HaloCatalog(halos_ds=hds,
                     output_dir="halo_catalogs/catalog_0046")
    hc.add_callback("load_profiles", output_dir="profiles",
                    filename="virial_profiles")

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/halo_finders.rst
--- /dev/null
+++ b/doc/source/analyzing/analysis_modules/halo_finders.rst
@@ -0,0 +1,192 @@
+.. _halo_finding:
+
+Halo Finding
+============
+
+There are four methods of finding particle haloes in yt. The 
+recommended and default method is called HOP, a method described 
+in `Eisenstein and Hut (1998) 
+<http://adsabs.harvard.edu/abs/1998ApJ...498..137E>`_. A basic 
+friends-of-friends (e.g. `Efstathiou et al. (1985) 
+<http://adsabs.harvard.edu/abs/1985ApJS...57..241E>`_) halo 
+finder is also implemented. Finally Rockstar (`Behroozi et a. 
+(2011) <http://adsabs.harvard.edu/abs/2011arXiv1110.4372B>`_) is 
+a 6D-phase space halo finder developed by Peter Behroozi that 
+excels in finding subhalos and substrcture, but does not allow 
+multiple particle masses.
+
+HOP
+---
+
+The version of HOP used in yt is an upgraded version of the 
+`publicly available HOP code 
+<http://cmb.as.arizona.edu/~eisenste/hop/hop.html>`_. Support 
+for 64-bit floats and integers has been added, as well as 
+parallel analysis through spatial decomposition. HOP builds 
+groups in this fashion:
+
+  1. Estimates the local density at each particle using a 
+       smoothing kernel.
+  2. Builds chains of linked particles by 'hopping' from one 
+       particle to its densest neighbor. A particle which is 
+       its own densest neighbor is the end of the chain.
+  3. All chains that share the same densest particle are 
+       grouped together.
+  4. Groups are included, linked together, or discarded 
+       depending on the user-supplied over density
+       threshold parameter. The default is 160.0.
+
+Please see the `HOP method paper 
+<http://adsabs.harvard.edu/abs/1998ApJ...498..137E>`_ for 
+full details.
+
+.. warning:: The FoF halo finder in yt is not thoroughly tested! 
+    It is probably fine to use, but you are strongly encouraged 
+    to check your results against the data for errors.
+
+Rockstar Halo Finding
+---------------------
+
+Rockstar uses an adaptive hierarchical refinement of friends-of-friends 
+groups in six phase-space dimensions and one time dimension, which 
+allows for robust (grid-independent, shape-independent, and noise-
+resilient) tracking of substructure. The code is prepackaged with yt, 
+but also `separately available <http://code.google.com/p/rockstar>`_. The lead 
+developer is Peter Behroozi, and the methods are described in `Behroozi
+et al. 2011 <http://rockstar.googlecode.com/files/rockstar_ap101911.pdf>`_. 
+
+.. note:: At the moment, Rockstar does not support multiple particle masses, 
+  instead using a fixed particle mass. This will not affect most dark matter 
+  simulations, but does make it less useful for finding halos from the stellar
+  mass. In simulations where the highest-resolution particles all have the 
+  same mass (ie: zoom-in grid based simulations), one can set up a particle
+  filter to select the lowest mass particles and perform the halo finding
+  only on those.
+
+To run the Rockstar Halo finding, you must launch python with MPI and 
+parallelization enabled. While Rockstar itself does not require MPI to run, 
+the MPI libraries allow yt to distribute particle information across multiple 
+nodes.
+
+.. warning:: At the moment, running Rockstar inside of yt on multiple compute nodes
+   connected by an Infiniband network can be problematic. Therefore, for now
+   we recommend forcing the use of the non-Infiniband network (e.g. Ethernet)
+   using this flag: ``--mca btl ^openib``.
+   For example, here is how Rockstar might be called using 24 cores:
+   ``mpirun -n 24 --mca btl ^openib python ./run_rockstar.py --parallel``.
+
+The script above configures the Halo finder, launches a server process which 
+disseminates run information and coordinates writer-reader processes. 
+Afterwards, it launches reader and writer tasks, filling the available MPI 
+slots, which alternately read particle information and analyze for halo 
+content.
+
+The RockstarHaloFinder class has these options that can be supplied to the 
+halo catalog through the ``finder_kwargs`` argument:
+
+  * ``dm_type``, the index of the dark matter particle. Default is 1. 
+  * ``outbase``, This is where the out*list files that Rockstar makes should be
+    placed. Default is 'rockstar_halos'.
+  * ``num_readers``, the number of reader tasks (which are idle most of the 
+    time.) Default is 1.
+  * ``num_writers``, the number of writer tasks (which are fed particles and
+    do most of the analysis). Default is MPI_TASKS-num_readers-1. 
+    If left undefined, the above options are automatically 
+    configured from the number of available MPI tasks.
+  * ``force_res``, the resolution that Rockstar uses for various calculations
+    and smoothing lengths. This is in units of Mpc/h.
+    If no value is provided, this parameter is automatically set to
+    the width of the smallest grid element in the simulation from the
+    last data snapshot (i.e. the one where time has evolved the
+    longest) in the time series:
+    ``ds_last.index.get_smallest_dx() * ds_last['mpch']``.
+  * ``total_particles``, if supplied, this is a pre-calculated
+    total number of dark matter
+    particles present in the simulation. For example, this is useful
+    when analyzing a series of snapshots where the number of dark
+    matter particles should not change and this will save some disk
+    access time. If left unspecified, it will
+    be calculated automatically. Default: ``None``.
+  * ``dm_only``, if set to ``True``, it will be assumed that there are
+    only dark matter particles present in the simulation.
+    This option does not modify the halos found by Rockstar, however
+    this option can save disk access time if there are no star particles
+    (or other non-dark matter particles) in the simulation. Default: ``False``.
+
+Rockstar dumps halo information in a series of text (halo*list and 
+out*list) and binary (halo*bin) files inside the ``outbase`` directory. 
+We use the halo list classes to recover the information. 
+
+Inside the ``outbase`` directory there is a text file named ``datasets.txt``
+that records the connection between ds names and the Rockstar file names.
+
+Parallel HOP and FOF
+--------------------
+
+Both the HOP and FoF halo finders can run in parallel using simple 
+spatial decomposition. In order to run them in parallel it is helpful 
+to understand how it works. Below in the first plot (i) is a simplified 
+depiction of three haloes labeled 1,2 and 3:
+
+.. image:: _images/ParallelHaloFinder.png
+   :width: 500
+
+Halo 3 is twice reflected around the periodic boundary conditions.
+
+In (ii), the volume has been sub-divided into four equal subregions, 
+A,B,C and D, shown with dotted lines. Notice that halo 2 is now in 
+two different subregions, C and D, and that halo 3 is now in three, 
+A, B and D. If the halo finder is run on these four separate subregions,
+halo 1 is be identified as a single halo, but haloes 2 and 3 are split 
+up into multiple haloes, which is incorrect. The solution is to give 
+each subregion padding to oversample into neighboring regions.
+
+In (iii), subregion C has oversampled into the other three regions, 
+with the periodic boundary conditions taken into account, shown by 
+dot-dashed lines. The other subregions oversample in a similar way.
+
+The halo finder is then run on each padded subregion independently 
+and simultaneously. By oversampling like this, haloes 2 and 3 will 
+both be enclosed fully in at least one subregion and identified 
+completely.
+
+Haloes identified with centers of mass inside the padded part of a 
+subregion are thrown out, eliminating the problem of halo duplication. 
+The centers for the three haloes are shown with stars. Halo 1 will
+belong to subregion A, 2 to C and 3 to B.
+
+To run with parallel halo finding, you must supply a value for 
+padding in the finder_kwargs argument. The ``padding`` parameter 
+is in simulation units and defaults to 0.02. This parameter is how 
+much padding is added to each of the six sides of a subregion. 
+This value should be 2x-3x larger than the largest expected halo 
+in the simulation. It is unlikely, of course, that the largest 
+object in the simulation will be on a subregion boundary, but there 
+is no way of knowing before the halo finder is run.
+
+.. code-block:: python
+
+  from yt.mods import *
+  from yt.analysis_modules.halo_analysis.api import *
+  ds = load("data0001")
+  hc= HaloCatalog(data_ds =ds,finder_method='hop'
+    finder_kwargs={'padding':0.02})
+  # --or--
+  hc= HaloCatalog(data_ds =ds,finder_method='fof'
+    finder_kwargs={'padding':0.02})
+
+
+In general, a little bit of padding goes a long way, and too much 
+just slows down the analysis and doesn't improve the answer (but 
+doesn't change it).  It may be worth your time to run the parallel 
+halo finder at a few paddings to find the right amount, especially 
+if you're analyzing many similar datasets.
+
+Rockstar Installation
+=====================
+
+The Rockstar is slightly patched and modified to run as a library inside of 
+yt. By default it will be built with yt using the ``install_script.sh``.
+If it wasn't installed, please make sure that the installation setting
+``INST_ROCKSTAR=1`` is defined in the ``install_script.sh`` and re-run
+the installation script.

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/halo_mass_function.rst
--- a/doc/source/analyzing/analysis_modules/halo_mass_function.rst
+++ b/doc/source/analyzing/analysis_modules/halo_mass_function.rst
@@ -60,8 +60,8 @@
 
   from yt.mods import *
   from yt.analysis_modules.halo_mass_function.api import *
-  pf = load("data0030")
-  hmf = HaloMassFcn(pf, halo_file="FilteredQuantities.out", num_sigma_bins=200,
+  ds = load("data0030")
+  hmf = HaloMassFcn(ds, halo_file="FilteredQuantities.out", num_sigma_bins=200,
   mass_column=5)
 
 Attached to ``hmf`` is the convenience function ``write_out``, which saves
@@ -102,8 +102,8 @@
 
   from yt.mods import *
   from yt.analysis_modules.halo_mass_function.api import *
-  pf = load("data0030")
-  hmf = HaloMassFcn(pf, halo_file="FilteredQuantities.out", 
+  ds = load("data0030")
+  hmf = HaloMassFcn(ds, halo_file="FilteredQuantities.out", 
   sigma8input=0.9, primordial_index=1., omega_baryon0=0.06,
   fitting_function=4)
   hmf.write_out(prefix='hmf')

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/halo_profiling.rst
--- a/doc/source/analyzing/analysis_modules/halo_profiling.rst
+++ /dev/null
@@ -1,451 +0,0 @@
-.. _halo_profiling:
-
-Halo Profiling
-==============
-.. sectionauthor:: Britton Smith <brittonsmith at gmail.com>,
-   Stephen Skory <s at skory.us>
-
-The ``HaloProfiler`` provides a means of performing analysis on multiple halos 
-in a parallel-safe way.
-
-The halo profiler performs three primary functions: radial profiles, 
-projections, and custom analysis.  See the cookbook for a recipe demonstrating 
-all of these features.
-
-Configuring the Halo Profiler
------------------------------
-
-The only argument required to create a ``HaloProfiler`` object is the path 
-to the dataset.
-
-.. code-block:: python
-
-  from yt.analysis_modules.halo_profiler.api import *
-  hp = HaloProfiler("enzo_tiny_cosmology/DD0046/DD0046")
-
-Most of the halo profiler's options are configured with additional keyword 
-arguments:
-
- * **output_dir** (*str*): if specified, all output will be put into this path
-   instead of in the dataset directories.  Default: None.
-
- * **halos** (*str*): "multiple" for profiling more than one halo.  In this mode
-   halos are read in from a list or identified with a
-   `halo finder <../cookbook/running_halofinder.html>`_.  In "single" mode, the
-   one and only halo center is identified automatically as the location of the
-   peak in the density field.  Default: "multiple".
-
- * **halo_list_file** (*str*): name of file containing the list of halos.
-   The halo profiler will look for this file in the data directory.
-   Default: "HopAnalysis.out".
-
- * **halo_list_format** (*str* or *dict*): the format of the halo list file.
-   "yt_hop" for the format given by yt's halo finders.  "enzo_hop" for the
-   format written by enzo_hop.  This keyword can also be given in the form of a
-   dictionary specifying the column in which various properties can be found.
-   For example, {"id": 0, "center": [1, 2, 3], "mass": 4, "radius": 5}.
-   Default: "yt_hop".
-
- * **halo_finder_function** (*function*): If halos is set to multiple and the
-   file given by halo_list_file does not exit, the halo finding function
-   specified here will be called.  Default: HaloFinder (yt_hop).
-
- * **halo_finder_args** (*tuple*): args given with call to halo finder function.
-   Default: None.
-
- * **halo_finder_kwargs** (*dict*): kwargs given with call to halo finder
-   function. Default: None.
-
- * **recenter** (*string* or function name): The name of a function
-   that will be used to move the center of the halo for the purposes of
-   analysis. See explanation and examples, below. Default: None, which
-   is equivalent to the center of mass of the halo as output by the halo
-   finder.
-
- * **halo_radius** (*float*): if no halo radii are provided in the halo list
-   file, this parameter is used to specify the radius out to which radial
-   profiles will be made.  This keyword is also used when halos is set to
-   single.  Default: 0.1.
-
- * **radius_units** (*str*): the units of **halo_radius**. 
-   Default: "1" (code units).
-
- * **n_profile_bins** (*int*): the number of bins in the radial profiles.
-   Default: 50.
-
- * **profile_output_dir** (*str*): the subdirectory, inside the data directory,
-   in which radial profile output files will be created.  The directory will be
-   created if it does not exist.  Default: "radial_profiles".
-
- * **projection_output_dir** (*str*): the subdirectory, inside the data
-   directory, in which projection output files will be created.  The directory
-   will be created if it does not exist.  Default: "projections".
-
- * **projection_width** (*float*): the width of halo projections.
-   Default: 8.0.
-
- * **projection_width_units** (*str*): the units of projection_width.
-   Default: "mpc".
-
- * **project_at_level** (*int* or "max"): the maximum refinement level to be
-   included in projections.  Default: "max" (maximum level within the dataset).
-
- * **velocity_center** (*list*): the method in which the halo bulk velocity is
-   calculated (used for calculation of radial and tangential velocities.  Valid
-   options are:
-   - ["bulk", "halo"] (Default): the velocity provided in the halo list
-   - ["bulk", "sphere"]: the bulk velocity of the sphere centered on the halo center.
-   - ["max", field]: the velocity of the cell that is the location of the maximum of the field specified.
-
- * **filter_quantities** (*list*): quantities from the original halo list
-   file to be written out in the filtered list file.  Default: ['id','center'].
-
- * **use_critical_density** (*bool*): if True, the definition of overdensity 
-     for virial quantities is calculated with respect to the critical 
-     density.  If False, overdensity is with respect to mean matter density, 
-     which is lower by a factor of Omega_M.  Default: False.
-
-Profiles
---------
-
-Once the halo profiler object has been instantiated, fields can be added for 
-profiling with the :meth:`add_profile` method:
-
-.. code-block:: python
-
-  hp.add_profile('cell_volume', weight_field=None, accumulation=True)
-  hp.add_profile('TotalMassMsun', weight_field=None, accumulation=True)
-  hp.add_profile('density', weight_field=None, accumulation=False)
-  hp.add_profile('temperature', weight_field='cell_mass', accumulation=False)
-  hp.make_profiles(njobs=-1, prefilters=["halo['mass'] > 1e13"],
-                   filename='VirialQuantities.h5')
-
-The :meth:`make_profiles` method will begin the profiling.  Use the
-**njobs** keyword to control the number of jobs over which the
-profiling is divided.  Setting to -1 results in a single processor per
-halo.  Setting to 1 results in all available processors working on the
-same halo.  The prefilters keyword tells the profiler to skip all halos with 
-masses (as loaded from the halo finder) less than a given amount.  See below 
-for more information.  Additional keyword arguments are:
-
- * **filename** (*str*): If set, a file will be written with all of the 
-   filtered halos and the quantities returned by the filter functions.
-   Default: None.
-
- * **prefilters** (*list*): A single dataset can contain thousands or tens of 
-   thousands of halos. Significant time can be saved by not profiling halos
-   that are certain to not pass any filter functions in place.  Simple filters 
-   based on quantities provided in the initial halo list can be used to filter 
-   out unwanted halos using this parameter.  Default: None.
-
- * **njobs** (*int*): The number of jobs over which to split the profiling.  
-   Set to -1 so that each halo is done by a single processor.  Default: -1.
-
- * **dynamic** (*bool*): If True, distribute halos using a task queue.  If 
-   False, distribute halos evenly over all jobs.  Default: False.
-
- * **profile_format** (*str*): The file format for the radial profiles, 
-   'ascii' or 'hdf5'.  Default: 'ascii'.
-
-.. image:: _images/profiles.png
-   :width: 500
-
-Radial profiles of Overdensity (left) and Temperature (right) for five halos.
-
-Projections
------------
-
-The process of making projections is similar to that of profiles:
-
-.. code-block:: python
-
-  hp.add_projection('density', weight_field=None)
-  hp.add_projection('temperature', weight_field='density')
-  hp.add_projection('metallicity', weight_field='density')
-  hp.make_projections(axes=[0, 1, 2], save_cube=True, save_images=True, 
-                      halo_list="filtered", njobs=-1)
-
-If **save_cube** is set to True, the projection data
-will be written to a set of hdf5 files 
-in the directory given by **projection_output_dir**. 
-The keyword, **halo_list**, can be 
-used to select between the full list of halos ("all"),
-the filtered list ("filtered"), or 
-an entirely new list given in the form of a file name.
-See :ref:`filter_functions` for a 
-discussion of filtering halos.  Use the **njobs** keyword to control
-the number of jobs over which the profiling is divided.  Setting to -1
-results in a single processor per halo.  Setting to 1 results in all
-available processors working on the same halo.  The keyword arguments are:
-
- * **axes** (*list*): A list of the axes to project along, using the usual 
-   0,1,2 convention. Default=[0,1,2].
-
- * **halo_list** (*str*) {'filtered', 'all'}: Which set of halos to make 
-   profiles of, either ones passed by the halo filters (if enabled/added), or 
-   all halos.  Default='filtered'.
-
- * **save_images** (*bool*): Whether or not to save images of the projections. 
-   Default=False.
-
- * **save_cube** (*bool*): Whether or not to save the HDF5 files of the halo 
-   projections.  Default=True.
-
- * **njobs** (*int*): The number of jobs over which to split the projections.  
-   Set to -1 so that each halo is done by a single processor.  Default: -1.
-
- * **dynamic** (*bool*): If True, distribute halos using a task queue.  If 
-   False, distribute halos evenly over all jobs.  Default: False.
-
-.. image:: _images/projections.png
-   :width: 500
-
-Projections of Density (top) and Temperature,
-weighted by Density (bottom), in the x (left), 
-y (middle), and z (right) directions for a single halo with a width of 8 Mpc.
-
-Halo Filters
-------------
-
-Filters can be added to create a refined list of
-halos based on their profiles or to avoid 
-profiling halos altogether based on information
-given in the halo list file.
-
-.. _filter_functions:
-
-Filter Functions
-^^^^^^^^^^^^^^^^
-
-It is often the case that one is looking to
-identify halos with a specific set of 
-properties.  This can be accomplished through the creation
-of filter functions.  A filter 
-function can take as many args and kwargs as you like,
-as long as the first argument is a 
-profile object, or at least a dictionary which contains
-the profile arrays for each field.  
-Filter functions must return a list of two things.
-The first is a True or False indicating 
-whether the halo passed the filter. 
-The second is a dictionary containing quantities 
-calculated for that halo that will be written to a
-file if the halo passes the filter.
-A  sample filter function based on virial quantities can be found in 
-``yt/analysis_modules/halo_profiler/halo_filters.py``.
-
-Halo filtering takes place during the call to :meth:`make_profiles`.
-The  :meth:`add_halo_filter` method is used to add a filter to be used
-during the profiling:
-
-.. code-block:: python
-
-  hp.add_halo_filter(HP.VirialFilter, must_be_virialized=True, 
-                     overdensity_field='ActualOverdensity', 
-		     virial_overdensity=200, 
-		     virial_filters=[['TotalMassMsun','>=','1e14']],
-		     virial_quantities=['TotalMassMsun','RadiusMpc'],
-		     use_log=True)
-
-The addition above will calculate and return virial quantities,
-mass and radius, for an 
-overdensity of 200.  In order to pass the filter, at least one
-point in the profile must be 
-above the specified overdensity and the virial mass must be at
-least 1e14 solar masses.  The **use_log** keyword indicates that interpolation 
-should be done in log space.  If 
-the VirialFilter function has been added to the filter list,
-the halo profiler will make 
-sure that the fields necessary for calculating virial quantities are added.
-As  many filters as desired can be added.  If filters have been added,
-the next call to :meth:`make_profiles` will filter by all of
-the added filter functions:
-
-.. code-block:: python
-
-  hp.make_profiles(filename="FilteredQuantities.out")
-
-If the **filename** keyword is set, a file will be written with all of the 
-filtered halos and the quantities returned by the filter functions.
-
-.. note:: If the profiles have already been run, the halo profiler will read
-   in the previously created output files instead of re-running the profiles.
-   The halo profiler will check to make sure the output file contains all of
-   the requested halo fields.  If not, the profile will be made again from
-   scratch.
-
-.. _halo_profiler_pre_filters:
-
-Pre-filters
-^^^^^^^^^^^
-
-A single dataset can contain thousands or tens of thousands of halos.
-Significant time can 
-be saved by not profiling halos that are certain to not pass any filter
-functions in place.  
-Simple filters based on quantities provided in the initial halo list
-can be used to filter 
-out unwanted halos using the **prefilters** keyword:
-
-.. code-block:: python
-
-  hp.make_profiles(filename="FilteredQuantities.out",
-		   prefilters=["halo['mass'] > 1e13"])
-
-Arguments provided with the **prefilters** keyword should be given
-as a list of strings.  
-Each string in the list will be evaluated with an *eval*.
-
-.. note:: If a VirialFilter function has been added with a filter based
-   on mass (as in the example above), a prefilter will be automatically
-   added to filter out halos with masses greater or less than (depending
-   on the conditional of the filter) a factor of ten of the specified
-   virial mass.
-
-Recentering the Halo For Analysis
----------------------------------
-
-It is possible to move the center of the halo to a new point using an
-arbitrary function for making profiles.
-By default, the center is provided by the halo finder,
-which outputs the center of mass of the particles. For the purposes of
-analysis, it may be important to recenter onto a gas density maximum,
-or a temperature minimum.
-
-There are a number of built-in functions to do this, listed below.
-Each of the functions uses mass-weighted fields for the calculations
-of new center points.
-To use
-them, supply the HaloProfiler with the ``recenter`` option and 
-the name of the function, as in the example below.
-
-.. code-block:: python
-
-   hp = HaloProfiler("enzo_tiny_cosmology/DD0046/DD0046", 
-                     recenter="Max_Dark_Matter_Density")
-
-Additional options are:
-
-  * *Min_Dark_Matter_Density* - Recenter on the point of minimum dark matter
-    density in the halo.
-
-  * *Max_Dark_Matter_Density* - Recenter on the point of maximum dark matter
-    density in the halo.
-
-  * *CoM_Dark_Matter_Density* - Recenter on the center of mass of the dark
-    matter density field. This will be very similar to what the halo finder
-    provides, but not precisely similar.
-
-  * *Min_Gas_Density* - Recenter on the point of minimum gas density in the
-    halo.
-
-  * *Max_Gas_Density* - Recenter on the point of maximum gas density in the
-    halo.
-
-  * *CoM_Gas_Density* - Recenter on the center of mass of the gas density field
-    in the halo.
-
-  * *Min_Total_Density* - Recenter on the point of minimum total (gas + dark
-    matter) density in the halo.
-
-  * *Max_Total_Density* - Recenter on the point of maximum total density in the
-    halo.
-
-  * *CoM_Total_Density* - Recenter on the center of mass for the total density
-    in the halo.
-
-  * *Min_Temperature* - Recenter on the point of minimum temperature in the
-    halo.
-
-  * *Max_Temperature* - Recenter on the point of maximum temperature in the
-    halo.
-
-It is also possible to supply a user-defined function to the HaloProfiler.
-This can be used if the pre-defined functions above are not sufficient.
-The function takes a single argument, a data container for the halo,
-which is a sphere. The function returns a 3-list with the new center.
-
-In this example below, a function is used such that the halos will be
-re-centered on the point of absolute minimum temperature, that is not
-mass weighted.
-
-.. code-block:: python
-
-   from yt.mods import *
-   
-   def find_min_temp(sphere):
-       ma, mini, mx, my, mz, mg = sphere.quantities['MinLocation']('temperature')
-       return [mx,my,mz]
-   
-   hp = HaloProfiler("enzo_tiny_cosmology/DD0046/DD0046", recenter=find_min_temp)
-
-It is possible to make more complicated functions. This example below extends
-the example above to include a distance control that prevents the center from
-being moved too far. If the recenter moves too far, ``[-1, -1, -1]`` is
-returned which will prevent the halo from being profiled.
-Any triplet of values less than the ``domain_left_edge`` will suffice.
-There will be a note made in the output (stderr) showing which halos were
-skipped.
-
-.. code-block:: python
-
-   from yt.mods import *
-   from yt.utilities.math_utils import periodic_dist
-   
-   def find_min_temp_dist(sphere):
-       old = sphere.center
-       ma, mini, mx, my, mz, mg = sphere.quantities['MinLocation']('temperature')
-       d = sphere.pf['kpc'] * periodic_dist(old, [mx, my, mz],
-           sphere.pf.domain_right_edge - sphere.pf.domain_left_edge)
-       # If new center farther than 5 kpc away, don't recenter
-       if d > 5.: return [-1, -1, -1]
-       return [mx,my,mz]
-   
-   hp = HaloProfiler("enzo_tiny_cosmology/DD0046/DD0046", 
-                     recenter=find_min_temp_dist)
-
-Custom Halo Analysis
---------------------
-
-Besides radial profiles and projections, the halo profiler has the
-ability to run custom analysis functions on each halo.  Custom halo
-analysis functions take two arguments: a halo dictionary containing
-the id, center, etc; and a sphere object.  The example function shown
-below creates a 2D profile of the total mass in bins of density and
-temperature for a given halo.
-
-.. code-block:: python
-
-   from yt.mods import *
-   from yt.data_objects.profiles import BinnedProfile2D
-
-   def halo_2D_profile(halo, sphere):
-       "Make a 2D profile for a halo."
-       my_profile = BinnedProfile2D(sphere,
-             128, 'density', 1e-30, 1e-24, True,
-             128, 'temperature', 1e2, 1e7, True,
-             end_collect=False)
-       my_profile.add_fields('cell_mass', weight=None, fractional=False)
-       my_filename = os.path.join(sphere.pf.fullpath, '2D_profiles', 
-             'Halo_%04d.h5' % halo['id'])
-       my_profile.write_out_h5(my_filename)
-
-Using the  :meth:`analyze_halo_spheres` function, the halo profiler
-will create a sphere centered on each halo, and perform the analysis
-from the custom routine.
-
-.. code-block:: python
-
-    hp.analyze_halo_sphere(halo_2D_profile, halo_list='filtered',
-                           analysis_output_dir='2D_profiles', 
-                           njobs=-1, dynamic=False)
-
-Just like with the :meth:`make_projections` function, the keyword,
-**halo_list**, can be used to select between the full list of halos
-("all"), the filtered list ("filtered"), or an entirely new list given
-in the form of a file name.  If the **analysis_output_dir** keyword is
-set, the halo profiler will make sure the desired directory exists in
-a parallel-safe manner.  Use the **njobs** keyword to control the
-number of jobs over which the profiling is divided.  Setting to -1
-results in a single processor per halo.  Setting to 1 results in all
-available processors working on the same halo.

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/halo_transition.rst
--- /dev/null
+++ b/doc/source/analyzing/analysis_modules/halo_transition.rst
@@ -0,0 +1,106 @@
+
+Getting up to Speed with Halo Analysis in yt-3.0
+================================================
+
+If you're used to halo analysis in yt-2.x, heres a guide to
+how to update your analysis pipeline to take advantage of
+the new halo catalog infrastructure. 
+
+Finding Halos
+-------------
+
+Previously, halos were found using calls to ``HaloFinder``, 
+``FOFHaloFinder`` and ``RockstarHaloFinder``. Now it is 
+encouraged that you find the halos upon creation of the halo catalog 
+by supplying a value to the ``finder_method`` keyword when calling
+``HaloCatalog``. Currently, only halos found using rockstar or a 
+previous instance of a halo catalog are able to be loaded 
+using the ``halos_ds`` keyword.
+
+To pass additional arguments to the halo finders 
+themselves, supply a dictionary to ``finder_kwargs`` where
+each key in the dictionary is a keyword of the halo finder
+and the corresponding value is the value to be passed for
+that keyword.
+
+Getting Halo Information
+------------------------
+All quantities that used to be present in a ``halo_list`` are
+still able to be found but are not necessarily included by default.
+Every halo will by default have the following properties:
+
+* particle_position_i (where i can be x,y,z)
+* particle_mass
+* virial_radius
+* particle_identifier
+
+If other quantities are desired, they can be included by adding
+the corresponding quantity before the catalog is created. See
+the full halo catalog documentation for further information about
+how to add these quantities and what quantities are available.
+
+You no longer have to iteratre over halos in the ``halo_list``.
+Now a halo dataset can be treated as a regular dataset and 
+all quantities are available by accessing ``all_data``.
+Specifically, all quantities can be accessed as shown:
+
+.. code-block:: python
+   from yt.mods import *
+   from yt.analysis_modules.halo_analysis.api import HaloCatalog
+   data_ds = load('Enzo_64/RD0006/RedshiftOutput0006')
+   hc = HaloCatalog(data_ds=data_ds, finder_method='hop')
+   hc.create()
+   ad = hc.all_data()
+   masses = ad['particle_mass'][:]
+
+
+Prefiltering Halos
+------------------
+
+Prefiltering halos before analysis takes place is now done
+by adding a filter before the call to create. An example
+is shown below
+
+.. code-block:: python
+   from yt.mods import *
+   from yt.analysis_modules.halo_analysis.api import HaloCatalog
+   data_ds = load('Enzo_64/RD0006/RedshiftOutput0006')
+   hc = HaloCatalog(data_ds=data_ds, finder_method='hop')
+   hc.add_filter("quantity_value", "particle_mass", ">", 1e13, "Msun")
+   hc.create()
+
+Profiling Halos
+---------------
+
+The halo profiler available in yt-2.x has been removed, and
+profiling functionality is now completely contained within the
+halo catalog. A complete example of how to profile halos by 
+radius using the new infrastructure is given in 
+:ref:`halo_analysis_example`. 
+
+Plotting Halos
+--------------
+
+Annotating halo locations onto a slice or projection works in 
+the same way as in yt-2.x, but now a halo catalog must be
+passed to the annotate halo call rather than a halo list.
+
+.. code-block:: python
+   from yt.mods import *
+   from yt.analysis_modules.halo_analysis.api import HaloCatalog
+
+   data_ds = load('Enzo_64/RD0006/RedshiftOutput0006')
+   hc = HaloCatalog(data_ds=data_ds, finder_method='hop')
+   hc.create()
+
+   prj = ProjectionPlot(data_ds, 'z', 'density')
+   prj.annotate_halos(hc)
+   prj.save()
+
+Written Data
+------------
+
+Data is now written out in the form of h5 files rather than
+text files. The directory they are written out to is 
+controlled by the keyword ``output_dir``. Each quantity
+is a field in the file.

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/hmf_howto.rst
--- a/doc/source/analyzing/analysis_modules/hmf_howto.rst
+++ b/doc/source/analyzing/analysis_modules/hmf_howto.rst
@@ -27,8 +27,8 @@
 .. code-block:: python
 
   from yt.mods import *
-  pf = load("data0001")
-  halo_list = HaloFinder(pf)
+  ds = load("data0001")
+  halo_list = HaloFinder(ds)
   halo_list.write_out("HopAnalysis.out")
 
 The only important columns of data in the text file ``HopAnalysis.out``
@@ -79,8 +79,8 @@
 
   from yt.mods import *
   from yt.analysis_modules.halo_mass_function.api import *
-  pf = load("data0001")
-  hmf = HaloMassFcn(pf, halo_file="VirialHaloes.out", 
+  ds = load("data0001")
+  hmf = HaloMassFcn(ds, halo_file="VirialHaloes.out", 
   sigma8input=0.9, primordial_index=1., omega_baryon0=0.06,
   fitting_function=4, mass_column=5, num_sigma_bins=200)
   hmf.write_out(prefix='hmf')
@@ -107,9 +107,9 @@
   from yt.analysis_modules.halo_mass_function.api import *
   
   # If desired, start loop here.
-  pf = load("data0001")
+  ds = load("data0001")
   
-  halo_list = HaloFinder(pf)
+  halo_list = HaloFinder(ds)
   halo_list.write_out("HopAnalysis.out")
   
   hp = HP.HaloProfiler("data0001", halo_list_file='HopAnalysis.out')
@@ -120,7 +120,7 @@
                 virial_quantities=['TotalMassMsun','RadiusMpc'])
   hp.make_profiles(filename="VirialHaloes.out")
   
-  hmf = HaloMassFcn(pf, halo_file="VirialHaloes.out", 
+  hmf = HaloMassFcn(ds, halo_file="VirialHaloes.out", 
   sigma8input=0.9, primordial_index=1., omega_baryon0=0.06,
   fitting_function=4, mass_column=5, num_sigma_bins=200)
   hmf.write_out(prefix='hmf')

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/light_cone_generator.rst
--- a/doc/source/analyzing/analysis_modules/light_cone_generator.rst
+++ b/doc/source/analyzing/analysis_modules/light_cone_generator.rst
@@ -60,7 +60,7 @@
    when gathering datasets for time series.  Default: True.
 
  * **set_parameters** (*dict*): Dictionary of parameters to attach to 
-   pf.parameters.  Default: None.
+   ds.parameters.  Default: None.
 
  * **output_dir** (*string*): The directory in which images and data files
     will be written.  Default: 'LC'.

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/merger_tree.rst
--- a/doc/source/analyzing/analysis_modules/merger_tree.rst
+++ b/doc/source/analyzing/analysis_modules/merger_tree.rst
@@ -2,8 +2,9 @@
 
 Halo Merger Tree
 ================
-.. sectionauthor:: Stephen Skory <sskory at physics.ucsd.edu>
-.. versionadded:: 1.7
+
+.. note:: At the moment the merger tree is not yet implemented using new 
+    halo catalog functionality. 
 
 The Halo Merger Tree extension is capable of building a database of halo mergers
 over a set of time-ordered Enzo datasets. The fractional contribution of older

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b 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
@@ -48,7 +48,7 @@
 
 .. code:: python
 
-    pf = load("MHDSloshing/virgo_low_res.0054.vtk",
+    ds = load("MHDSloshing/virgo_low_res.0054.vtk",
               parameters={"time_unit":(1.0,"Myr"),
                           "length_unit":(1.0,"Mpc"),
                           "mass_unit":(1.0e14,"Msun")}) 
@@ -423,7 +423,7 @@
 evacuated two "bubbles" of radius 30 kpc at a distance of 50 kpc from
 the center. 
 
-Now, we create a parameter file out of this dataset:
+Now, we create a yt Dataset object out of this dataset:
 
 .. code:: python
 
@@ -445,7 +445,7 @@
 
 .. code:: python
 
-   sphere = ds.sphere(pf.domain_center, (1.0,"Mpc"))
+   sphere = ds.sphere(ds.domain_center, (1.0,"Mpc"))
        
    A = 6000.
    exp_time = 2.0e5

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/radial_column_density.rst
--- a/doc/source/analyzing/analysis_modules/radial_column_density.rst
+++ b/doc/source/analyzing/analysis_modules/radial_column_density.rst
@@ -41,15 +41,15 @@
 
   from yt.mods import *
   from yt.analysis_modules.radial_column_density.api import *
-  pf = load("data0030")
+  ds = load("data0030")
   
-  rcdnumdens = RadialColumnDensity(pf, 'NumberDensity', [0.5, 0.5, 0.5],
+  rcdnumdens = RadialColumnDensity(ds, 'NumberDensity', [0.5, 0.5, 0.5],
     max_radius = 0.5)
   def _RCDNumberDensity(field, data, rcd = rcdnumdens):
       return rcd._build_derived_field(data)
   add_field('RCDNumberDensity', _RCDNumberDensity, units=r'1/\rm{cm}^2')
   
-  dd = pf.h.all_data()
+  dd = ds.all_data()
   print dd['RCDNumberDensity']
 
 The field ``RCDNumberDensity`` can be used just like any other derived field

diff -r eceb0c4887c19f030a4148472a2e5320c66ef8a4 -r fda46944799edac4d594ed73c1df39fe72c5284b doc/source/analyzing/analysis_modules/radmc3d_export.rst
--- a/doc/source/analyzing/analysis_modules/radmc3d_export.rst
+++ b/doc/source/analyzing/analysis_modules/radmc3d_export.rst
@@ -41,8 +41,8 @@
 
 .. code-block:: python
 
-    pf = load("galaxy0030/galaxy0030")
-    writer = RadMC3DWriter(pf)
+    ds = load("galaxy0030/galaxy0030")
+    writer = RadMC3DWriter(ds)
     
     writer.write_amr_grid()
     writer.write_dust_file("DustDensity", "dust_density.inp")
@@ -87,8 +87,8 @@
         return (x_co/mu_h)*data["density"]
     add_field("NumberDensityCO", function=_NumberDensityCO)
     
-    pf = load("galaxy0030/galaxy0030")
-    writer = RadMC3DWriter(pf)
+    ds = load("galaxy0030/galaxy0030")
+    writer = RadMC3DWriter(ds)
     
     writer.write_amr_grid()
     writer.write_line_file("NumberDensityCO", "numberdens_co.inp")

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

https://bitbucket.org/yt_analysis/yt/commits/3329ccb051c3/
Changeset:   3329ccb051c3
Branch:      yt-3.0
User:        chummels
Date:        2014-07-20 04:30:25
Summary:     Merging.
Affected #:  4 files

diff -r fda46944799edac4d594ed73c1df39fe72c5284b -r 3329ccb051c3e7374c5cd9dd0bc3869c11f63d08 doc/source/cookbook/calculating_information.rst
--- a/doc/source/cookbook/calculating_information.rst
+++ b/doc/source/cookbook/calculating_information.rst
@@ -58,6 +58,14 @@
 
 .. yt_cookbook:: time_series.py
 
+Simple Derived Fields
+~~~~~~~~~~~~~~~~~~~~~
+
+This recipe demonstrates how to create a simple derived field, number_density,
+ and then generate a projection from it.
+
+.. yt_cookbook:: derived_field.py
+
 Complex Derived Fields
 ~~~~~~~~~~~~~~~~~~~~~~
 

diff -r fda46944799edac4d594ed73c1df39fe72c5284b -r 3329ccb051c3e7374c5cd9dd0bc3869c11f63d08 doc/source/cookbook/derived_field.py
--- /dev/null
+++ b/doc/source/cookbook/derived_field.py
@@ -0,0 +1,23 @@
+import yt
+
+# Load the dataset.
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# You can create a derived field by manipulating any existing derived fields
+# in any way you choose.  In this case, let's just make a simple one:
+# number_density = density / mass
+
+# First create a function which yields your new derived field
+def number_density(field, data):
+    return data['gas', 'density']/data['gas', 'mass']
+
+# Then add it to your dataset and define the units
+ds.add_field(("gas", "number_density"), units="cm**-3", function=number_density)
+
+# It will now show up in your derived_field_list
+for i in sorted(ds.derived_field_list): 
+    print i
+
+# Let's use it to make a projection of the entire volume!
+ad = ds.all_data()
+yt.ProjectionPlot(ds, "x", "number_density").save()

diff -r fda46944799edac4d594ed73c1df39fe72c5284b -r 3329ccb051c3e7374c5cd9dd0bc3869c11f63d08 doc/source/cookbook/simulation_analysis.py
--- a/doc/source/cookbook/simulation_analysis.py
+++ b/doc/source/cookbook/simulation_analysis.py
@@ -2,21 +2,27 @@
 yt.enable_parallelism()
 import collections
 
-# Instantiate a time series object for an Enzo simulation..
-sim = yt.simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo')
+# Enable parallelism in the script (assuming it was called with 
+# `mpirun -np <n_procs>` )
+yt.enable_parallelism()
 
-# Get a time series for all data made by the simulation.
-sim.get_time_series()
+# By using wildcards such as ? and * with the load command, we can load up a 
+# Time Series containing all of these datasets simultaneously.
+ts = yt.load('enzo_tiny_cosmology/DD????/DD????')
 
-# Calculate and store extrema for all datasets along with redshift
+# Calculate and store density extrema for all datasets along with redshift
 # in a data dictionary with entries as tuples
 
-# Note that by using sim.piter(), we are automatically 
-# forcing yt to do this in parallel
+# Create an empty dictionary
 data = {}
-for ds in sim.piter():
+
+# Iterate through each dataset in the Time Series (using piter allows it 
+# to happen in parallel automatically across available processors)
+for ds in ts.piter():
     ad = ds.all_data()
     extrema = ad.quantities.extrema('density')
+
+    # Fill the dictionary with extrema and redshift information for each dataset
     data[ds.basename] = (extrema, ds.current_redshift)
 
 # Convert dictionary to ordered dictionary to get the right order
@@ -25,5 +31,6 @@
 # Print out all the values we calculated.
 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])
+for key, val in od.iteritems(): 
+    print "%s       %05.3f          %5.3g g/cm^3   %5.3g g/cm^3" % \
+           (key, val[1], val[0][0], val[0][1])

diff -r fda46944799edac4d594ed73c1df39fe72c5284b -r 3329ccb051c3e7374c5cd9dd0bc3869c11f63d08 doc/source/cookbook/time_series.py
--- a/doc/source/cookbook/time_series.py
+++ b/doc/source/cookbook/time_series.py
@@ -1,37 +1,40 @@
 import yt
-import glob
 import matplotlib.pyplot as plt
+import numpy as np
 
-# Glob for a list of filenames, then sort them
-fns = glob.glob("GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*")
-fns.sort()
+# Enable parallelism in the script (assuming it was called with
+# `mpirun -np <n_procs>` )
+yt.enable_parallelism()
 
-# Construct the time series object
-ts = yt.DatasetSeries.from_filenames(fns)
+# By using wildcards such as ? and * with the load command, we can load up a
+# Time Series containing all of these datasets simultaneously.
+ts = yt.load('GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*')
 
 storage = {}
 
-# We use the piter() method here so that this can be run in parallel.
-# Alternately, you could just iterate "for ds in ts:" and directly append to
-# times and entrs.
-for sto, ds in ts.piter(storage=storage):
+# By using the piter() function, we can iterate on every dataset in 
+# the TimeSeries object.  By using the storage keyword, we can populate
+# a dictionary where the dataset is the key, and sto.result is the value
+# for later use when the loop is complete.
+
+# The serial equivalent of piter() here is just "for ds in ts:" .
+
+for store, ds in ts.piter(storage=storage):
+
+    # Create a sphere of radius 100 kpc at the center of the dataset volume
     sphere = ds.sphere("c", (100., "kpc"))
+    # Calculate the entropy within that sphere
     entr = sphere["entropy"].sum()
-    sto.result = (ds.current_time.in_units('Gyr'), entr)
+    # Store the current time and sphere entropy for this dataset in our 
+    # storage dictionary as a tuple
+    store.result = (ds.current_time.in_units('Gyr'), entr)
 
+# Convert the storage dictionary values to a Nx2 array, so the can be easily
+# plotted
+arr = np.array(storage.values())
 
-# Store these values in a couple of lists
-times = []
-entrs = []
-for k in storage:
-    t, e = storage[k]
-    times.append(t)
-    entrs.append(e)
-
-
-# Plot up the results
-
-plt.semilogy(times, entrs, '-')
+# Plot up the results: time versus entropy
+plt.semilogy(arr[:,0], arr[:,1], 'r-')
 plt.xlabel("Time (Gyr)")
 plt.ylabel("Entropy (ergs/K)")
 plt.savefig("time_versus_entropy.png")


https://bitbucket.org/yt_analysis/yt/commits/55de85b423fe/
Changeset:   55de85b423fe
Branch:      yt-3.0
User:        chummels
Date:        2014-07-20 06:28:16
Summary:     Updating derived_field recipe.
Affected #:  1 file

diff -r 3329ccb051c3e7374c5cd9dd0bc3869c11f63d08 -r 55de85b423fe9940c2607024c1b3f266da0ab044 doc/source/cookbook/derived_field.py
--- a/doc/source/cookbook/derived_field.py
+++ b/doc/source/cookbook/derived_field.py
@@ -5,19 +5,19 @@
 
 # You can create a derived field by manipulating any existing derived fields
 # in any way you choose.  In this case, let's just make a simple one:
-# number_density = density / mass
+# thermal_energy_density = 3/2 nkT
 
 # First create a function which yields your new derived field
-def number_density(field, data):
-    return data['gas', 'density']/data['gas', 'mass']
+def thermal_energy_dens(field, data):
+    return (3/2)*data['gas', 'number_density'] * data['gas', 'kT']
 
 # Then add it to your dataset and define the units
-ds.add_field(("gas", "number_density"), units="cm**-3", function=number_density)
+ds.add_field(("gas", "thermal_energy_density"), units="erg/cm**3", function=thermal_energy_dens)
 
 # It will now show up in your derived_field_list
 for i in sorted(ds.derived_field_list): 
     print i
 
-# Let's use it to make a projection of the entire volume!
+# Let's use it to make a projection
 ad = ds.all_data()
-yt.ProjectionPlot(ds, "x", "number_density").save()
+yt.ProjectionPlot(ds, "x", "thermal_energy_density", weight_field="density", width=(200, 'kpc')).save()


https://bitbucket.org/yt_analysis/yt/commits/d910d9b51727/
Changeset:   d910d9b51727
Branch:      yt-3.0
User:        chummels
Date:        2014-07-20 06:34:09
Summary:     Updating doc comment to reflect truth.
Affected #:  1 file

diff -r 55de85b423fe9940c2607024c1b3f266da0ab044 -r d910d9b5172757600a7a8c107a9ee95adf7dd44e doc/source/cookbook/calculating_information.rst
--- a/doc/source/cookbook/calculating_information.rst
+++ b/doc/source/cookbook/calculating_information.rst
@@ -61,8 +61,8 @@
 Simple Derived Fields
 ~~~~~~~~~~~~~~~~~~~~~
 
-This recipe demonstrates how to create a simple derived field, number_density,
- and then generate a projection from it.
+This recipe demonstrates how to create a simple derived field, 
+thermal_energy_density, and then generate a projection from it.
 
 .. yt_cookbook:: derived_field.py
 


https://bitbucket.org/yt_analysis/yt/commits/43ba03d90988/
Changeset:   43ba03d90988
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-07-20 16:18:10
Summary:     Merged in chummels/yt/yt-3.0 (pull request #1029)

A few cookbook updates
Affected #:  5 files

diff -r 4e16b4a309f6a7ec765af203f815ec10f7604bb9 -r 43ba03d9098851c7018b796410a73ae60e376d3d doc/source/analyzing/units/data_selection_and_fields.rst
--- a/doc/source/analyzing/units/data_selection_and_fields.rst
+++ b/doc/source/analyzing/units/data_selection_and_fields.rst
@@ -11,31 +11,28 @@
 .. This needs to be added outside the notebook since user-defined derived fields
    require a 'fresh' kernel.
 
-.. warning:: Note: derived field definitions need to happen *before* a dataset
-             is loaded.  This means changes to the following cells will only be
-             picked up on a fresh kernel.  Select Kernel -> Restart on the
-             IPython menu bar to restart the kernel.
-
-New derived fields can be added just like in old vesions of yt.  The most
-straightforward way to do this is to apply the `derived_field` decorator on a
-function that defines a field.
-
 The following example creates a derived field for the square root of the cell
 volume.
 
 .. notebook-cell::
 
-   from yt.mods import *
+   import yt
    import numpy as np
 
-   @derived_field(name='root_cell_volume', units='cm**(3/2)')
+   # Function defining the derived field
    def root_cell_volume(field, data):
-     return np.sqrt(data['cell_volume'])
+      return np.sqrt(data['cell_volume'])
 
-   ds = load('HiresIsolatedGalaxy/DD0044/DD0044')
+   # Load the dataset
+   ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
 
-   dd = ds.all_data()
-   dd['root_cell_volume']
+   # Add the field to the dataset, linking to the derived field function and 
+   # units of the field
+   ds.add_field(("gas", "root_cell_volume"), units="cm**(3/2)", function=root_cell_volume)
+
+   # Access the derived field like any other field
+   ad = ds.all_data()
+   ad['root_cell_volume']
 
 No special unit logic needs to happen inside of the function - `np.sqrt` will
 convert the units of the `density` field appropriately:
@@ -43,17 +40,17 @@
 .. notebook-cell::
    :skip_exceptions:
 
-   from yt.mods import *
+   import yt
    import numpy as np
 
-   ds = load('HiresIsolatedGalaxy/DD0044/DD0044')
-   dd = ds.all_data()
+   ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
+   ad = ds.all_data()
 
-   print dd['cell_volume'].in_cgs()
-   print np.sqrt(dd['cell_volume'].in_cgs())
+   print ad['cell_volume'].in_cgs()
+   print np.sqrt(ad['cell_volume'].in_cgs())
 
 That said, it is necessary to specify the units in the call to the
-:code:`@derived_field` decorator.  Not only does this ensure the returned units
+:code:`add_field` function.  Not only does this ensure the returned units
 will be exactly what you expect, it also allows an in-place conversion of units,
 just in case the function returns a field with dimensionally equivalent units.
 
@@ -62,13 +59,16 @@
 
 .. notebook-cell::
 
-   from yt.mods import *
+   import yt
+   import numpy as np
 
-   @derived_field(name='root_cell_volume', units='Mpc**(3/2)')
    def root_cell_volume(field, data):
-     return np.sqrt(data['cell_volume'])
+      return np.sqrt(data['cell_volume'])
 
-   ds = load('HiresIsolatedGalaxy/DD0044/DD0044')
+   ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
 
-   dd = ds.all_data()
-   dd['root_cell_volume']
+   # Here we set the default units to Mpc^(3/2)
+   ds.add_field(("gas", "root_cell_volume"), units="Mpc**(3/2)", function=root_cell_volume)
+
+   ad = ds.all_data()
+   ad['root_cell_volume']

diff -r 4e16b4a309f6a7ec765af203f815ec10f7604bb9 -r 43ba03d9098851c7018b796410a73ae60e376d3d doc/source/cookbook/calculating_information.rst
--- a/doc/source/cookbook/calculating_information.rst
+++ b/doc/source/cookbook/calculating_information.rst
@@ -58,6 +58,14 @@
 
 .. yt_cookbook:: time_series.py
 
+Simple Derived Fields
+~~~~~~~~~~~~~~~~~~~~~
+
+This recipe demonstrates how to create a simple derived field, 
+thermal_energy_density, and then generate a projection from it.
+
+.. yt_cookbook:: derived_field.py
+
 Complex Derived Fields
 ~~~~~~~~~~~~~~~~~~~~~~
 

diff -r 4e16b4a309f6a7ec765af203f815ec10f7604bb9 -r 43ba03d9098851c7018b796410a73ae60e376d3d doc/source/cookbook/derived_field.py
--- /dev/null
+++ b/doc/source/cookbook/derived_field.py
@@ -0,0 +1,23 @@
+import yt
+
+# Load the dataset.
+ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# You can create a derived field by manipulating any existing derived fields
+# in any way you choose.  In this case, let's just make a simple one:
+# thermal_energy_density = 3/2 nkT
+
+# First create a function which yields your new derived field
+def thermal_energy_dens(field, data):
+    return (3/2)*data['gas', 'number_density'] * data['gas', 'kT']
+
+# Then add it to your dataset and define the units
+ds.add_field(("gas", "thermal_energy_density"), units="erg/cm**3", function=thermal_energy_dens)
+
+# It will now show up in your derived_field_list
+for i in sorted(ds.derived_field_list): 
+    print i
+
+# Let's use it to make a projection
+ad = ds.all_data()
+yt.ProjectionPlot(ds, "x", "thermal_energy_density", weight_field="density", width=(200, 'kpc')).save()

diff -r 4e16b4a309f6a7ec765af203f815ec10f7604bb9 -r 43ba03d9098851c7018b796410a73ae60e376d3d doc/source/cookbook/simulation_analysis.py
--- a/doc/source/cookbook/simulation_analysis.py
+++ b/doc/source/cookbook/simulation_analysis.py
@@ -2,21 +2,27 @@
 yt.enable_parallelism()
 import collections
 
-# Instantiate a time series object for an Enzo simulation..
-sim = yt.simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo')
+# Enable parallelism in the script (assuming it was called with 
+# `mpirun -np <n_procs>` )
+yt.enable_parallelism()
 
-# Get a time series for all data made by the simulation.
-sim.get_time_series()
+# By using wildcards such as ? and * with the load command, we can load up a 
+# Time Series containing all of these datasets simultaneously.
+ts = yt.load('enzo_tiny_cosmology/DD????/DD????')
 
-# Calculate and store extrema for all datasets along with redshift
+# Calculate and store density extrema for all datasets along with redshift
 # in a data dictionary with entries as tuples
 
-# Note that by using sim.piter(), we are automatically 
-# forcing yt to do this in parallel
+# Create an empty dictionary
 data = {}
-for ds in sim.piter():
+
+# Iterate through each dataset in the Time Series (using piter allows it 
+# to happen in parallel automatically across available processors)
+for ds in ts.piter():
     ad = ds.all_data()
     extrema = ad.quantities.extrema('density')
+
+    # Fill the dictionary with extrema and redshift information for each dataset
     data[ds.basename] = (extrema, ds.current_redshift)
 
 # Convert dictionary to ordered dictionary to get the right order
@@ -25,5 +31,6 @@
 # Print out all the values we calculated.
 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])
+for key, val in od.iteritems(): 
+    print "%s       %05.3f          %5.3g g/cm^3   %5.3g g/cm^3" % \
+           (key, val[1], val[0][0], val[0][1])

diff -r 4e16b4a309f6a7ec765af203f815ec10f7604bb9 -r 43ba03d9098851c7018b796410a73ae60e376d3d doc/source/cookbook/time_series.py
--- a/doc/source/cookbook/time_series.py
+++ b/doc/source/cookbook/time_series.py
@@ -1,37 +1,40 @@
 import yt
-import glob
 import matplotlib.pyplot as plt
+import numpy as np
 
-# Glob for a list of filenames, then sort them
-fns = glob.glob("GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*")
-fns.sort()
+# Enable parallelism in the script (assuming it was called with
+# `mpirun -np <n_procs>` )
+yt.enable_parallelism()
 
-# Construct the time series object
-ts = yt.DatasetSeries.from_filenames(fns)
+# By using wildcards such as ? and * with the load command, we can load up a
+# Time Series containing all of these datasets simultaneously.
+ts = yt.load('GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*')
 
 storage = {}
 
-# We use the piter() method here so that this can be run in parallel.
-# Alternately, you could just iterate "for ds in ts:" and directly append to
-# times and entrs.
-for sto, ds in ts.piter(storage=storage):
+# By using the piter() function, we can iterate on every dataset in 
+# the TimeSeries object.  By using the storage keyword, we can populate
+# a dictionary where the dataset is the key, and sto.result is the value
+# for later use when the loop is complete.
+
+# The serial equivalent of piter() here is just "for ds in ts:" .
+
+for store, ds in ts.piter(storage=storage):
+
+    # Create a sphere of radius 100 kpc at the center of the dataset volume
     sphere = ds.sphere("c", (100., "kpc"))
+    # Calculate the entropy within that sphere
     entr = sphere["entropy"].sum()
-    sto.result = (ds.current_time.in_units('Gyr'), entr)
+    # Store the current time and sphere entropy for this dataset in our 
+    # storage dictionary as a tuple
+    store.result = (ds.current_time.in_units('Gyr'), entr)
 
+# Convert the storage dictionary values to a Nx2 array, so the can be easily
+# plotted
+arr = np.array(storage.values())
 
-# Store these values in a couple of lists
-times = []
-entrs = []
-for k in storage:
-    t, e = storage[k]
-    times.append(t)
-    entrs.append(e)
-
-
-# Plot up the results
-
-plt.semilogy(times, entrs, '-')
+# Plot up the results: time versus entropy
+plt.semilogy(arr[:,0], arr[:,1], 'r-')
 plt.xlabel("Time (Gyr)")
 plt.ylabel("Entropy (ergs/K)")
 plt.savefig("time_versus_entropy.png")

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