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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Oct 22 06:43:32 PDT 2013


14 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/8560cf4e747c/
Changeset:   8560cf4e747c
Branch:      yt
User:        chummels
Date:        2013-08-24 23:13:38
Summary:     Correcting a docstring bug in set_cmap.
Affected #:  1 file

diff -r 1b696a4c09d8fab667a676fc9e0c36542e60219a -r 8560cf4e747cb43243415f5cb43bf5dbd276eca5 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1029,7 +1029,7 @@
         field : string
             the field to set a transform
             if field == 'all', applies to all plots.
-        cmap_name : string
+        cmap : string
             name of the colormap
 
         """


https://bitbucket.org/yt_analysis/yt/commits/764ed836d7b7/
Changeset:   764ed836d7b7
Branch:      yt
User:        chummels
Date:        2013-09-05 23:21:36
Summary:     Adding derived field "shear" to universal_fields.  I believe this will only work with enzo 2d and 3d datasets.
Affected #:  1 file

diff -r 8560cf4e747cb43243415f5cb43bf5dbd276eca5 -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -645,6 +645,72 @@
 add_field("AbsDivV", function=_AbsDivV,
           units=r"\rm{s}^{-1}")
 
+#     Shear prescription taken from Enzo source:
+#           enzo-dev/src/enzo/Grid_FlagCellsToBeRefinedByShear.C
+#
+#       For shear: [(du/dy)^2 + (dv/dx)^2 + (dw/dy)^2 +
+#                   (du/dz)^2 + (dv/dz)^2 + (dw/dx)^2  ] * (dx/c_s)^2
+#       where:  du/dy = [u(j-1) - u(j+1)]/[2dy],
+#       Shear is defined relative to the sound speed (i.e. mach)
+
+def _Shear(field, data):
+    # We need to set up stencils
+    if data.pf["HydroMethod"] == 2: # Zeus -- velocities are face centered
+        sl_left = slice(None,-2,None)
+        sl_right = slice(1,-1,None)
+        div_fac = 1.0
+    else: # PPM -- velocities are cell centered
+        sl_left = slice(None,-2,None)
+        sl_right = slice(2,None,None)
+        div_fac = 2.0
+    # only works for 2d and 3d data:
+    if data.pf.dimensionality > 1:
+        # first the dx direction
+        ds = div_fac * data['dx'].flat[0]
+        fxy  = data["y-velocity"][1:-1,sl_right,1:-1]/ds
+        fxy -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
+        ds = div_fac * data['dy'].flat[0]
+        fyx  = data["x-velocity"][sl_right,1:-1,1:-1]/ds
+        fyx -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
+
+    if data.pf.dimensionality > 2:
+        ds = div_fac * data['dx'].flat[0]
+        fxz  = data["z-velocity"][1:-1,1:-1,sl_right]/ds
+        fxz -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
+        ds = div_fac * data['dy'].flat[0]
+        fyz  = data["z-velocity"][1:-1,1:-1,sl_right]/ds
+        fyz -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
+
+        # lastly the dz direction
+        ds = div_fac * data['dz'].flat[0]
+        fzx  = data["x-velocity"][sl_right,1:-1,1:-1]/ds
+        fzx -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
+        fzy  = data["y-velocity"][1:-1,sl_right,1:-1]/ds
+        fzy -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
+    if data.pf.dimensionality <= 1:
+        print "Shear only valid when dimensionality > 2"
+
+    # and the sound speed (make sure it has the right dimension)
+    c_s = data["SoundSpeed"][1:-1,1:-1,1:-1]
+    # assumes dx = dy = dz; valid for enzo sims
+    dx = data['dx'][1:-1,1:-1,1:-1]
+
+    if data.pf.dimensionality == 2:
+        shear = (fxy**2 + fyx**2) * (dx/c_s)**2
+
+    if data.pf.dimensionality == 3:o
+        shear = (fxy**2 + fxz**2 + fyx**2 + fyz**2 + fzx**2 + fzy**2) * (dx/c_s)**2
+    shear = shear**0.5
+
+    new_field = np.zeros(data["x-velocity"].shape, dtype='float64')
+    new_field[1:-1,1:-1,1:-1] = shear
+    return new_field
+
+add_field("Shear", function=_Shear,
+          validators=[ValidateSpatial(ghost_zones=1,
+          fields=["x-velocity","y-velocity","z-velocity","SoundSpeed"])],
+          units=r"\rm{Mach}", take_log=False)
+
 def _Contours(field, data):
     return -np.ones_like(data["Ones"])
 add_field("Contours", validators=[ValidateSpatial(0)], take_log=False,


https://bitbucket.org/yt_analysis/yt/commits/ad7dc492a0bf/
Changeset:   ad7dc492a0bf
Branch:      yt
User:        chummels
Date:        2013-09-05 23:22:44
Summary:     Merging.
Affected #:  19 files

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a doc/install_script.sh
--- a/doc/install_script.sh
+++ b/doc/install_script.sh
@@ -419,7 +419,7 @@
 echo "be installing ZeroMQ"
 
 printf "%-15s = %s so I " "INST_ROCKSTAR" "${INST_ROCKSTAR}"
-get_willwont ${INST_0MQ}
+get_willwont ${INST_ROCKSTAR}
 echo "be installing Rockstar"
 
 echo
@@ -877,6 +877,11 @@
 mkdir -p ${DEST_DIR}/src/$MATPLOTLIB
 echo "[directories]" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg
 echo "basedirlist = ${DEST_DIR}" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg
+if [ `uname` = "Darwin" ]
+then
+   echo "[gui_support]" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg
+   echo "macosx = False" >> ${DEST_DIR}/src/$MATPLOTLIB/setup.cfg
+fi
 do_setup_py $MATPLOTLIB
 if [ -n "${OLD_LDFLAGS}" ]
 then

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/data_objects/tests/test_cutting_plane.py
--- a/yt/data_objects/tests/test_cutting_plane.py
+++ b/yt/data_objects/tests/test_cutting_plane.py
@@ -1,5 +1,6 @@
 from yt.testing import *
 import os
+import tempfile
 
 def setup():
     from yt.config import ytcfg
@@ -7,7 +8,10 @@
 
 def teardown_func(fns):
     for fn in fns:
-        os.remove(fn)
+        try:
+            os.remove(fn)
+        except OSError:
+            pass
 
 def test_cutting_plane():
     for nprocs in [8, 1]:
@@ -23,7 +27,9 @@
         yield assert_equal, cut["Ones"].min(), 1.0
         yield assert_equal, cut["Ones"].max(), 1.0
         pw = cut.to_pw()
-        fns += pw.save()
+        tmpfd, tmpname = tempfile.mkstemp(suffix='.png')
+        os.close(tmpfd)
+        fns += pw.save(name=tmpname)
         frb = cut.to_frb((1.0,'unitary'), 64)
         for cut_field in ['Ones', 'Density']:
             yield assert_equal, frb[cut_field].info['data_source'], \

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/data_objects/tests/test_image_array.py
--- a/yt/data_objects/tests/test_image_array.py
+++ b/yt/data_objects/tests/test_image_array.py
@@ -1,130 +1,94 @@
-from yt.testing import *
-from yt.data_objects.image_array import ImageArray
 import numpy as np
 import os
 import tempfile
 import shutil
+import unittest
+from yt.data_objects.image_array import ImageArray
+from yt.testing import \
+    assert_equal
+
 
 def setup():
     from yt.config import ytcfg
-    ytcfg["yt","__withintesting"] = "True"
-    np.seterr(all = 'ignore')
+    ytcfg["yt", "__withintesting"] = "True"
+    np.seterr(all='ignore')
+
+
+def dummy_image(kstep, nlayers):
+    im = np.zeros([64, 128, nlayers])
+    for i in xrange(im.shape[0]):
+        for k in xrange(im.shape[2]):
+            im[i, :, k] = np.linspace(0.0, kstep * k, im.shape[1])
+    return im
+
 
 def test_rgba_rescale():
-    im = np.zeros([64,128,4])
-    for i in xrange(im.shape[0]):
-        for k in xrange(im.shape[2]):
-            im[i,:,k] = np.linspace(0.,10.*k, im.shape[1])
-    im_arr = ImageArray(im)
+    im_arr = ImageArray(dummy_image(10.0, 4))
 
     new_im = im_arr.rescale(inline=False)
-    yield assert_equal, im_arr[:,:,:3].max(), 2*10.
-    yield assert_equal, im_arr[:,:,3].max(), 3*10.
-    yield assert_equal, new_im[:,:,:3].sum(axis=2).max(), 1.0 
-    yield assert_equal, new_im[:,:,3].max(), 1.0
+    yield assert_equal, im_arr[:, :, :3].max(), 2 * 10.
+    yield assert_equal, im_arr[:, :, 3].max(), 3 * 10.
+    yield assert_equal, new_im[:, :, :3].sum(axis=2).max(), 1.0
+    yield assert_equal, new_im[:, :, 3].max(), 1.0
 
     im_arr.rescale()
-    yield assert_equal, im_arr[:,:,:3].sum(axis=2).max(), 1.0
-    yield assert_equal, im_arr[:,:,3].max(), 1.0
+    yield assert_equal, im_arr[:, :, :3].sum(axis=2).max(), 1.0
+    yield assert_equal, im_arr[:, :, 3].max(), 1.0
 
-def test_image_array_hdf5():
-    # Perform I/O in safe place instead of yt main dir
-    tmpdir = tempfile.mkdtemp()
-    curdir = os.getcwd()
-    os.chdir(tmpdir)
 
-    im = np.zeros([64,128,3])
-    for i in xrange(im.shape[0]):
-        for k in xrange(im.shape[2]):
-            im[i,:,k] = np.linspace(0.,0.3*k, im.shape[1])
+class TestImageArray(unittest.TestCase):
 
-    myinfo = {'field':'dinosaurs', 'east_vector':np.array([1.,0.,0.]), 
-        'north_vector':np.array([0.,0.,1.]), 'normal_vector':np.array([0.,1.,0.]),  
-        'width':0.245, 'units':'cm', 'type':'rendering'}
+    tmpdir = None
+    curdir = None
 
-    im_arr = ImageArray(im, info=myinfo)
-    im_arr.save('test_3d_ImageArray')
+    def setUp(self):
+        self.tmpdir = tempfile.mkdtemp()
+        self.curdir = os.getcwd()
+        os.chdir(self.tmpdir)
 
-    im = np.zeros([64,128])
-    for i in xrange(im.shape[0]):
-        im[i,:] = np.linspace(0.,0.3*k, im.shape[1])
+    def test_image_array_hdf5(self):
+        myinfo = {'field': 'dinosaurs', 'east_vector': np.array([1., 0., 0.]),
+                  'north_vector': np.array([0., 0., 1.]),
+                  'normal_vector': np.array([0., 1., 0.]),
+                  'width': 0.245, 'units': 'cm', 'type': 'rendering'}
 
-    myinfo = {'field':'dinosaurs', 'east_vector':np.array([1.,0.,0.]), 
-        'north_vector':np.array([0.,0.,1.]), 'normal_vector':np.array([0.,1.,0.]),  
-        'width':0.245, 'units':'cm', 'type':'rendering'}
+        im_arr = ImageArray(dummy_image(0.3, 3), info=myinfo)
+        im_arr.save('test_3d_ImageArray')
 
-    im_arr = ImageArray(im, info=myinfo)
-    im_arr.save('test_2d_ImageArray')
+        im = np.zeros([64, 128])
+        for i in xrange(im.shape[0]):
+            im[i, :] = np.linspace(0., 0.3 * 2, im.shape[1])
 
-    os.chdir(curdir)
-    # clean up
-    shutil.rmtree(tmpdir)
+        myinfo = {'field': 'dinosaurs', 'east_vector': np.array([1., 0., 0.]),
+                  'north_vector': np.array([0., 0., 1.]),
+                  'normal_vector': np.array([0., 1., 0.]),
+                  'width': 0.245, 'units': 'cm', 'type': 'rendering'}
 
-def test_image_array_rgb_png():
-    # Perform I/O in safe place instead of yt main dir
-    tmpdir = tempfile.mkdtemp()
-    curdir = os.getcwd()
-    os.chdir(tmpdir)
+        im_arr = ImageArray(im, info=myinfo)
+        im_arr.save('test_2d_ImageArray')
 
-    im = np.zeros([64,128,3])
-    for i in xrange(im.shape[0]):
-        for k in xrange(im.shape[2]):
-            im[i,:,k] = np.linspace(0.,10.*k, im.shape[1])
+    def test_image_array_rgb_png(self):
+        im_arr = ImageArray(dummy_image(10.0, 3))
+        im_arr.write_png('standard.png')
 
-    im_arr = ImageArray(im)
-    im_arr.write_png('standard.png')
+    def test_image_array_rgba_png(self):
+        im_arr = ImageArray(dummy_image(10.0, 4))
+        im_arr.write_png('standard.png')
+        im_arr.write_png('non-scaled.png', rescale=False)
+        im_arr.write_png('black_bg.png', background='black')
+        im_arr.write_png('white_bg.png', background='white')
+        im_arr.write_png('green_bg.png', background=[0., 1., 0., 1.])
+        im_arr.write_png('transparent_bg.png', background=None)
 
-def test_image_array_rgba_png():
-    # Perform I/O in safe place instead of yt main dir
-    tmpdir = tempfile.mkdtemp()
-    curdir = os.getcwd()
-    os.chdir(tmpdir)
+    def test_image_array_background(self):
+        im_arr = ImageArray(dummy_image(10.0, 4))
+        im_arr.rescale()
+        new_im = im_arr.add_background_color([1., 0., 0., 1.], inline=False)
+        new_im.write_png('red_bg.png')
+        im_arr.add_background_color('black')
+        im_arr.write_png('black_bg2.png')
 
-    im = np.zeros([64,128,4])
-    for i in xrange(im.shape[0]):
-        for k in xrange(im.shape[2]):
-            im[i,:,k] = np.linspace(0.,10.*k, im.shape[1])
-
-    im_arr = ImageArray(im)
-    im_arr.write_png('standard.png')
-    im_arr.write_png('non-scaled.png', rescale=False)
-    im_arr.write_png('black_bg.png', background='black')
-    im_arr.write_png('white_bg.png', background='white')
-    im_arr.write_png('green_bg.png', background=[0.,1.,0.,1.])
-    im_arr.write_png('transparent_bg.png', background=None)
-
-
-def test_image_array_background():
-    # Perform I/O in safe place instead of yt main dir
-    tmpdir = tempfile.mkdtemp()
-    curdir = os.getcwd()
-    os.chdir(tmpdir)
-
-    im = np.zeros([64,128,4])
-    for i in xrange(im.shape[0]):
-        for k in xrange(im.shape[2]):
-            im[i,:,k] = np.linspace(0.,10.*k, im.shape[1])
-
-    im_arr = ImageArray(im)
-    im_arr.rescale()
-    new_im = im_arr.add_background_color([1.,0.,0.,1.], inline=False)
-    new_im.write_png('red_bg.png')
-    im_arr.add_background_color('black')
-    im_arr.write_png('black_bg2.png')
- 
-    os.chdir(curdir)
-    # clean up
-    shutil.rmtree(tmpdir)
-
-
-
-
-
-
-
-
-
-
-
-
-
+    def tearDown(self):
+        os.chdir(self.curdir)
+        # clean up
+        shutil.rmtree(self.tmpdir)

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/data_objects/tests/test_projection.py
--- a/yt/data_objects/tests/test_projection.py
+++ b/yt/data_objects/tests/test_projection.py
@@ -1,5 +1,6 @@
 from yt.testing import *
 import os
+import tempfile
 
 def setup():
     from yt.config import ytcfg
@@ -7,7 +8,10 @@
 
 def teardown_func(fns):
     for fn in fns:
-        os.remove(fn)
+        try:
+            os.remove(fn)
+        except OSError:
+            pass
 
 def test_projection():
     for nprocs in [8, 1]:
@@ -37,7 +41,9 @@
                 yield assert_equal, np.unique(proj["pdx"]), 1.0/(dims[xax]*2.0)
                 yield assert_equal, np.unique(proj["pdy"]), 1.0/(dims[yax]*2.0)
                 pw = proj.to_pw()
-                fns += pw.save()
+                tmpfd, tmpname = tempfile.mkstemp(suffix='.png')
+                os.close(tmpfd)
+                fns += pw.save(name=tmpname)
                 frb = proj.to_frb((1.0,'unitary'), 64)
                 for proj_field in ['Ones', 'Density']:
                     yield assert_equal, frb[proj_field].info['data_source'], \

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/data_objects/tests/test_slice.py
--- a/yt/data_objects/tests/test_slice.py
+++ b/yt/data_objects/tests/test_slice.py
@@ -27,6 +27,7 @@
 """
 import os
 import numpy as np
+import tempfile
 from nose.tools import raises
 from yt.testing import \
     fake_random_pf, assert_equal, assert_array_equal
@@ -42,7 +43,10 @@
 
 def teardown_func(fns):
     for fn in fns:
-        os.remove(fn)
+        try:
+            os.remove(fn)
+        except OSError:
+            pass
 
 
 def test_slice():
@@ -72,7 +76,9 @@
                 yield assert_equal, np.unique(slc["pdx"]), 0.5 / dims[xax]
                 yield assert_equal, np.unique(slc["pdy"]), 0.5 / dims[yax]
                 pw = slc.to_pw()
-                fns += pw.save()
+                tmpfd, tmpname = tempfile.mkstemp(suffix='.png')
+                os.close(tmpfd)
+                fns += pw.save(name=tmpname)
                 frb = slc.to_frb((1.0, 'unitary'), 64)
                 for slc_field in ['Ones', 'Density']:
                     yield assert_equal, frb[slc_field].info['data_source'], \

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/extern/__init__.py
--- /dev/null
+++ b/yt/extern/__init__.py
@@ -0,0 +1,4 @@
+"""
+This packages contains python packages that are bundled with yt
+and are developed by 3rd party upstream.
+"""

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/extern/parameterized.py
--- /dev/null
+++ b/yt/extern/parameterized.py
@@ -0,0 +1,226 @@
+import re
+import inspect
+from functools import wraps
+from collections import namedtuple
+
+from nose.tools import nottest
+from unittest import TestCase
+
+from . import six
+
+if six.PY3:
+    def new_instancemethod(f, *args):
+        return f
+else:
+    import new
+    new_instancemethod = new.instancemethod
+
+_param = namedtuple("param", "args kwargs")
+
+class param(_param):
+    """ Represents a single parameter to a test case.
+
+        For example::
+
+            >>> p = param("foo", bar=16)
+            >>> p
+            param("foo", bar=16)
+            >>> p.args
+            ('foo', )
+            >>> p.kwargs
+            {'bar': 16}
+
+        Intended to be used as an argument to ``@parameterized``::
+
+            @parameterized([
+                param("foo", bar=16),
+            ])
+            def test_stuff(foo, bar=16):
+                pass
+        """
+
+    def __new__(cls, *args , **kwargs):
+        return _param.__new__(cls, args, kwargs)
+
+    @classmethod
+    def explicit(cls, args=None, kwargs=None):
+        """ Creates a ``param`` by explicitly specifying ``args`` and
+            ``kwargs``::
+
+                >>> param.explicit([1,2,3])
+                param(*(1, 2, 3))
+                >>> param.explicit(kwargs={"foo": 42})
+                param(*(), **{"foo": "42"})
+            """
+        args = args or ()
+        kwargs = kwargs or {}
+        return cls(*args, **kwargs)
+
+    @classmethod
+    def from_decorator(cls, args):
+        """ Returns an instance of ``param()`` for ``@parameterized`` argument
+            ``args``::
+
+                >>> param.from_decorator((42, ))
+                param(args=(42, ), kwargs={})
+                >>> param.from_decorator("foo")
+                param(args=("foo", ), kwargs={})
+            """
+        if isinstance(args, param):
+            return args
+        if isinstance(args, six.string_types):
+            args = (args, )
+        return cls(*args)
+
+    def __repr__(self):
+        return "param(*%r, **%r)" %self
+
+class parameterized(object):
+    """ Parameterize a test case::
+
+            class TestInt(object):
+                @parameterized([
+                    ("A", 10),
+                    ("F", 15),
+                    param("10", 42, base=42)
+                ])
+                def test_int(self, input, expected, base=16):
+                    actual = int(input, base=base)
+                    assert_equal(actual, expected)
+
+            @parameterized([
+                (2, 3, 5)
+                (3, 5, 8),
+            ])
+            def test_add(a, b, expected):
+                assert_equal(a + b, expected)
+        """
+
+    def __init__(self, input):
+        self.get_input = self.input_as_callable(input)
+
+    def __call__(self, test_func):
+        self.assert_not_in_testcase_subclass()
+
+        @wraps(test_func)
+        def parameterized_helper_method(test_self=None):
+            f = test_func
+            if test_self is not None:
+                # If we are a test method (which we suppose to be true if we
+                # are being passed a "self" argument), we first need to create
+                # an instance method, attach it to the instance of the test
+                # class, then pull it back off to turn it into a bound method.
+                # If we don't do this, Nose gets cranky.
+                f = self.make_bound_method(test_self, test_func)
+            # Note: because nose is so very picky, the more obvious
+            # ``return self.yield_nose_tuples(f)`` won't work here.
+            for nose_tuple in self.yield_nose_tuples(f):
+                yield nose_tuple
+
+        test_func.__name__ = "_helper_for_%s" %(test_func.__name__, )
+        parameterized_helper_method.parameterized_input = input
+        parameterized_helper_method.parameterized_func = test_func
+        return parameterized_helper_method
+
+    def yield_nose_tuples(self, func):
+        for args in self.get_input():
+            p = param.from_decorator(args)
+            # ... then yield that as a tuple. If those steps aren't
+            # followed precicely, Nose gets upset and doesn't run the test
+            # or doesn't run setup methods.
+            yield self.param_as_nose_tuple(p, func)
+
+    def param_as_nose_tuple(self, p, func):
+        nose_func = func
+        nose_args = p.args
+        if p.kwargs:
+            nose_func = wraps(func)(lambda args, kwargs: func(*args, **kwargs))
+            nose_args = (p.args, p.kwargs)
+        return (nose_func, ) + nose_args
+
+    def make_bound_method(self, instance, func):
+        cls = type(instance)
+        im_f = new_instancemethod(func, None, cls)
+        setattr(cls, func.__name__, im_f)
+        return getattr(instance, func.__name__)
+
+    def assert_not_in_testcase_subclass(self):
+        parent_classes = self._terrible_magic_get_defining_classes()
+        if any(issubclass(cls, TestCase) for cls in parent_classes):
+            raise Exception("Warning: '@parameterized' tests won't work "
+                            "inside subclasses of 'TestCase' - use "
+                            "'@parameterized.expand' instead")
+
+    def _terrible_magic_get_defining_classes(self):
+        """ Returns the set of parent classes of the class currently being defined.
+            Will likely only work if called from the ``parameterized`` decorator.
+            This function is entirely @brandon_rhodes's fault, as he suggested
+            the implementation: http://stackoverflow.com/a/8793684/71522
+            """
+        stack = inspect.stack()
+        if len(stack) <= 4:
+            return []
+        frame = stack[4]
+        code_context = frame[4] and frame[4][0].strip()
+        if not (code_context and code_context.startswith("class ")):
+            return []
+        _, parents = code_context.split("(", 1)
+        parents, _ = parents.rsplit(")", 1)
+        return eval("[" + parents + "]", frame[0].f_globals, frame[0].f_locals)
+
+    @classmethod
+    def input_as_callable(cls, input):
+        if callable(input):
+            return lambda: cls.check_input_values(input())
+        input_values = cls.check_input_values(input)
+        return lambda: input_values
+
+    @classmethod
+    def check_input_values(cls, input_values):
+        if not hasattr(input_values, "__iter__"):
+            raise ValueError("expected iterable input; got %r" %(input, ))
+        return input_values
+
+    @classmethod
+    def expand(cls, input):
+        """ A "brute force" method of parameterizing test cases. Creates new
+            test cases and injects them into the namespace that the wrapped
+            function is being defined in. Useful for parameterizing tests in
+            subclasses of 'UnitTest', where Nose test generators don't work.
+
+            >>> @parameterized.expand([("foo", 1, 2)])
+            ... def test_add1(name, input, expected):
+            ...     actual = add1(input)
+            ...     assert_equal(actual, expected)
+            ...
+            >>> locals()
+            ... 'test_add1_foo_0': <function ...> ...
+            >>>
+            """
+
+        def parameterized_expand_wrapper(f):
+            stack = inspect.stack()
+            frame = stack[1]
+            frame_locals = frame[0].f_locals
+
+            base_name = f.__name__
+            get_input = cls.input_as_callable(input)
+            for num, args in enumerate(get_input()):
+                p = param.from_decorator(args)
+                name_suffix = "_%s" %(num, )
+                if len(p.args) > 0 and isinstance(p.args[0], six.string_types):
+                    name_suffix += "_" + cls.to_safe_name(p.args[0])
+                name = base_name + name_suffix
+                frame_locals[name] = cls.param_as_standalone_func(p, f, name)
+            return nottest(f)
+        return parameterized_expand_wrapper
+
+    @classmethod
+    def param_as_standalone_func(cls, p, func, name):
+        standalone_func = lambda *a: func(*(a + p.args), **p.kwargs)
+        standalone_func.__name__ = name
+        return standalone_func
+
+    @classmethod
+    def to_safe_name(cls, s):
+        return str(re.sub("[^a-zA-Z0-9_]", "", s))

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/extern/six.py
--- /dev/null
+++ b/yt/extern/six.py
@@ -0,0 +1,404 @@
+"""Utilities for writing code that runs on Python 2 and 3"""
+
+# Copyright (c) 2010-2013 Benjamin Peterson
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of
+# this software and associated documentation files (the "Software"), to deal in
+# the Software without restriction, including without limitation the rights to
+# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+# the Software, and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import operator
+import sys
+import types
+
+__author__ = "Benjamin Peterson <benjamin at python.org>"
+__version__ = "1.3.0"
+
+
+# True if we are running on Python 3.
+PY3 = sys.version_info[0] == 3
+
+if PY3:
+    string_types = str,
+    integer_types = int,
+    class_types = type,
+    text_type = str
+    binary_type = bytes
+
+    MAXSIZE = sys.maxsize
+else:
+    string_types = basestring,
+    integer_types = (int, long)
+    class_types = (type, types.ClassType)
+    text_type = unicode
+    binary_type = str
+
+    if sys.platform.startswith("java"):
+        # Jython always uses 32 bits.
+        MAXSIZE = int((1 << 31) - 1)
+    else:
+        # It's possible to have sizeof(long) != sizeof(Py_ssize_t).
+        class X(object):
+            def __len__(self):
+                return 1 << 31
+        try:
+            len(X())
+        except OverflowError:
+            # 32-bit
+            MAXSIZE = int((1 << 31) - 1)
+        else:
+            # 64-bit
+            MAXSIZE = int((1 << 63) - 1)
+            del X
+
+
+def _add_doc(func, doc):
+    """Add documentation to a function."""
+    func.__doc__ = doc
+
+
+def _import_module(name):
+    """Import module, returning the module after the last dot."""
+    __import__(name)
+    return sys.modules[name]
+
+
+class _LazyDescr(object):
+
+    def __init__(self, name):
+        self.name = name
+
+    def __get__(self, obj, tp):
+        result = self._resolve()
+        setattr(obj, self.name, result)
+        # This is a bit ugly, but it avoids running this again.
+        delattr(tp, self.name)
+        return result
+
+
+class MovedModule(_LazyDescr):
+
+    def __init__(self, name, old, new=None):
+        super(MovedModule, self).__init__(name)
+        if PY3:
+            if new is None:
+                new = name
+            self.mod = new
+        else:
+            self.mod = old
+
+    def _resolve(self):
+        return _import_module(self.mod)
+
+
+class MovedAttribute(_LazyDescr):
+
+    def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
+        super(MovedAttribute, self).__init__(name)
+        if PY3:
+            if new_mod is None:
+                new_mod = name
+            self.mod = new_mod
+            if new_attr is None:
+                if old_attr is None:
+                    new_attr = name
+                else:
+                    new_attr = old_attr
+            self.attr = new_attr
+        else:
+            self.mod = old_mod
+            if old_attr is None:
+                old_attr = name
+            self.attr = old_attr
+
+    def _resolve(self):
+        module = _import_module(self.mod)
+        return getattr(module, self.attr)
+
+
+
+class _MovedItems(types.ModuleType):
+    """Lazy loading of moved objects"""
+
+
+_moved_attributes = [
+    MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"),
+    MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"),
+    MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"),
+    MovedAttribute("map", "itertools", "builtins", "imap", "map"),
+    MovedAttribute("reload_module", "__builtin__", "imp", "reload"),
+    MovedAttribute("reduce", "__builtin__", "functools"),
+    MovedAttribute("StringIO", "StringIO", "io"),
+    MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"),
+    MovedAttribute("zip", "itertools", "builtins", "izip", "zip"),
+
+    MovedModule("builtins", "__builtin__"),
+    MovedModule("configparser", "ConfigParser"),
+    MovedModule("copyreg", "copy_reg"),
+    MovedModule("http_cookiejar", "cookielib", "http.cookiejar"),
+    MovedModule("http_cookies", "Cookie", "http.cookies"),
+    MovedModule("html_entities", "htmlentitydefs", "html.entities"),
+    MovedModule("html_parser", "HTMLParser", "html.parser"),
+    MovedModule("http_client", "httplib", "http.client"),
+    MovedModule("email_mime_multipart", "email.MIMEMultipart", "email.mime.multipart"),
+    MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"),
+    MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"),
+    MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"),
+    MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"),
+    MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"),
+    MovedModule("cPickle", "cPickle", "pickle"),
+    MovedModule("queue", "Queue"),
+    MovedModule("reprlib", "repr"),
+    MovedModule("socketserver", "SocketServer"),
+    MovedModule("tkinter", "Tkinter"),
+    MovedModule("tkinter_dialog", "Dialog", "tkinter.dialog"),
+    MovedModule("tkinter_filedialog", "FileDialog", "tkinter.filedialog"),
+    MovedModule("tkinter_scrolledtext", "ScrolledText", "tkinter.scrolledtext"),
+    MovedModule("tkinter_simpledialog", "SimpleDialog", "tkinter.simpledialog"),
+    MovedModule("tkinter_tix", "Tix", "tkinter.tix"),
+    MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"),
+    MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"),
+    MovedModule("tkinter_colorchooser", "tkColorChooser",
+                "tkinter.colorchooser"),
+    MovedModule("tkinter_commondialog", "tkCommonDialog",
+                "tkinter.commondialog"),
+    MovedModule("tkinter_tkfiledialog", "tkFileDialog", "tkinter.filedialog"),
+    MovedModule("tkinter_font", "tkFont", "tkinter.font"),
+    MovedModule("tkinter_messagebox", "tkMessageBox", "tkinter.messagebox"),
+    MovedModule("tkinter_tksimpledialog", "tkSimpleDialog",
+                "tkinter.simpledialog"),
+    MovedModule("urllib_robotparser", "robotparser", "urllib.robotparser"),
+    MovedModule("winreg", "_winreg"),
+]
+for attr in _moved_attributes:
+    setattr(_MovedItems, attr.name, attr)
+del attr
+
+moves = sys.modules[__name__ + ".moves"] = _MovedItems("moves")
+
+
+def add_move(move):
+    """Add an item to six.moves."""
+    setattr(_MovedItems, move.name, move)
+
+
+def remove_move(name):
+    """Remove item from six.moves."""
+    try:
+        delattr(_MovedItems, name)
+    except AttributeError:
+        try:
+            del moves.__dict__[name]
+        except KeyError:
+            raise AttributeError("no such move, %r" % (name,))
+
+
+if PY3:
+    _meth_func = "__func__"
+    _meth_self = "__self__"
+
+    _func_closure = "__closure__"
+    _func_code = "__code__"
+    _func_defaults = "__defaults__"
+    _func_globals = "__globals__"
+
+    _iterkeys = "keys"
+    _itervalues = "values"
+    _iteritems = "items"
+    _iterlists = "lists"
+else:
+    _meth_func = "im_func"
+    _meth_self = "im_self"
+
+    _func_closure = "func_closure"
+    _func_code = "func_code"
+    _func_defaults = "func_defaults"
+    _func_globals = "func_globals"
+
+    _iterkeys = "iterkeys"
+    _itervalues = "itervalues"
+    _iteritems = "iteritems"
+    _iterlists = "iterlists"
+
+
+try:
+    advance_iterator = next
+except NameError:
+    def advance_iterator(it):
+        return it.next()
+next = advance_iterator
+
+
+try:
+    callable = callable
+except NameError:
+    def callable(obj):
+        return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
+
+
+if PY3:
+    def get_unbound_function(unbound):
+        return unbound
+
+    Iterator = object
+else:
+    def get_unbound_function(unbound):
+        return unbound.im_func
+
+    class Iterator(object):
+
+        def next(self):
+            return type(self).__next__(self)
+
+    callable = callable
+_add_doc(get_unbound_function,
+         """Get the function out of a possibly unbound function""")
+
+
+get_method_function = operator.attrgetter(_meth_func)
+get_method_self = operator.attrgetter(_meth_self)
+get_function_closure = operator.attrgetter(_func_closure)
+get_function_code = operator.attrgetter(_func_code)
+get_function_defaults = operator.attrgetter(_func_defaults)
+get_function_globals = operator.attrgetter(_func_globals)
+
+
+def iterkeys(d, **kw):
+    """Return an iterator over the keys of a dictionary."""
+    return iter(getattr(d, _iterkeys)(**kw))
+
+def itervalues(d, **kw):
+    """Return an iterator over the values of a dictionary."""
+    return iter(getattr(d, _itervalues)(**kw))
+
+def iteritems(d, **kw):
+    """Return an iterator over the (key, value) pairs of a dictionary."""
+    return iter(getattr(d, _iteritems)(**kw))
+
+def iterlists(d, **kw):
+    """Return an iterator over the (key, [values]) pairs of a dictionary."""
+    return iter(getattr(d, _iterlists)(**kw))
+
+
+if PY3:
+    def b(s):
+        return s.encode("latin-1")
+    def u(s):
+        return s
+    if sys.version_info[1] <= 1:
+        def int2byte(i):
+            return bytes((i,))
+    else:
+        # This is about 2x faster than the implementation above on 3.2+
+        int2byte = operator.methodcaller("to_bytes", 1, "big")
+    import io
+    StringIO = io.StringIO
+    BytesIO = io.BytesIO
+else:
+    def b(s):
+        return s
+    def u(s):
+        return unicode(s, "unicode_escape")
+    int2byte = chr
+    import StringIO
+    StringIO = BytesIO = StringIO.StringIO
+_add_doc(b, """Byte literal""")
+_add_doc(u, """Text literal""")
+
+
+if PY3:
+    import builtins
+    exec_ = getattr(builtins, "exec")
+
+
+    def reraise(tp, value, tb=None):
+        if value.__traceback__ is not tb:
+            raise value.with_traceback(tb)
+        raise value
+
+
+    print_ = getattr(builtins, "print")
+    del builtins
+
+else:
+    def exec_(_code_, _globs_=None, _locs_=None):
+        """Execute code in a namespace."""
+        if _globs_ is None:
+            frame = sys._getframe(1)
+            _globs_ = frame.f_globals
+            if _locs_ is None:
+                _locs_ = frame.f_locals
+            del frame
+        elif _locs_ is None:
+            _locs_ = _globs_
+        exec("""exec _code_ in _globs_, _locs_""")
+
+
+    exec_("""def reraise(tp, value, tb=None):
+    raise tp, value, tb
+""")
+
+
+    def print_(*args, **kwargs):
+        """The new-style print function."""
+        fp = kwargs.pop("file", sys.stdout)
+        if fp is None:
+            return
+        def write(data):
+            if not isinstance(data, basestring):
+                data = str(data)
+            fp.write(data)
+        want_unicode = False
+        sep = kwargs.pop("sep", None)
+        if sep is not None:
+            if isinstance(sep, unicode):
+                want_unicode = True
+            elif not isinstance(sep, str):
+                raise TypeError("sep must be None or a string")
+        end = kwargs.pop("end", None)
+        if end is not None:
+            if isinstance(end, unicode):
+                want_unicode = True
+            elif not isinstance(end, str):
+                raise TypeError("end must be None or a string")
+        if kwargs:
+            raise TypeError("invalid keyword arguments to print()")
+        if not want_unicode:
+            for arg in args:
+                if isinstance(arg, unicode):
+                    want_unicode = True
+                    break
+        if want_unicode:
+            newline = unicode("\n")
+            space = unicode(" ")
+        else:
+            newline = "\n"
+            space = " "
+        if sep is None:
+            sep = space
+        if end is None:
+            end = newline
+        for i, arg in enumerate(args):
+            if i:
+                write(sep)
+            write(arg)
+        write(end)
+
+_add_doc(reraise, """Reraise an exception.""")
+
+
+def with_metaclass(meta, base=object):
+    """Create a base class with a metaclass."""
+    return meta("NewBase", (base,), {})

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/frontends/gdf/data_structures.py
--- a/yt/frontends/gdf/data_structures.py
+++ b/yt/frontends/gdf/data_structures.py
@@ -203,7 +203,10 @@
             else:
                 self.units[field_name] = 1.0
             if 'field_units' in current_field.attrs:
-                current_fields_unit = just_one(current_field.attrs['field_units'])
+                if type(current_field.attrs['field_units']) == str:
+                    current_fields_unit = current_field.attrs['field_units']
+                else:
+                    current_fields_unit = just_one(current_field.attrs['field_units'])
             else:
                 current_fields_unit = ""
             self._fieldinfo_known.add_field(field_name, function=NullFunc, take_log=False,

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/frontends/gdf/fields.py
--- a/yt/frontends/gdf/fields.py
+++ b/yt/frontends/gdf/fields.py
@@ -84,8 +84,11 @@
           units=r"\rm{cm}/\rm{s}")
 
 for f,v in log_translation_dict.items():
-    add_field(f, TranslationFunc(v), take_log=True)
+    add_field(f, TranslationFunc(v), take_log=True,
+              units=KnownGDFFields[v].get_units(),
+              projected_units=KnownGDFFields[v].get_projected_units())
 
 for f,v in translation_dict.items():
-    add_field(f, TranslationFunc(v), take_log=False)
-
+    add_field(f, TranslationFunc(v), take_log=False,
+              units=KnownGDFFields[v].get_units(),
+              projected_units=KnownGDFFields[v].get_projected_units())

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/gui/reason/extdirect_repl.py
--- a/yt/gui/reason/extdirect_repl.py
+++ b/yt/gui/reason/extdirect_repl.py
@@ -181,6 +181,7 @@
     # Matplotlib has very nice backend overriding.
     # We should really use that.  This is just a hack.
     import matplotlib
+    matplotlib.use("agg") # Hotfix for when we import pylab below
     new_agg = imp.new_module("reason_agg")
     import matplotlib.backends.backend_agg as bagg
     new_agg.__dict__.update(bagg.__dict__)
@@ -190,8 +191,8 @@
     sys.modules["reason_agg"] = new_agg
     bagg.draw_if_interactive = reason_draw_if_interactive
     from matplotlib._pylab_helpers import Gcf
-    import pylab, matplotlib
     matplotlib.rcParams["backend"] = "module://reason_agg"
+    import pylab
     pylab.switch_backend("module://reason_agg")
 
 _startup_template = r"""\

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/setup.py
--- a/yt/setup.py
+++ b/yt/setup.py
@@ -9,6 +9,7 @@
     config = Configuration('yt', parent_package, top_path)
     config.add_subpackage('analysis_modules')
     config.add_subpackage('data_objects')
+    config.add_subpackage('extern')
     config.add_subpackage('frontends')
     config.add_subpackage('gui')
     config.add_subpackage('utilities')

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -33,6 +33,7 @@
 import cPickle
 import shelve
 import zlib
+import tempfile
 
 from matplotlib.testing.compare import compare_images
 from nose.plugins import Plugin
@@ -604,9 +605,11 @@
                                 self.plot_axis, self.plot_kwargs)
         attr = getattr(plot, self.attr_name)
         attr(*self.attr_args[0], **self.attr_args[1])
-        fn = plot.save()[0]
-        image = mpimg.imread(fn)
-        os.remove(fn)
+        tmpfd, tmpname = tempfile.mkstemp(suffix='.png')
+        os.close(tmpfd)
+        plot.save(name=tmpname)
+        image = mpimg.imread(tmpname)
+        os.remove(tmpname)
         return [zlib.compress(image.dumps())]
 
     def compare(self, new_result, old_result):

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1320,7 +1320,7 @@
             if args.grids:
                 plt.annotate_grids()
             if args.time:
-                time = pf.current_time*pf['Time']*pf['years']
+                time = pf.current_time*pf['years']
                 plt.annotate_text((0.2,0.8), 't = %5.2e yr'%time)
 
             plt.set_cmap(args.field, args.cmap)

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/utilities/grid_data_format/tests/test_writer.py
--- a/yt/utilities/grid_data_format/tests/test_writer.py
+++ b/yt/utilities/grid_data_format/tests/test_writer.py
@@ -50,17 +50,18 @@
     tmpdir = tempfile.mkdtemp()
     tmpfile = os.path.join(tmpdir, 'test_gdf.h5')
 
-    test_pf = fake_random_pf(64)
-    write_to_gdf(test_pf, tmpfile, data_author=TEST_AUTHOR,
-                 data_comment=TEST_COMMENT)
-    del test_pf
+    try:
+        test_pf = fake_random_pf(64)
+        write_to_gdf(test_pf, tmpfile, data_author=TEST_AUTHOR,
+                     data_comment=TEST_COMMENT)
+        del test_pf
+        assert isinstance(load(tmpfile), GDFStaticOutput)
 
-    assert isinstance(load(tmpfile), GDFStaticOutput)
+        h5f = h5.File(tmpfile, 'r')
+        gdf = h5f['gridded_data_format'].attrs
+        assert_equal(gdf['data_author'], TEST_AUTHOR)
+        assert_equal(gdf['data_comment'], TEST_COMMENT)
+        h5f.close()
 
-    h5f = h5.File(tmpfile, 'r')
-    gdf = h5f['gridded_data_format'].attrs
-    assert_equal(gdf['data_author'], TEST_AUTHOR)
-    assert_equal(gdf['data_comment'], TEST_COMMENT)
-    h5f.close()
-
-    shutil.rmtree(tmpdir)
+    finally:
+        shutil.rmtree(tmpdir)

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/utilities/lib/setup.py
--- a/yt/utilities/lib/setup.py
+++ b/yt/utilities/lib/setup.py
@@ -20,36 +20,37 @@
     # Create a temporary directory
     tmpdir = tempfile.mkdtemp()
     curdir = os.getcwd()
-    os.chdir(tmpdir)
+    exit_code = 1
 
-    # Get compiler invocation
-    compiler = os.getenv('CC', 'cc')
+    try:
+        os.chdir(tmpdir)
 
-    # Attempt to compile a test script.
-    # See http://openmp.org/wp/openmp-compilers/
-    filename = r'test.c'
-    file = open(filename,'w', 0)
-    file.write(
-        "#include <omp.h>\n"
-        "#include <stdio.h>\n"
-        "int main() {\n"
-        "#pragma omp parallel\n"
-        "printf(\"Hello from thread %d, nthreads %d\\n\", omp_get_thread_num(), omp_get_num_threads());\n"
-        "}"
-        )
-    with open(os.devnull, 'w') as fnull:
-        exit_code = subprocess.call([compiler, '-fopenmp', filename],
-                                    stdout=fnull, stderr=fnull)
+        # Get compiler invocation
+        compiler = os.getenv('CC', 'cc')
 
-    # Clean up
-    file.close()
-    os.chdir(curdir)
-    shutil.rmtree(tmpdir)
+        # Attempt to compile a test script.
+        # See http://openmp.org/wp/openmp-compilers/
+        filename = r'test.c'
+        file = open(filename,'w', 0)
+        file.write(
+            "#include <omp.h>\n"
+            "#include <stdio.h>\n"
+            "int main() {\n"
+            "#pragma omp parallel\n"
+            "printf(\"Hello from thread %d, nthreads %d\\n\", omp_get_thread_num(), omp_get_num_threads());\n"
+            "}"
+            )
+        with open(os.devnull, 'w') as fnull:
+            exit_code = subprocess.call([compiler, '-fopenmp', filename],
+                                        stdout=fnull, stderr=fnull)
 
-    if exit_code == 0:
-        return True
-    else:
-        return False
+        # Clean up
+        file.close()
+    finally:
+        os.chdir(curdir)
+        shutil.rmtree(tmpdir)
+
+    return exit_code == 0
 
 def configuration(parent_package='',top_path=None):
     from numpy.distutils.misc_util import Configuration

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -29,6 +29,7 @@
 import matplotlib
 import cStringIO
 import types
+import os
 import __builtin__
 
 from matplotlib.mathtext import MathTextParser
@@ -1056,8 +1057,8 @@
         Parameters
         ----------
         name : string
-           the base of the filename.  If not set the filename of
-           the parameter file is used
+           The base of the filename.  If name is a directory or if name is not
+           set, the filename of the dataset is used.
         mpl_kwargs : dict
            A dict of keyword arguments to be passed to matplotlib.
 
@@ -1068,6 +1069,11 @@
         if mpl_kwargs is None: mpl_kwargs = {}
         if name is None:
             name = str(self.pf)
+        name = os.path.expanduser(name)
+        if name[-1] == os.sep and not os.path.isdir(name):
+            os.mkdir(name)
+        if os.path.isdir(name):
+            name = name + (os.sep if name[-1] != os.sep else '') + str(self.pf)
         suffix = get_image_suffix(name)
         if suffix != '':
             for k, v in self.plots.iteritems():

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -144,19 +144,30 @@
 
         im = self.image
         if self.cbar.scale == 'log':
-            norm = mpl.matplotlib.colors.LogNorm()
+            norm = mpl.matplotlib.colors.LogNorm(
+                vmin = self.cbar.bounds[0],
+                vmax = self.cbar.bounds[1])
         else:
-            norm = mpl.matplotlib.colors.Normalize()
+            norm = mpl.matplotlib.colors.Normalize(
+                vmin = self.cbar.bounds[0],
+                vmax = self.cbar.bounds[1])
         if use_mesh:
-            pcm = axes.pcolormesh(x_bins, y_bins, self.image, norm=norm,
+            mappable = axes.pcolormesh(
+                                  x_bins, y_bins, self.image, norm=norm,
                                   shading='flat', cmap = self.cbar.cmap,
                                   rasterized=True)
             if self.x_spec.scale == 'log': axes.set_xscale("log")
             if self.y_spec.scale == 'log': axes.set_yscale("log")
         else:
-            axes.imshow(self.image, origin='lower', interpolation='nearest',
+            mappable = axes.imshow(
+                        self.image, origin='lower', interpolation='nearest',
                         cmap = self.cbar.cmap, extent = [xmi,xma,ymi,yma],
                         norm = norm)
+        cbar = figure.colorbar(mappable)
+        cbar.set_label(self.cbar.title)
+        mappable.cmap.set_bad("w")
+        mappable.cmap.set_under("w")
+        mappable.cmap.set_over("w")
         if self.x_spec.title is not None:
             axes.set_xlabel(self.x_spec.title)
         if self.y_spec.title is not None:
@@ -301,12 +312,9 @@
 
         cbar = ColorbarSpec()
         cbar.title = self._current_field
-        if self.scale == 'log':
-            nz = (self.profile[self._current_field] > 0)
-            mi = self.profile[self._current_field][nz].min()
-        else:
-            mi = self.profile[self._current_field].min()
-        ma = self.profile[self._current_field].max()
+        nz = self.profile["UsedBins"]
+        mi = self.profile[self._current_field][nz].min()
+        ma = self.profile[self._current_field][nz].max()
         cbar.bounds = (mi, ma)
         cbar.cmap = 'algae'
         cbar.scale = self.scale

diff -r 764ed836d7b7027facd3bd5aa4def61985bc73c4 -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a yt/visualization/tests/test_plotwindow.py
--- a/yt/visualization/tests/test_plotwindow.py
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -22,9 +22,12 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 """
+import itertools
 import os
 import tempfile
 import shutil
+import unittest
+from yt.extern.parameterized import parameterized, param
 from yt.testing import \
     fake_random_pf, assert_equal, assert_rel_equal
 from yt.utilities.answer_testing.framework import \
@@ -65,132 +68,163 @@
 
     return image_type == os.path.splitext(fname)[1]
 
-attr_args ={ "pan"             : [( ((0.1, 0.1),), {} )],
-             "pan_rel"         : [( ((0.1, 0.1),), {} )],
-             "set_axes_unit"   : [( ("kpc",), {} ),
-                                  ( ("Mpc",), {} ),
-                                  ( (("kpc", "kpc"),), {} ),
-                                  ( (("kpc", "Mpc"),), {} )],
-             "set_buff_size"   : [( (1600,), {} ),
-                                  ( ((600, 800),), {} )],
-             "set_center"      : [( ((0.4, 0.3),), {} )],
-             "set_cmap"        : [( ('Density', 'RdBu'), {} ),
-                                  ( ('Density', 'kamae'), {} )],
-             "set_font"        : [( ({'family':'sans-serif', 'style':'italic',
-                                      'weight':'bold', 'size':24},), {} )],
-             "set_log"         : [( ('Density', False), {} )],
-             "set_window_size" : [( (7.0,), {} )],
-             "set_zlim" : [( ('Density', 1e-25, 1e-23), {} ),
-                           ( ('Density', 1e-25, None), {'dynamic_range' : 4} )],
-             "zoom" : [( (10,), {} )] }
 
-m7 = "DD0010/moving7_0010"
-wt = "WindTunnel/windtunnel_4lev_hdf5_plt_cnt_0030"
- at requires_pf(m7)
- at requires_pf(wt)
+TEST_FLNMS = [None, 'test.png', 'test.eps',
+              'test.ps', 'test.pdf']
+M7 = "DD0010/moving7_0010"
+WT = "WindTunnel/windtunnel_4lev_hdf5_plt_cnt_0030"
+
+ATTR_ARGS = {"pan": [(((0.1, 0.1), ), {})],
+             "pan_rel": [(((0.1, 0.1), ), {})],
+             "set_axes_unit": [(("kpc", ), {}),
+                               (("Mpc", ), {}),
+                               ((("kpc", "kpc"),), {}),
+                               ((("kpc", "Mpc"),), {})],
+             "set_buff_size": [((1600, ), {}),
+                               (((600, 800), ), {})],
+             "set_center": [(((0.4, 0.3), ), {})],
+             "set_cmap": [(('Density', 'RdBu'), {}),
+                          (('Density', 'kamae'), {})],
+             "set_font": [(({'family': 'sans-serif', 'style': 'italic',
+                             'weight': 'bold', 'size': 24}, ), {})],
+             "set_log": [(('Density', False), {})],
+             "set_window_size": [((7.0, ), {})],
+             "set_zlim": [(('Density', 1e-25, 1e-23), {}),
+                          (('Density', 1e-25, None), {'dynamic_range': 4})],
+             "zoom": [((10, ), {})]}
+
+
+ at requires_pf(M7)
 def test_attributes():
     """Test plot member functions that aren't callbacks"""
     plot_field = 'Density'
     decimals = 3
 
-    pf = data_dir_load(m7)
+    pf = data_dir_load(M7)
     for ax in 'xyz':
-        for attr_name in attr_args.keys():
-            for args in attr_args[attr_name]:
+        for attr_name in ATTR_ARGS.keys():
+            for args in ATTR_ARGS[attr_name]:
                 yield PlotWindowAttributeTest(pf, plot_field, ax, attr_name,
                                               args, decimals)
-    pf = data_dir_load(wt)
+
+
+ at requires_pf(WT)
+def test_attributes_wt():
+    plot_field = 'Density'
+    decimals = 3
+
+    pf = data_dir_load(WT)
     ax = 'z'
-    for attr_name in attr_args.keys():
-        for args in attr_args[attr_name]:
+    for attr_name in ATTR_ARGS.keys():
+        for args in ATTR_ARGS[attr_name]:
             yield PlotWindowAttributeTest(pf, plot_field, ax, attr_name,
                                           args, decimals)
 
-def test_setwidth():
-    pf = fake_random_pf(64)
 
-    slc = SlicePlot(pf, 0, 'Density')
+class TestSetWidth(unittest.TestCase):
 
-    yield assert_equal, [slc.xlim, slc.ylim, slc.width], \
-        [(0.0, 1.0), (0.0, 1.0), (1.0, 1.0)]
+    pf = None
 
-    slc.set_width((0.5,0.8))
+    def setUp(self):
+        if self.pf is None:
+            self.pf = fake_random_pf(64)
+            self.slc = SlicePlot(self.pf, 0, 'Density')
 
-    yield assert_rel_equal, [slc.xlim, slc.ylim, slc.width], \
-        [(0.25, 0.75), (0.1, 0.9), (0.5, 0.8)], 15
+    def _assert_15kpc(self):
+        assert_rel_equal([self.slc.xlim, self.slc.ylim, self.slc.width],
+                         [(-7.5 / self.pf['kpc'], 7.5 / self.pf['kpc']),
+                          (-7.5 / self.pf['kpc'], 7.5 / self.pf['kpc']),
+                          (15.0 / self.pf['kpc'], 15. / self.pf['kpc'])], 15)
 
-    slc.set_width(15,'kpc')
+    def _assert_15_10kpc(self):
+        assert_rel_equal([self.slc.xlim, self.slc.ylim, self.slc.width],
+                         [(-7.5 / self.pf['kpc'], 7.5 / self.pf['kpc']),
+                          (-5.0 / self.pf['kpc'], 5.0 / self.pf['kpc']),
+                          (15.0 / self.pf['kpc'], 10. / self.pf['kpc'])], 15)
 
-    yield assert_rel_equal, [slc.xlim, slc.ylim, slc.width], \
-        [(-7.5/pf['kpc'], 7.5/pf['kpc']),
-         (-7.5/pf['kpc'], 7.5/pf['kpc']),
-         (15/pf['kpc'], 15/pf['kpc'])], 15
+    def test_set_width_one(self):
+        assert_equal([self.slc.xlim, self.slc.ylim, self.slc.width],
+                     [(0.0, 1.0), (0.0, 1.0), (1.0, 1.0)])
 
-    slc.set_width((15,'kpc'))
+    def test_set_width_nonequal(self):
+        self.slc.set_width((0.5, 0.8))
+        assert_rel_equal([self.slc.xlim, self.slc.ylim, self.slc.width],
+                         [(0.25, 0.75), (0.1, 0.9), (0.5, 0.8)], 15)
 
-    yield assert_rel_equal, [slc.xlim, slc.ylim, slc.width], \
-        [(-7.5/pf['kpc'], 7.5/pf['kpc']),
-         (-7.5/pf['kpc'], 7.5/pf['kpc']),
-         (15/pf['kpc'], 15/pf['kpc'])], 15
+    def test_twoargs_eq(self):
+        self.slc.set_width(15, 'kpc')
+        self._assert_15kpc()
 
-    slc.set_width(((15,'kpc'),(10,'kpc')))
+    def test_tuple_eq(self):
+        self.slc.set_width((15, 'kpc'))
+        self._assert_15kpc()
 
-    yield assert_rel_equal, [slc.xlim, slc.ylim, slc.width], \
-        [(-7.5/pf['kpc'], 7.5/pf['kpc']),
-         (-5/pf['kpc'], 5/pf['kpc']),
-         (15/pf['kpc'], 10/pf['kpc'])], 15
+    def test_tuple_of_tuples_neq(self):
+        self.slc.set_width(((15, 'kpc'), (10, 'kpc')))
+        self._assert_15_10kpc()
 
-    slc.set_width(((15,'kpc'),(10000,'pc')))
+    def test_tuple_of_tuples_neq2(self):
+        self.slc.set_width(((15, 'kpc'), (10000, 'pc')))
+        self._assert_15_10kpc()
 
-    yield assert_rel_equal, [slc.xlim, slc.ylim, slc.width], \
-        [(-7.5/pf['kpc'], 7.5/pf['kpc']),
-         (-5/pf['kpc'], 5/pf['kpc']),
-         (15/pf['kpc'], 10/pf['kpc'])], 15
+    def test_pair_of_tuples_neq(self):
+        self.slc.set_width((15, 'kpc'), (10000, 'pc'))
+        self._assert_15_10kpc()
 
-    slc.set_width((15,'kpc'),(10000,'pc'))
 
-    yield assert_rel_equal, [slc.xlim, slc.ylim, slc.width], \
-        [(-7.5/pf['kpc'], 7.5/pf['kpc']),
-         (-5/pf['kpc'], 5/pf['kpc']),
-         (15/pf['kpc'], 10/pf['kpc'])], 15
+class TestPlotWindowSave(unittest.TestCase):
 
-def test_save():
-    """Test plot window creation and saving to disk."""
-    # Perform I/O in safe place instead of yt main dir
-    tmpdir = tempfile.mkdtemp()
-    curdir = os.getcwd()
-    os.chdir(tmpdir)
+    @classmethod
+    def setUpClass(cls):
+        test_pf = fake_random_pf(64)
+        normal = [1, 1, 1]
+        ds_region = test_pf.h.region([0.5] * 3, [0.4] * 3, [0.6] * 3)
+        projections = []
+        projections_ds = []
+        for dim in range(3):
+            projections.append(ProjectionPlot(test_pf, dim, 'Density'))
+            projections_ds.append(ProjectionPlot(test_pf, dim, 'Density',
+                                                 data_source=ds_region))
 
-    normal = [1, 1, 1]
+        cls.slices = [SlicePlot(test_pf, dim, 'Density') for dim in range(3)]
+        cls.projections = projections
+        cls.projections_ds = projections_ds
+        cls.offaxis_slice = OffAxisSlicePlot(test_pf, normal, 'Density')
+        cls.offaxis_proj = OffAxisProjectionPlot(test_pf, normal, 'Density')
 
-    test_pf = fake_random_pf(64)
-    test_flnms = [None, 'test.png', 'test.eps',
-                  'test.ps', 'test.pdf']
+    def setUp(self):
+        self.tmpdir = tempfile.mkdtemp()
+        self.curdir = os.getcwd()
+        os.chdir(self.tmpdir)
 
-    ds_region = test_pf.h.region([0.5]*3,[0.4]*3,[0.6]*3)
+    def tearDown(self):
+        os.chdir(self.curdir)
+        shutil.rmtree(self.tmpdir)
 
-    for dim in [0, 1, 2]:
-        obj = SlicePlot(test_pf, dim, 'Density')
-        for fname in test_flnms:
-            yield assert_equal, assert_fname(obj.save(fname)[0]), True
+    @parameterized.expand(
+        param.explicit(item)
+        for item in itertools.product(range(3), TEST_FLNMS))
+    def test_slice_plot(self, dim, fname):
+        assert assert_fname(self.slices[dim].save(fname)[0])
 
-    for dim in [0, 1, 2]:
-        obj = ProjectionPlot(test_pf, dim, 'Density')
-        for fname in test_flnms:
-            yield assert_equal, assert_fname(obj.save(fname)[0]), True
-        # Test ProjectionPlot's data_source keyword
-        obj = ProjectionPlot(test_pf, dim, 'Density',
-                             data_source=ds_region)
-        obj.save()
+    @parameterized.expand(
+        param.explicit(item)
+        for item in itertools.product(range(3), TEST_FLNMS))
+    def test_projection_plot(self, dim, fname):
+        assert assert_fname(self.projections[dim].save(fname)[0])
 
-    obj = OffAxisSlicePlot(test_pf, normal, 'Density')
-    for fname in test_flnms:
-        yield assert_equal, assert_fname(obj.save(fname)[0]), True
+    @parameterized.expand([(0, ), (1, ), (2, )])
+    def test_projection_plot_ds(self, dim):
+        self.projections_ds[dim].save()
 
-    obj = OffAxisProjectionPlot(test_pf, normal, 'Density')
-    for fname in test_flnms:
-        yield assert_equal, assert_fname(obj.save(fname)[0]), True
+    @parameterized.expand(
+        param.explicit((fname, ))
+        for fname in TEST_FLNMS)
+    def test_offaxis_slice_plot(self, fname):
+        assert assert_fname(self.offaxis_slice.save(fname)[0])
 
-    os.chdir(curdir)
-    # clean up
-    shutil.rmtree(tmpdir)
+    @parameterized.expand(
+        param.explicit((fname, ))
+        for fname in TEST_FLNMS)
+    def test_offaxis_projection_plot(self, fname):
+        assert assert_fname(self.offaxis_proj.save(fname)[0])


https://bitbucket.org/yt_analysis/yt/commits/e936ccf6dc5c/
Changeset:   e936ccf6dc5c
Branch:      yt
User:        chummels
Date:        2013-09-05 23:33:51
Summary:     Fixing a typo.
Affected #:  1 file

diff -r ad7dc492a0bf624ce41d14a8f903949efffd2c1a -r e936ccf6dc5c6f6752e86da82542a1e82da7502e yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -698,7 +698,7 @@
     if data.pf.dimensionality == 2:
         shear = (fxy**2 + fyx**2) * (dx/c_s)**2
 
-    if data.pf.dimensionality == 3:o
+    if data.pf.dimensionality == 3:
         shear = (fxy**2 + fxz**2 + fyx**2 + fyz**2 + fzx**2 + fzy**2) * (dx/c_s)**2
     shear = shear**0.5
 


https://bitbucket.org/yt_analysis/yt/commits/3b1c9b1f479d/
Changeset:   3b1c9b1f479d
Branch:      yt
User:        chummels
Date:        2013-09-06 00:50:53
Summary:     Fixing problem in shear which causes test failure.
Affected #:  1 file

diff -r e936ccf6dc5c6f6752e86da82542a1e82da7502e -r 3b1c9b1f479d0929609dd29a1bdb4d693e83af76 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -708,7 +708,7 @@
 
 add_field("Shear", function=_Shear,
           validators=[ValidateSpatial(ghost_zones=1,
-          fields=["x-velocity","y-velocity","z-velocity","SoundSpeed"])],
+          fields=["x-velocity","y-velocity","z-velocity","SoundSpeed","dx"])],
           units=r"\rm{Mach}", take_log=False)
 
 def _Contours(field, data):


https://bitbucket.org/yt_analysis/yt/commits/9cc6c5ec1cc4/
Changeset:   9cc6c5ec1cc4
Branch:      yt
User:        chummels
Date:        2013-09-07 00:14:51
Summary:     Merging.
Affected #:  3 files

diff -r 3b1c9b1f479d0929609dd29a1bdb4d693e83af76 -r 9cc6c5ec1cc4a31616ce0fe58887d568b95988c2 yt/convenience.py
--- a/yt/convenience.py
+++ b/yt/convenience.py
@@ -58,8 +58,19 @@
     candidates = []
     args = [os.path.expanduser(arg) if isinstance(arg, types.StringTypes)
             else arg for arg in args]
-    valid_file = [os.path.exists(arg) if isinstance(arg, types.StringTypes) 
-            else False for arg in args]
+    valid_file = []
+    for argno, arg in enumerate(args):
+        if isinstance(arg, types.StringTypes):
+            if os.path.exists(arg):
+                valid_file.append(True)
+            else:
+                if os.path.exists(os.path.join(ytcfg.get("yt", "test_data_dir"), arg)):
+                    valid_file.append(True)
+                    args[argno] = os.path.join(ytcfg.get("yt", "test_data_dir"), arg)
+                else:
+                    valid_file.append(False)
+        else:
+            valid_file.append(False)
     if not any(valid_file):
         try:
             from yt.data_objects.time_series import TimeSeriesData

diff -r 3b1c9b1f479d0929609dd29a1bdb4d693e83af76 -r 9cc6c5ec1cc4a31616ce0fe58887d568b95988c2 yt/frontends/enzo/simulation_handling.py
--- a/yt/frontends/enzo/simulation_handling.py
+++ b/yt/frontends/enzo/simulation_handling.py
@@ -270,7 +270,7 @@
             if '#' in line: line = line[0:line.find('#')]
             if '//' in line: line = line[0:line.find('//')]
             if len(line) < 2: continue
-            param, vals = (i.strip() for i in line.split("="))
+            param, vals = (i.strip() for i in line.split("=", 1))
             # First we try to decipher what type of value it is.
             vals = vals.split()
             # Special case approaching.

diff -r 3b1c9b1f479d0929609dd29a1bdb4d693e83af76 -r 9cc6c5ec1cc4a31616ce0fe58887d568b95988c2 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1589,17 +1589,26 @@
     def __call__(self, args):
         pf = args.pf
         pf.h.print_stats()
+        vals = {}
         if args.field in pf.h.derived_field_list:
             if args.max == True:
-                v, c = pf.h.find_max(args.field)
-                print "Maximum %s: %0.5e at %s" % (args.field, v, c)
+                vals['min'] = pf.h.find_max(args.field)
+                print "Maximum %s: %0.5e at %s" % (args.field,
+                    vals['min'][0], vals['min'][1])
             if args.min == True:
-                v, c = pf.h.find_min(args.field)
-                print "Minimum %s: %0.5e at %s" % (args.field, v, c)
+                vals['max'] = pf.h.find_min(args.field)
+                print "Minimum %s: %0.5e at %s" % (args.field,
+                    vals['max'][0], vals['max'][1])
         if args.output is not None:
             t = pf.current_time * pf['years']
-            open(args.output, "a").write(
-                "%s (%0.5e years): %0.5e at %s\n" % (pf, t, v, c))
+            with open(args.output, "a") as f:
+                f.write("%s (%0.5e years)\n" % (pf, t))
+                if 'min' in vals:
+                    f.write('Minimum %s is %0.5e at %s\n' % (
+                        args.field, vals['min'][0], vals['min'][1]))
+                if 'max' in vals:
+                    f.write('Maximum %s is %0.5e at %s\n' % (
+                        args.field, vals['max'][0], vals['max'][1]))
 
 class YTUpdateCmd(YTCommand):
     args = ("all", )


https://bitbucket.org/yt_analysis/yt/commits/2c43d63dfe6d/
Changeset:   2c43d63dfe6d
Branch:      yt
User:        chummels
Date:        2013-09-09 20:39:56
Summary:     Simplifying shear field calculation
Affected #:  1 file

diff -r 9cc6c5ec1cc4a31616ce0fe58887d568b95988c2 -r 2c43d63dfe6dbcd22c0854c405c3b975cd23a87e yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -664,29 +664,29 @@
         sl_right = slice(2,None,None)
         div_fac = 2.0
     # only works for 2d and 3d data:
+    f = np.zeros(data["x-velocity"][2:,2:,2:].shape, dtype='float64')
     if data.pf.dimensionality > 1:
         # first the dx direction
         ds = div_fac * data['dx'].flat[0]
-        fxy  = data["y-velocity"][1:-1,sl_right,1:-1]/ds
-        fxy -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
+        f += ((data["y-velocity"][1:-1,sl_right,1:-1]/ds) - 
+              (data["y-velocity"][1:-1,sl_left ,1:-1]/ds))**2
         ds = div_fac * data['dy'].flat[0]
-        fyx  = data["x-velocity"][sl_right,1:-1,1:-1]/ds
-        fyx -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
+        f += ((data["x-velocity"][sl_right,1:-1,1:-1]/ds) - 
+              (data["x-velocity"][sl_left ,1:-1,1:-1]/ds))**2
 
     if data.pf.dimensionality > 2:
         ds = div_fac * data['dx'].flat[0]
-        fxz  = data["z-velocity"][1:-1,1:-1,sl_right]/ds
-        fxz -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
+        f += ((data["z-velocity"][1:-1,1:-1,sl_right]/ds) - 
+              (data["z-velocity"][1:-1,1:-1,sl_left ]/ds))**2
         ds = div_fac * data['dy'].flat[0]
-        fyz  = data["z-velocity"][1:-1,1:-1,sl_right]/ds
-        fyz -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
-
+        f += ((data["z-velocity"][1:-1,1:-1,sl_right]/ds) - 
+              (data["z-velocity"][1:-1,1:-1,sl_left ]/ds))**2
         # lastly the dz direction
         ds = div_fac * data['dz'].flat[0]
-        fzx  = data["x-velocity"][sl_right,1:-1,1:-1]/ds
-        fzx -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
-        fzy  = data["y-velocity"][1:-1,sl_right,1:-1]/ds
-        fzy -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
+        f += ((data["x-velocity"][sl_right,1:-1,1:-1]/ds) - 
+              (data["x-velocity"][sl_left ,1:-1,1:-1]/ds))**2
+        f += ((data["y-velocity"][1:-1,sl_right,1:-1]/ds) - 
+              (data["y-velocity"][1:-1,sl_left ,1:-1]/ds))**2
     if data.pf.dimensionality <= 1:
         print "Shear only valid when dimensionality > 2"
 
@@ -694,21 +694,14 @@
     c_s = data["SoundSpeed"][1:-1,1:-1,1:-1]
     # assumes dx = dy = dz; valid for enzo sims
     dx = data['dx'][1:-1,1:-1,1:-1]
-
-    if data.pf.dimensionality == 2:
-        shear = (fxy**2 + fyx**2) * (dx/c_s)**2
-
-    if data.pf.dimensionality == 3:
-        shear = (fxy**2 + fxz**2 + fyx**2 + fyz**2 + fzx**2 + fzy**2) * (dx/c_s)**2
-    shear = shear**0.5
-
+    shear = (f * (dx/c_s)**2)**0.5
     new_field = np.zeros(data["x-velocity"].shape, dtype='float64')
     new_field[1:-1,1:-1,1:-1] = shear
     return new_field
 
 add_field("Shear", function=_Shear,
           validators=[ValidateSpatial(ghost_zones=1,
-          fields=["x-velocity","y-velocity","z-velocity","SoundSpeed","dx"])],
+          fields=["x-velocity","y-velocity","z-velocity","SoundSpeed"])],
           units=r"\rm{Mach}", take_log=False)
 
 def _Contours(field, data):


https://bitbucket.org/yt_analysis/yt/commits/a1dd9b6fc0b5/
Changeset:   a1dd9b6fc0b5
Branch:      yt
User:        chummels
Date:        2013-09-09 21:07:45
Summary:     Bug fix to AMRCoveringGridBase to accept an array-like of ints for dimension argument.
Affected #:  1 file

diff -r 2c43d63dfe6dbcd22c0854c405c3b975cd23a87e -r a1dd9b6fc0b5ab177c07b09a40d3a7157b2b756c yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -3702,6 +3702,7 @@
                            fields=fields, pf=pf, **kwargs)
         self.left_edge = np.array(left_edge)
         self.level = level
+        dims = np.array(dims)
         rdx = self.pf.domain_dimensions*self.pf.refine_by**level
         rdx[np.where(dims - 2 * num_ghost_zones <= 1)] = 1   # issue 602
         self.dds = self.pf.domain_width / rdx.astype("float64")


https://bitbucket.org/yt_analysis/yt/commits/ad97f44aa8e5/
Changeset:   ad97f44aa8e5
Branch:      yt
User:        chummels
Date:        2013-09-10 00:30:24
Summary:     Updating shear derived field to deal with comments from PR.
Affected #:  1 file

diff -r a1dd9b6fc0b5ab177c07b09a40d3a7157b2b756c -r ad97f44aa8e56ee1cc58b63b6510aa6ddf060fa5 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -664,6 +664,7 @@
         sl_right = slice(2,None,None)
         div_fac = 2.0
     # only works for 2d and 3d data:
+    # Just get f to be zeros array of the right dimension as base
     f = np.zeros(data["x-velocity"][2:,2:,2:].shape, dtype='float64')
     if data.pf.dimensionality > 1:
         # first the dx direction
@@ -674,6 +675,7 @@
         f += ((data["x-velocity"][sl_right,1:-1,1:-1]/ds) - 
               (data["x-velocity"][sl_left ,1:-1,1:-1]/ds))**2
 
+    # if 3D sim, take into account additional shear directions
     if data.pf.dimensionality > 2:
         ds = div_fac * data['dx'].flat[0]
         f += ((data["z-velocity"][1:-1,1:-1,sl_right]/ds) - 
@@ -688,13 +690,11 @@
         f += ((data["y-velocity"][1:-1,sl_right,1:-1]/ds) - 
               (data["y-velocity"][1:-1,sl_left ,1:-1]/ds))**2
     if data.pf.dimensionality <= 1:
-        print "Shear only valid when dimensionality > 2"
+        raise NotImplementedError("Shear field undefined for 1D datasets")
 
-    # and the sound speed (make sure it has the right dimension)
-    c_s = data["SoundSpeed"][1:-1,1:-1,1:-1]
-    # assumes dx = dy = dz; valid for enzo sims
-    dx = data['dx'][1:-1,1:-1,1:-1]
-    shear = (f * (dx/c_s)**2)**0.5
+    # Calc the sound speed (make sure it has the right dimension)
+    c_s = (data["SoundSpeed"][1:-1,1:-1,1:-1])**2
+    shear = (f / c_s)**0.5
     new_field = np.zeros(data["x-velocity"].shape, dtype='float64')
     new_field[1:-1,1:-1,1:-1] = shear
     return new_field


https://bitbucket.org/yt_analysis/yt/commits/2735487db600/
Changeset:   2735487db600
Branch:      yt
User:        chummels
Date:        2013-09-10 00:31:36
Summary:     Merging.
Affected #:  43 files

diff -r ad97f44aa8e56ee1cc58b63b6510aa6ddf060fa5 -r 2735487db600876a6073fb2217a1b80df6f81f4e .hgchurn
--- a/.hgchurn
+++ b/.hgchurn
@@ -17,3 +17,4 @@
 tabel = tabel at slac.stanford.edu
 sername=kayleanelson = kaylea.nelson at yale.edu
 kayleanelson = kaylea.nelson at yale.edu
+jcforbes at ucsc.edu = jforbes at ucolick.org

diff -r ad97f44aa8e56ee1cc58b63b6510aa6ddf060fa5 -r 2735487db600876a6073fb2217a1b80df6f81f4e yt/analysis_modules/halo_merger_tree/enzofof_merger_tree.py
--- a/yt/analysis_modules/halo_merger_tree/enzofof_merger_tree.py
+++ b/yt/analysis_modules/halo_merger_tree/enzofof_merger_tree.py
@@ -54,8 +54,8 @@
 import glob
 
 from yt.funcs import *
-from yt.utilities.pykdtree import KDTree
-import yt.utilities.pydot as pydot
+from yt.extern.pykdtree import KDTree
+import yt.extern.pydot as pydot
 
 # We don't currently use this, but we may again find a use for it in the
 # future.

diff -r ad97f44aa8e56ee1cc58b63b6510aa6ddf060fa5 -r 2735487db600876a6073fb2217a1b80df6f81f4e yt/analysis_modules/halo_merger_tree/merger_tree.py
--- a/yt/analysis_modules/halo_merger_tree/merger_tree.py
+++ b/yt/analysis_modules/halo_merger_tree/merger_tree.py
@@ -36,7 +36,7 @@
     HaloProfiler
 from yt.convenience import load
 from yt.utilities.logger import ytLogger as mylog
-import yt.utilities.pydot as pydot
+import yt.extern.pydot as pydot
 from yt.utilities.spatial import cKDTree
 from yt.utilities.parallel_tools.parallel_analysis_interface import \
     ParallelDummy, \

diff -r ad97f44aa8e56ee1cc58b63b6510aa6ddf060fa5 -r 2735487db600876a6073fb2217a1b80df6f81f4e yt/analysis_modules/halo_profiler/multi_halo_profiler.py
--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py
@@ -1254,7 +1254,7 @@
                 mylog.error("Output directory exists, but is not a directory: %s." % my_output_dir)
                 raise IOError(my_output_dir)
         else:
-            os.mkdir(my_output_dir)
+            os.makedirs(my_output_dir)
 
 def _shift_projections(pf, projections, oldCenter, newCenter, axis):
     """

diff -r ad97f44aa8e56ee1cc58b63b6510aa6ddf060fa5 -r 2735487db600876a6073fb2217a1b80df6f81f4e yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -955,7 +955,7 @@
         interpolated using the nearest neighbor method, with *side* points on a
         side.
         """
-        import yt.utilities.delaunay as de
+        import matplotlib.delaunay.triangulate as de
         if log_spacing:
             zz = np.log10(self[field])
         else:

diff -r ad97f44aa8e56ee1cc58b63b6510aa6ddf060fa5 -r 2735487db600876a6073fb2217a1b80df6f81f4e yt/data_objects/time_series.py
--- a/yt/data_objects/time_series.py
+++ b/yt/data_objects/time_series.py
@@ -347,6 +347,7 @@
         # Figure out the starting and stopping times and redshift.
         self._calculate_simulation_bounds()
         # Get all possible datasets.
+        self.all_time_outputs = []
         self._get_all_outputs(find_outputs=find_outputs)
         
         self.print_key_parameters()

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

https://bitbucket.org/yt_analysis/yt/commits/b956f4134772/
Changeset:   b956f4134772
Branch:      yt
User:        chummels
Date:        2013-09-14 00:46:33
Summary:     Merging.
Affected #:  402 files

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -5156,3 +5156,4 @@
 0000000000000000000000000000000000000000 mpi-opaque
 f15825659f5af3ce64aaad30062aff3603cbfb66 hop callback
 0000000000000000000000000000000000000000 hop callback
+079e456c38a87676472a458210077e2be325dc85 last_gplv3

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f COPYING.txt
--- /dev/null
+++ b/COPYING.txt
@@ -0,0 +1,81 @@
+===============================
+ The yt project licensing terms
+===============================
+
+yt is licensed under the terms of the Modified BSD License (also known as New
+or Revised BSD), as follows:
+
+Copyright (c) 2013-, yt Development Team
+Copyright (c) 2006-2013, Matthew Turk <matthewturk at gmail.com>
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+Neither the name of the yt Development Team nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+About the yt Development Team
+-----------------------------
+
+Matthew Turk began yt in 2006 and remains the project lead.  Over time yt has
+grown to include contributions from a large number of individuals from many
+diverse institutions, scientific, and technical backgrounds.
+
+Until the fall of 2013, yt was licensed under the GPLv3.  However, with consent
+from all developers and on a public mailing list, yt has been relicensed under
+the BSD 3-clause under a shared copyright model.  For more information, see:
+http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/2013-July/003239.html
+All versions of yt prior to this licensing change are available under the
+GPLv3; all subsequent versions are available under the BSD 3-clause license.
+
+The yt Development Team is the set of all contributors to the yt project.  This
+includes all of the yt subprojects.
+
+The core team that coordinates development on BitBucket can be found here:
+http://bitbucket.org/yt_analysis/ 
+
+
+Our Copyright Policy
+--------------------
+
+yt uses a shared copyright model. Each contributor maintains copyright
+over their contributions to yt. But, it is important to note that these
+contributions are typically only changes to the repositories. Thus, the yt
+source code, in its entirety is not the copyright of any single person or
+institution.  Instead, it is the collective copyright of the entire yt
+Development Team.  If individual contributors want to maintain a record of what
+changes/contributions they have specific copyright on, they should indicate
+their copyright in the commit message of the change, when they commit the
+change to one of the yt repositories.
+
+With this in mind, the following banner should be used in any source code file
+to indicate the copyright and license terms:
+
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f CREDITS
--- a/CREDITS
+++ b/CREDITS
@@ -1,51 +1,55 @@
-YT is a group effort.
+yt is a group effort.
 
-Contributors:                   Tom Abel (tabel at stanford.edu)
-				David Collins (dcollins at physics.ucsd.edu)
-				Brian Crosby (crosby.bd at gmail.com)
-				Andrew Cunningham (ajcunn at gmail.com)
-				Nathan Goldbaum (goldbaum at ucolick.org)
-				Markus Haider (markus.haider at uibk.ac.at)
-				Cameron Hummels (chummels at gmail.com)
-				Christian Karch (chiffre at posteo.de)
-				Ji-hoon Kim (me at jihoonkim.org)
-				Steffen Klemer (sklemer at phys.uni-goettingen.de)
-				Kacper Kowalik (xarthisius.kk at gmail.com)
-				Michael Kuhlen (mqk at astro.berkeley.edu)
-				Eve Lee (elee at cita.utoronto.ca)
-				Yuan Li (yuan at astro.columbia.edu)
-				Chris Malone (chris.m.malone at gmail.com)
-				Josh Maloney (joshua.moloney at colorado.edu)
-				Chris Moody (cemoody at ucsc.edu)
-				Andrew Myers (atmyers at astro.berkeley.edu)
-				Jeff Oishi (jsoishi at gmail.com)
-				Jean-Claude Passy (jcpassy at uvic.ca)
-				Mark Richardson (Mark.L.Richardson at asu.edu)
-				Thomas Robitaille (thomas.robitaille at gmail.com)
-				Anna Rosen (rosen at ucolick.org)
-				Anthony Scopatz (scopatz at gmail.com)
-				Devin Silvia (devin.silvia at colorado.edu)
-				Sam Skillman (samskillman at gmail.com)
-				Stephen Skory (s at skory.us)
-				Britton Smith (brittonsmith at gmail.com)
-				Geoffrey So (gsiisg at gmail.com)
-				Casey Stark (caseywstark at gmail.com)
-				Elizabeth Tasker (tasker at astro1.sci.hokudai.ac.jp)
-				Stephanie Tonnesen (stonnes at gmail.com)
-				Matthew Turk (matthewturk at gmail.com)
-				Rich Wagner (rwagner at physics.ucsd.edu)
-				John Wise (jwise at physics.gatech.edu)
-				John ZuHone (jzuhone at gmail.com)
+Contributors:   
+                Tom Abel (tabel at stanford.edu)
+                David Collins (dcollins at physics.ucsd.edu)
+                Brian Crosby (crosby.bd at gmail.com)
+                Andrew Cunningham (ajcunn at gmail.com)
+                Hilary Egan (hilaryye at gmail.com)
+                John Forces (jforbes at ucolick.org)
+                Nathan Goldbaum (goldbaum at ucolick.org)
+                Markus Haider (markus.haider at uibk.ac.at)
+                Cameron Hummels (chummels at gmail.com)
+                Christian Karch (chiffre at posteo.de)
+                Ji-hoon Kim (me at jihoonkim.org)
+                Steffen Klemer (sklemer at phys.uni-goettingen.de)
+                Kacper Kowalik (xarthisius.kk at gmail.com)
+                Michael Kuhlen (mqk at astro.berkeley.edu)
+                Eve Lee (elee at cita.utoronto.ca)
+                Sam Leitner (sam.leitner at gmail.com)
+                Yuan Li (yuan at astro.columbia.edu)
+                Chris Malone (chris.m.malone at gmail.com)
+                Josh Maloney (joshua.moloney at colorado.edu)
+                Chris Moody (cemoody at ucsc.edu)
+                Andrew Myers (atmyers at astro.berkeley.edu)
+                Jill Naiman (jnaiman at ucolick.org)
+                Kaylea Nelson (kaylea.nelson at yale.edu)
+                Jeff Oishi (jsoishi at gmail.com)
+                Jean-Claude Passy (jcpassy at uvic.ca)
+                Mark Richardson (Mark.L.Richardson at asu.edu)
+                Thomas Robitaille (thomas.robitaille at gmail.com)
+                Anna Rosen (rosen at ucolick.org)
+                Douglas Rudd (drudd at uchicago.edu)
+                Anthony Scopatz (scopatz at gmail.com)
+                Noel Scudder (noel.scudder at stonybrook.edu)
+                Devin Silvia (devin.silvia at colorado.edu)
+                Sam Skillman (samskillman at gmail.com)
+                Stephen Skory (s at skory.us)
+                Britton Smith (brittonsmith at gmail.com)
+                Geoffrey So (gsiisg at gmail.com)
+                Casey Stark (caseywstark at gmail.com)
+                Elizabeth Tasker (tasker at astro1.sci.hokudai.ac.jp)
+                Stephanie Tonnesen (stonnes at gmail.com)
+                Matthew Turk (matthewturk at gmail.com)
+                Rich Wagner (rwagner at physics.ucsd.edu)
+                Andrew Wetzel (andrew.wetzel at yale.edu)
+                John Wise (jwise at physics.gatech.edu)
+                John ZuHone (jzuhone at gmail.com)
 
-We also include the Delaunay Triangulation module written by Robert Kern of
-Enthought, the cmdln.py module by Trent Mick, and the progressbar module by
+Several items included in the yt/extern directory were written by other
+individuals and may bear their own license, including the progressbar module by
 Nilton Volpato.  The PasteBin interface code (as well as the PasteBin itself)
-was written by the Pocoo collective (pocoo.org).  The RamsesRead++ library was
-developed by Oliver Hahn.  yt also includes a slightly-modified version of
-libconfig (http://www.hyperrealm.com/libconfig/) and an unmodified version of
-several routines from HEALpix (http://healpix.jpl.nasa.gov/).
-
-Large parts of development of yt were guided by discussions with Tom Abel, Ralf
-Kaehler, Mike Norman and Greg Bryan.
+was written by the Pocoo collective (pocoo.org).  
+developed by Oliver Hahn.  
 
 Thanks to everyone for all your contributions!

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f FUNDING
--- a/FUNDING
+++ /dev/null
@@ -1,35 +0,0 @@
-The development of yt has benefited from funding from many different sources
-and institutions.  Here is an incomplete list of these sources:
-
-  * NSF grant OCI-1048505
-  * NSF grant AST-0239709 
-  * NSF grant AST-0707474
-  * NSF grant AST-0708960
-  * NSF grant AST-0808184
-  * NSF grant AST-0807215 
-  * NSF grant AST-0807312
-  * NSF grant AST-0807075
-  * NSF grant AST-0908199
-  * NSF grant AST-0908553 
-  * NASA grant ATFP NNX08-AH26G
-  * NASA grant ATFP NNX09-AD80G
-  * NASA grant ATFP NNZ07-AG77G
-  * DOE Computational Science Graduate Fellowship under grant number DE-FG02-97ER25308
-
-Additionally, development of yt has benefited from the hospitality and hosting
-of the following institutions:
-
-  * Columbia University
-  * Harvard-Smithsonian Center for Astrophysics
-  * Institute for Advanced Study
-  * Kavli Institute for Particle Astrophysics and Cosmology
-  * Kavli Institute for Theoretical Physics
-  * Los Alamos National Lab
-  * Michigan State University
-  * Princeton University
-  * Stanford University
-  * University of California High-Performance Astro-Computing Center
-  * University of California at Berkeley
-  * University of California at San Diego
-  * University of California at Santa Cruz
-  * University of Colorado at Boulder

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f LICENSE.txt
--- a/LICENSE.txt
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year><name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year><name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f doc/how_to_develop_yt.txt
--- a/doc/how_to_develop_yt.txt
+++ b/doc/how_to_develop_yt.txt
@@ -25,7 +25,7 @@
 Licenses
 --------
 
-All code in yt should be under the GPL-3 (preferred) or a compatible license.
+All code in yt should be under the BSD 3-clause license.
 
 How To Get The Source Code
 --------------------------

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f setup.py
--- a/setup.py
+++ b/setup.py
@@ -248,7 +248,7 @@
         classifiers=["Development Status :: 5 - Production/Stable",
                      "Environment :: Console",
                      "Intended Audience :: Science/Research",
-                     "License :: OSI Approved :: GNU General Public License (GPL)",
+                     "License :: OSI Approved :: BSD License",
                      "Operating System :: MacOS :: MacOS X",
                      "Operating System :: POSIX :: AIX",
                      "Operating System :: POSIX :: Linux",
@@ -269,7 +269,7 @@
         author="Matthew J. Turk",
         author_email="matthewturk at gmail.com",
         url="http://yt-project.org/",
-        license="GPL-3",
+        license="BSD",
         configuration=configuration,
         zip_safe=False,
         data_files=REASON_FILES,

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/__init__.py
--- a/yt/__init__.py
+++ b/yt/__init__.py
@@ -60,27 +60,17 @@
 All broadly useful code that doesn't clearly fit in one of the other
 categories goes here.
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2007-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
 
 __version__ = "2.5-dev"
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/absorption_spectrum/__init__.py
--- a/yt/analysis_modules/absorption_spectrum/__init__.py
+++ b/yt/analysis_modules/absorption_spectrum/__init__.py
@@ -1,24 +1,14 @@
 """
 Import stuff for light cone generator.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/absorption_spectrum/absorption_line.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_line.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_line.py
@@ -1,27 +1,17 @@
 """
 Absorption line generating functions.
 
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: Michigan State University
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 numpy as np
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
@@ -1,27 +1,17 @@
 """
 AbsorptionSpectrum class and member functions.
 
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: Michigan State University
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 h5py
 import numpy as np

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/absorption_spectrum/api.py
--- a/yt/analysis_modules/absorption_spectrum/api.py
+++ b/yt/analysis_modules/absorption_spectrum/api.py
@@ -1,33 +1,18 @@
 """
 API for absorption_spectrum
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: UCSD
-Author: J.S. Oishi <jsoishi at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: MSU
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from .absorption_spectrum import \
     AbsorptionSpectrum
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/api.py
--- a/yt/analysis_modules/api.py
+++ b/yt/analysis_modules/api.py
@@ -1,33 +1,18 @@
 """
 API for yt.analysis_modules
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: UCSD
-Author: J.S. Oishi <jsoishi at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: MSU
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from .absorption_spectrum.api import \
     AbsorptionSpectrum
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/coordinate_transformation/api.py
--- a/yt/analysis_modules/coordinate_transformation/api.py
+++ b/yt/analysis_modules/coordinate_transformation/api.py
@@ -1,32 +1,17 @@
 """
 API for coordinate_transformation
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: UCSD
-Author: J.S. Oishi <jsoishi at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: MSU
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from .transforms import \
     spherical_regrid

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/coordinate_transformation/transforms.py
--- a/yt/analysis_modules/coordinate_transformation/transforms.py
+++ b/yt/analysis_modules/coordinate_transformation/transforms.py
@@ -1,29 +1,17 @@
 """
 Transformations between coordinate systems
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: JS Oishi <jsoishi at astro.berkeley.edu>
-Organization: UC Berkeley
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2007-2011 Matthew Turk, J. S. Oishi.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 numpy as np
 from yt.funcs import *
@@ -65,7 +53,7 @@
     new_grid['handled'] = np.zeros(new_grid['x'].shape, dtype='bool')
     for field in fields:
         new_grid[field] = np.zeros(new_grid['x'].shape, dtype='float64')
-    grid_order = np.argsort(data_source.gridLevels)
+    grid_order = np.argsort(data_source.grid_levels[:,0])
     ng = len(data_source._grids)
 
     for i,grid in enumerate(data_source._grids[grid_order][::-1]):

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/api.py
--- a/yt/analysis_modules/cosmological_observation/api.py
+++ b/yt/analysis_modules/cosmological_observation/api.py
@@ -1,29 +1,18 @@
 """
 API for cosmology analysis.
 
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: Michigan State University
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from .cosmology_splice import \
     CosmologySplice
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/cosmology_splice.py
--- a/yt/analysis_modules/cosmological_observation/cosmology_splice.py
+++ b/yt/analysis_modules/cosmological_observation/cosmology_splice.py
@@ -1,27 +1,17 @@
 """
 CosmologyTimeSeries class and member functions.
 
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: Michigan State University
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2012 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 numpy as np
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_cone/__init__.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/__init__.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/__init__.py
@@ -1,24 +1,14 @@
 """
 Import stuff for light cone generator.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_cone/api.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/api.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/api.py
@@ -1,33 +1,18 @@
 """
 API for lightcone
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: UCSD
-Author: J.S. Oishi <jsoishi at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: MSU
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from .light_cone import \
     LightCone
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_cone/common_n_volume.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/common_n_volume.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/common_n_volume.py
@@ -2,27 +2,17 @@
 Function to calculate volume in common between two n-cubes, with optional
 periodic boundary conditions.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 numpy as np
 

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_cone/halo_mask.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/halo_mask.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/halo_mask.py
@@ -1,27 +1,17 @@
 """
 Light cone halo mask functions.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 copy
 import h5py

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
@@ -1,27 +1,17 @@
 """
 LightCone class and member functions.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2012 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 copy
 import h5py

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_cone/light_cone_projection.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/light_cone_projection.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/light_cone_projection.py
@@ -1,27 +1,17 @@
 """
 Create randomly centered, tiled projections to be used in light cones.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 numpy as np
 import copy

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_cone/unique_solution.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/unique_solution.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/unique_solution.py
@@ -1,27 +1,17 @@
 """
 Functions to generate unique light cone solutions.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 copy
 import numpy as np

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_ray/api.py
--- a/yt/analysis_modules/cosmological_observation/light_ray/api.py
+++ b/yt/analysis_modules/cosmological_observation/light_ray/api.py
@@ -1,32 +1,17 @@
 """
 API for light_ray
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: UCSD
-Author: J.S. Oishi <jsoishi at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: MSU
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from .light_ray import \
     LightRay

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
--- a/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
+++ b/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
@@ -1,27 +1,17 @@
 """
 LightRay class and member functions.
 
-Author: Britton Smith <brittons at origins.colorado.edu>
-Affiliation: CASA/University of CO, Boulder
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2012 Britton Smith.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 copy
 import h5py

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/halo_finding/api.py
--- a/yt/analysis_modules/halo_finding/api.py
+++ b/yt/analysis_modules/halo_finding/api.py
@@ -1,33 +1,18 @@
 """
 API for halo_finding
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: UCSD
-Author: J.S. Oishi <jsoishi at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: Britton Smith <brittonsmith at gmail.com>
-Affiliation: MSU
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2010-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from halo_objects import \
     Halo, \
     HOPHalo, \

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/halo_finding/fof/EnzoFOF.c
--- a/yt/analysis_modules/halo_finding/fof/EnzoFOF.c
+++ b/yt/analysis_modules/halo_finding/fof/EnzoFOF.c
@@ -1,22 +1,10 @@
-/************************************************************************
-* Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
-*
-* This file is part of yt.
-*
-* yt is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*
-************************************************************************/
+/*******************************************************************************
+# 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.
+*******************************************************************************/
 
 //
 // EnzoFOF

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/halo_finding/halo_objects.py
--- a/yt/analysis_modules/halo_finding/halo_objects.py
+++ b/yt/analysis_modules/halo_finding/halo_objects.py
@@ -1,31 +1,17 @@
 """
 HOP-output data handling
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: KIPAC/SLAC/Stanford
-Author: Stephen Skory <s at skory.us>
-Affiliation: UCSD Physics/CASS
-Author: Geoffrey So <gsiisg at gmail.com> (Ellipsoidal functions)
-Affiliation: UCSD Physics/CASS
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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 gc
 import h5py

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/halo_finding/hop/EnzoHop.c
--- a/yt/analysis_modules/halo_finding/hop/EnzoHop.c
+++ b/yt/analysis_modules/halo_finding/hop/EnzoHop.c
@@ -1,22 +1,10 @@
-/************************************************************************
-* Copyright (C) 2008-2011 Matthew Turk.  All Rights Reserved.
-*
-* This file is part of yt.
-*
-* yt is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*
-************************************************************************/
+/*******************************************************************************
+# 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.
+*******************************************************************************/
 
 //
 // EnzoHop

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/halo_finding/parallel_hop/parallel_hop_interface.py
--- a/yt/analysis_modules/halo_finding/parallel_hop/parallel_hop_interface.py
+++ b/yt/analysis_modules/halo_finding/parallel_hop/parallel_hop_interface.py
@@ -1,27 +1,17 @@
 """
 A implementation of the HOP algorithm that runs in parallel.
 
-Author: Stephen Skory <s at skory.us>
-Affiliation: UCSD/CASS
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2008-2011 Stephen Skory.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
 
 from collections import defaultdict
 import itertools, sys

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/halo_finding/rockstar/api.py
--- a/yt/analysis_modules/halo_finding/rockstar/api.py
+++ b/yt/analysis_modules/halo_finding/rockstar/api.py
@@ -1,27 +1,16 @@
 """
 API for Rockstar halo finding
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: Columbia
-Homepage: http://yt-project.org/
-License:
-  Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
-
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
 from .rockstar import RockstarHaloFinder

diff -r 2735487db600876a6073fb2217a1b80df6f81f4e -r b956f413477216cc21249861fb8f8d7662140e0f yt/analysis_modules/halo_finding/rockstar/rockstar.py
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar.py
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar.py
@@ -1,27 +1,17 @@
 """
 Operations to get Rockstar loaded up
 
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: Columbia University
-Homepage: http://yt.enzotools.org/
-License:
-  Copyright (C) 2011 Matthew Turk.  All Rights Reserved.
 
-  This file is part of yt.
 
-  yt is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3 of the License, or
-  (at your option) any later version.
+"""
 
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
 
 from yt.mods import *
 from yt.utilities.parallel_tools.parallel_analysis_interface import \

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

https://bitbucket.org/yt_analysis/yt/commits/7e151eeaaad8/
Changeset:   7e151eeaaad8
Branch:      yt
User:        chummels
Date:        2013-10-04 02:42:54
Summary:     Updating the shear definitions to work in all contexts.
Affected #:  1 file

diff -r b956f413477216cc21249861fb8f8d7662140e0f -r 7e151eeaaad8e8b781d89cdd067e908fc291dd83 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -635,65 +635,6 @@
 add_field("AbsDivV", function=_AbsDivV,
           units=r"\rm{s}^{-1}")
 
-#     Shear prescription taken from Enzo source:
-#           enzo-dev/src/enzo/Grid_FlagCellsToBeRefinedByShear.C
-#
-#       For shear: [(du/dy)^2 + (dv/dx)^2 + (dw/dy)^2 +
-#                   (du/dz)^2 + (dv/dz)^2 + (dw/dx)^2  ] * (dx/c_s)^2
-#       where:  du/dy = [u(j-1) - u(j+1)]/[2dy],
-#       Shear is defined relative to the sound speed (i.e. mach)
-
-def _Shear(field, data):
-    # We need to set up stencils
-    if data.pf["HydroMethod"] == 2: # Zeus -- velocities are face centered
-        sl_left = slice(None,-2,None)
-        sl_right = slice(1,-1,None)
-        div_fac = 1.0
-    else: # PPM -- velocities are cell centered
-        sl_left = slice(None,-2,None)
-        sl_right = slice(2,None,None)
-        div_fac = 2.0
-    # only works for 2d and 3d data:
-    # Just get f to be zeros array of the right dimension as base
-    f = np.zeros(data["x-velocity"][2:,2:,2:].shape, dtype='float64')
-    if data.pf.dimensionality > 1:
-        # first the dx direction
-        ds = div_fac * data['dx'].flat[0]
-        f += ((data["y-velocity"][1:-1,sl_right,1:-1]/ds) - 
-              (data["y-velocity"][1:-1,sl_left ,1:-1]/ds))**2
-        ds = div_fac * data['dy'].flat[0]
-        f += ((data["x-velocity"][sl_right,1:-1,1:-1]/ds) - 
-              (data["x-velocity"][sl_left ,1:-1,1:-1]/ds))**2
-
-    # if 3D sim, take into account additional shear directions
-    if data.pf.dimensionality > 2:
-        ds = div_fac * data['dx'].flat[0]
-        f += ((data["z-velocity"][1:-1,1:-1,sl_right]/ds) - 
-              (data["z-velocity"][1:-1,1:-1,sl_left ]/ds))**2
-        ds = div_fac * data['dy'].flat[0]
-        f += ((data["z-velocity"][1:-1,1:-1,sl_right]/ds) - 
-              (data["z-velocity"][1:-1,1:-1,sl_left ]/ds))**2
-        # lastly the dz direction
-        ds = div_fac * data['dz'].flat[0]
-        f += ((data["x-velocity"][sl_right,1:-1,1:-1]/ds) - 
-              (data["x-velocity"][sl_left ,1:-1,1:-1]/ds))**2
-        f += ((data["y-velocity"][1:-1,sl_right,1:-1]/ds) - 
-              (data["y-velocity"][1:-1,sl_left ,1:-1]/ds))**2
-    if data.pf.dimensionality <= 1:
-        raise NotImplementedError("Shear field undefined for 1D datasets")
-
-    # Calc the sound speed (make sure it has the right dimension)
-    c_s = (data["SoundSpeed"][1:-1,1:-1,1:-1])**2
-    shear = (f / c_s)**0.5
-    new_field = np.zeros(data["x-velocity"].shape, dtype='float64')
-    new_field[1:-1,1:-1,1:-1] = shear
-    return new_field
-
-add_field("Shear", function=_Shear,
-          validators=[ValidateSpatial(ghost_zones=1,
-          fields=["x-velocity","y-velocity","z-velocity","SoundSpeed"])],
-          units=r"\rm{Mach}", take_log=False)
-
 def _Contours(field, data):
     return -np.ones_like(data["Ones"])
 add_field("Contours", validators=[ValidateSpatial(0)], take_log=False,
@@ -1183,6 +1124,120 @@
           units=r"\rm{s}^{-2}",
           convert_function=_convertVorticitySquared)
 
+def _Shear(field, data):
+    """
+    Shear is defined as [(dvx/dy + dvy/dx)^2 + (dvz/dy + dvy/dz)^2 +
+                         (dvx/dz + dvz/dx)^2 ]^(0.5)
+    where dvx/dy = [vx(j-1) - vx(j+1)]/[2dy]
+    and is in units of s^(-1)
+    (it's just like vorticity except add the derivative pairs instead
+     of subtracting them)
+    """
+    # We need to set up stencils
+    if data.pf["HydroMethod"] == 2:
+        sl_left = slice(None,-2,None)
+        sl_right = slice(1,-1,None)
+        div_fac = 1.0
+    else:
+        sl_left = slice(None,-2,None)
+        sl_right = slice(2,None,None)
+        div_fac = 2.0
+    new_field = np.zeros(data["x-velocity"].shape)
+    if data.pf.dimensionality > 1:
+        dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
+                data["y-velocity"][sl_left,1:-1,1:-1]) \
+                / (div_fac*data["dx"].flat[0])
+        dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
+                data["x-velocity"][1:-1,sl_left,1:-1]) \
+                / (div_fac*data["dy"].flat[0])
+        new_field[1:-1,1:-1,1:-1] += (dvydx + dvxdy)**2.0
+        del dvydx, dvxdy
+    if data.pf.dimensionality > 2:
+        dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
+                data["z-velocity"][1:-1,sl_left,1:-1]) \
+                / (div_fac*data["dy"].flat[0])
+        dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
+                data["y-velocity"][1:-1,1:-1,sl_left]) \
+                / (div_fac*data["dz"].flat[0])
+        new_field[1:-1,1:-1,1:-1] += (dvzdy + dvydz)**2.0
+        del dvzdy, dvydz
+        dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
+                data["x-velocity"][1:-1,1:-1,sl_left]) \
+                / (div_fac*data["dz"].flat[0])
+        dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
+                data["z-velocity"][sl_left,1:-1,1:-1]) \
+                / (div_fac*data["dx"].flat[0])
+        new_field[1:-1,1:-1,1:-1] += (dvxdz + dvzdx)**2.0
+        del dvxdz, dvzdx
+    new_field = new_field**0.5
+    new_field = np.abs(new_field)
+    return new_field
+def _convertShear(data):
+    return data.convert("cm")**-1.0
+add_field("Shear", function=_Shear,
+          validators=[ValidateSpatial(1,
+              ["x-velocity","y-velocity","z-velocity"])],
+          units=r"\rm{s}^{-1}",
+          convert_function=_convertShear, take_log=False)
+
+def _ShearMach(field, data):
+    """
+    Dimensionless Shear (ShearMach) is defined nearly the same as shear, 
+    except that it is scaled by the local dx/dy/dz and the local sound speed.
+    So it results in a unitless quantity that is effectively measuring 
+    shear in mach number.  
+
+    In order to avoid discontinuities created by multiplying by dx/dy/dz at
+    grid refinement boundaries, we also multiply by 2**GridLevel.
+
+    Shear (Mach) = [(dvx + dvy)^2 + (dvz + dvy)^2 +
+                    (dvx + dvz)^2  ]^(0.5) / c_sound
+    """
+    # We need to set up stencils
+    if data.pf["HydroMethod"] == 2:
+        sl_left = slice(None,-2,None)
+        sl_right = slice(1,-1,None)
+        div_fac = 1.0
+    else:
+        sl_left = slice(None,-2,None)
+        sl_right = slice(2,None,None)
+        div_fac = 2.0
+    new_field = np.zeros(data["x-velocity"].shape)
+    if data.pf.dimensionality > 1:
+        dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
+                data["y-velocity"][sl_left,1:-1,1:-1]) \
+                / (div_fac)
+        dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
+                data["x-velocity"][1:-1,sl_left,1:-1]) \
+                / (div_fac)
+        new_field[1:-1,1:-1,1:-1] += (dvydx + dvxdy)**2.0
+        del dvydx, dvxdy
+    if data.pf.dimensionality > 2:
+        dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
+                data["z-velocity"][1:-1,sl_left,1:-1]) \
+                / (div_fac)
+        dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
+                data["y-velocity"][1:-1,1:-1,sl_left]) \
+                / (div_fac)
+        new_field[1:-1,1:-1,1:-1] += (dvzdy + dvydz)**2.0
+        del dvzdy, dvydz
+        dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
+                data["x-velocity"][1:-1,1:-1,sl_left]) \
+                / (div_fac)
+        dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
+                data["z-velocity"][sl_left,1:-1,1:-1]) \
+                / (div_fac)
+        new_field[1:-1,1:-1,1:-1] += (dvxdz + dvzdx)**2.0
+        del dvxdz, dvzdx
+    new_field *= ((2.0**data.level)/data["SoundSpeed"])**2.0
+    new_field = new_field**0.5
+    new_field = np.abs(new_field)
+    return new_field
+add_field("ShearMach", function=_ShearMach,
+          validators=[ValidateSpatial(1,
+              ["x-velocity","y-velocity","z-velocity","SoundSpeed"])],
+          units=r"\rm{Mach}",take_log=False)
+
 def _gradPressureX(field, data):
     # We need to set up stencils
     if data.pf["HydroMethod"] == 2:


https://bitbucket.org/yt_analysis/yt/commits/e9a293ee3209/
Changeset:   e9a293ee3209
Branch:      yt
User:        MatthewTurk
Date:        2013-10-22 15:42:55
Summary:     Fixing Level/level.
Affected #:  1 file

diff -r 7e151eeaaad8e8b781d89cdd067e908fc291dd83 -r e9a293ee32092b2c19732f886a0f94ba9a364e22 yt/data_objects/field_info_container.py
--- a/yt/data_objects/field_info_container.py
+++ b/yt/data_objects/field_info_container.py
@@ -190,7 +190,7 @@
         return "(%s)" % (self.missing_parameters)
 
 class FieldDetector(defaultdict):
-    Level = 1
+    Level = level = 1
     NumberOfParticles = 1
     _read_exception = None
     _id_offset = 0


https://bitbucket.org/yt_analysis/yt/commits/30d1bf8d7eff/
Changeset:   30d1bf8d7eff
Branch:      yt
User:        MatthewTurk
Date:        2013-10-22 15:43:08
Summary:     Merging from tip.
Affected #:  45 files

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 CITATION
--- /dev/null
+++ b/CITATION
@@ -0,0 +1,31 @@
+To cite yt in publications, please use:
+
+Turk, M. J., Smith, B. D., Oishi, J. S., et al. 2011, ApJS, 192, 9
+
+In the body of the text, please add a footnote to the yt webpage:
+
+http://yt-project.org/
+
+For LaTex and BibTex users:
+
+\bibitem[Turk et al.(2011)]{2011ApJS..192....9T} Turk, M.~J., Smith, B.~D.,
+Oishi, J.~S., et al.\ 2011, \apjs, 192, 9
+
+ at ARTICLE{2011ApJS..192....9T,
+   author = {{Turk}, M.~J. and {Smith}, B.~D. and {Oishi}, J.~S. and {Skory}, S. and
+{Skillman}, S.~W. and {Abel}, T. and {Norman}, M.~L.},
+    title = "{yt: A Multi-code Analysis Toolkit for Astrophysical Simulation Data}",
+  journal = {\apjs},
+archivePrefix = "arXiv",
+   eprint = {1011.3514},
+ primaryClass = "astro-ph.IM",
+ keywords = {cosmology: theory, methods: data analysis, methods: numerical},
+     year = 2011,
+    month = jan,
+   volume = 192,
+      eid = {9},
+    pages = {9},
+      doi = {10.1088/0067-0049/192/1/9},
+   adsurl = {http://adsabs.harvard.edu/abs/2011ApJS..192....9T},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 doc/get_yt.sh
--- /dev/null
+++ b/doc/get_yt.sh
@@ -0,0 +1,358 @@
+#
+# Hi there!  Welcome to the yt installation script.
+#
+# This script is designed to create a fully isolated Python installation
+# with the dependencies you need to run yt.
+#
+# This script is based on Conda, a distribution mechanism from Continuum
+# Analytics.  The process is as follows:
+#
+#  1. Download the appropriate Conda installation package
+#  2. Install Conda into the specified directory
+#  3. Install yt-specific dependencies
+#  4. Install yt
+#
+# There are a few options listed below, but by default, this will install
+# everything.  At the end, it will tell you what to do to use yt.
+#
+# By default this will install yt from source.
+#
+# If you experience problems, please visit the Help section at 
+# http://yt-project.org.
+#
+DEST_SUFFIX="yt-conda"
+DEST_DIR="`pwd`/${DEST_SUFFIX/ /}"   # Installation location
+BRANCH="yt" # This is the branch to which we will forcibly update.
+INST_YT_SOURCE=1 # Do we do a source install of yt?
+
+##################################################################
+#                                                                #
+# You will likely not have to modify anything below this region. #
+#                                                                #
+##################################################################
+
+LOG_FILE="`pwd`/yt_install.log"
+
+# Here is the idiom for redirecting to the log file:
+# ( SOMECOMMAND 2>&1 ) 1>> ${LOG_FILE} || do_exit
+
+MINICONDA_URLBASE="http://repo.continuum.io/miniconda"
+MINICONDA_VERSION="1.9.1"
+YT_RECIPE_REPO="https://bitbucket.org/yt_analysis/yt_conda/raw/default"
+
+function do_exit
+{
+    echo "********************************************"
+    echo "        FAILURE REPORT:"
+    echo "********************************************"
+    echo
+    tail -n 10 ${LOG_FILE}
+    echo
+    echo "********************************************"
+    echo "********************************************"
+    echo "Failure.  Check ${LOG_FILE}.  The last 10 lines are above."
+    exit 1
+}
+
+function log_cmd
+{
+    echo "EXECUTING:" >> ${LOG_FILE}
+    echo "  $*" >> ${LOG_FILE}
+    ( $* 2>&1 ) 1>> ${LOG_FILE} || do_exit
+}
+
+function get_ytproject
+{
+    [ -e $1 ] && return
+    echo "Downloading $1 from yt-project.org"
+    ${GETFILE} "http://yt-project.org/dependencies/$1" || do_exit
+    ( ${SHASUM} -c $1.sha512 2>&1 ) 1>> ${LOG_FILE} || do_exit
+}
+
+function get_ytdata
+{
+    echo "Downloading $1 from yt-project.org"
+    [ -e $1 ] && return
+    ${GETFILE} "http://yt-project.org/data/$1" || do_exit
+    ( ${SHASUM} -c $1.sha512 2>&1 ) 1>> ${LOG_FILE} || do_exit
+}
+
+function get_ytrecipe {
+    RDIR=${DEST_DIR}/src/yt-recipes/$1
+    mkdir -p ${RDIR}
+    pushd ${RDIR}
+    log_cmd ${GETFILE} ${YT_RECIPE_REPO}/$1/meta.yaml
+    log_cmd ${GETFILE} ${YT_RECIPE_REPO}/$1/build.sh
+    NEW_PKG=`conda build --output ${RDIR}`
+    log_cmd conda build --no-binstar-upload ${RDIR}
+    log_cmd conda install ${NEW_PKG}
+    popd
+}
+
+
+echo
+echo
+echo "========================================================================"
+echo
+echo "Hi there!  This is the yt installation script.  We're going to download"
+echo "some stuff and install it to create a self-contained, isolated"
+echo "environment for yt to run within."
+echo
+echo "This will install Miniconda from Continuum Analytics, the necessary"
+echo "packages to run yt, and create a self-contained environment for you to"
+echo "use yt.  Additionally, Conda itself provides the ability to install"
+echo "many other packages that can be used for other purposes."
+echo
+MYOS=`uname -s`       # A guess at the OS
+if [ "${MYOS##Darwin}" != "${MYOS}" ]
+then
+  echo "Looks like you're running on Mac OSX."
+  echo
+  echo "NOTE: you must have the Xcode command line tools installed."
+  echo
+  echo "The instructions for obtaining these tools varies according"
+  echo "to your exact OS version.  On older versions of OS X, you"
+  echo "must register for an account on the apple developer tools"
+  echo "website: https://developer.apple.com/downloads to obtain the"
+  echo "download link."
+  echo
+  echo "We have gathered some additional instructions for each"
+  echo "version of OS X below. If you have trouble installing yt"
+  echo "after following these instructions, don't hesitate to contact"
+  echo "the yt user's e-mail list."
+  echo
+  echo "You can see which version of OSX you are running by clicking"
+  echo "'About This Mac' in the apple menu on the left hand side of"
+  echo "menu bar.  We're assuming that you've installed all operating"
+  echo "system updates; if you have an older version, we suggest"
+  echo "running software update and installing all available updates."
+  echo
+  echo "OS X 10.5.8: search for and download Xcode 3.1.4 from the"
+  echo "Apple developer tools website."
+  echo
+  echo "OS X 10.6.8: search for and download Xcode 3.2 from the Apple"
+  echo "developer tools website.  You can either download the"
+  echo "Xcode 3.2.2 Developer Tools package (744 MB) and then use"
+  echo "Software Update to update to XCode 3.2.6 or"
+  echo "alternatively, you can download the Xcode 3.2.6/iOS SDK"
+  echo "bundle (4.1 GB)."
+  echo
+  echo "OS X 10.7.5: download Xcode 4.2 from the mac app store"
+  echo "(search for Xcode)."
+  echo "Alternatively, download the Xcode command line tools from"
+  echo "the Apple developer tools website."
+  echo
+  echo "OS X 10.8.2: download Xcode 4.6.1 from the mac app store."
+  echo "(search for Xcode)."
+  echo "Additionally, you will have to manually install the Xcode"
+  echo "command line tools, see:"
+  echo "http://stackoverflow.com/questions/9353444"
+  echo "Alternatively, download the Xcode command line tools from"
+  echo "the Apple developer tools website."
+  echo
+  echo "NOTE: It's possible that the installation will fail, if so,"
+  echo "please set the following environment variables, remove any"
+  echo "broken installation tree, and re-run this script verbatim."
+  echo
+  echo "$ export CC=gcc"
+  echo "$ export CXX=g++"
+  echo
+  MINICONDA_OS="MacOSX-x86_64"
+fi
+if [ "${MYOS##Linux}" != "${MYOS}" ]
+then
+  echo "Looks like you're on Linux."
+  echo
+  echo "Please make sure you have the developer tools for your OS installed."
+  echo
+  if [ -f /etc/SuSE-release ] && [ `grep --count SUSE /etc/SuSE-release` -gt 0 ]
+  then
+    echo "Looks like you're on an OpenSUSE-compatible machine."
+    echo
+    echo "You need to have these packages installed:"
+    echo
+    echo "  * devel_C_C++"
+    echo "  * libopenssl-devel"
+    echo "  * libuuid-devel"
+    echo "  * zip"
+    echo "  * gcc-c++"
+    echo "  * chrpath"
+    echo
+    echo "You can accomplish this by executing:"
+    echo
+    echo "$ sudo zypper install -t pattern devel_C_C++"
+    echo "$ sudo zypper install gcc-c++ libopenssl-devel libuuid-devel zip"
+    echo "$ sudo zypper install chrpath"
+  fi
+  if [ -f /etc/lsb-release ] && [ `grep --count buntu /etc/lsb-release` -gt 0 ]
+  then
+    echo "Looks like you're on an Ubuntu-compatible machine."
+    echo
+    echo "You need to have these packages installed:"
+    echo
+    echo "  * libssl-dev"
+    echo "  * build-essential"
+    echo "  * libncurses5"
+    echo "  * libncurses5-dev"
+    echo "  * zip"
+    echo "  * uuid-dev"
+    echo "  * chrpath"
+    echo
+    echo "You can accomplish this by executing:"
+    echo
+    echo "$ sudo apt-get install libssl-dev build-essential libncurses5 libncurses5-dev zip uuid-dev chrpath"
+    echo
+  fi
+  echo
+  echo "If you are running on a supercomputer or other module-enabled"
+  echo "system, please make sure that the GNU module has been loaded."
+  echo
+  if [ "${MYOS##x86_64}" != "${MYOS}" ]
+  then
+    MINICONDA_OS="Linux-x86_64"
+  elif [ "${MYOS##i386}" != "${MYOS}" ]
+  then
+    MINICONDA_OS="Linux-x86"
+  else
+    echo "Not sure which type of Linux you're on.  Going with x86_64."
+    MINICONDA_OS="Linux-x86_64"
+  fi
+fi
+echo
+echo "If you'd rather not continue, hit Ctrl-C."
+echo
+echo "========================================================================"
+echo
+read -p "[hit enter] "
+echo
+echo "Awesome!  Here we go."
+echo
+
+MINICONDA_PKG=Miniconda-${MINICONDA_VERSION}-${MINICONDA_OS}.sh
+
+if type -P wget &>/dev/null
+then
+    echo "Using wget"
+    export GETFILE="wget -nv"
+else
+    echo "Using curl"
+    export GETFILE="curl -sSO"
+fi
+
+echo
+echo "Downloading ${MINICONDA_URLBASE}/${MINICONDA_PKG}"
+echo "Downloading ${MINICONDA_URLBASE}/${MINICONDA_PKG}" >> ${LOG_FILE}
+echo
+
+${GETFILE} ${MINICONDA_URLBASE}/${MINICONDA_PKG} || do_exit
+
+echo "Installing the Miniconda python environment."
+
+log_cmd bash ./${MINICONDA_PKG} -b -p $DEST_DIR
+
+# I don't think we need OR want this anymore:
+#export LD_LIBRARY_PATH=${DEST_DIR}/lib:$LD_LIBRARY_PATH
+
+# This we *do* need.
+export PATH=${DEST_DIR}/bin:$PATH
+
+echo "Installing the necessary packages for yt."
+echo "This may take a while, but don't worry.  yt loves you."
+
+declare -a YT_DEPS
+YT_DEPS+=('python')
+YT_DEPS+=('distribute')
+YT_DEPS+=('libpng')
+YT_DEPS+=('freetype')
+YT_DEPS+=('hdf5')
+YT_DEPS+=('numpy')
+YT_DEPS+=('pygments')
+YT_DEPS+=('jinja2')
+YT_DEPS+=('tornado')
+YT_DEPS+=('pyzmq')
+YT_DEPS+=('ipython')
+YT_DEPS+=('sphinx')
+YT_DEPS+=('h5py')
+YT_DEPS+=('matplotlib')
+YT_DEPS+=('cython')
+
+# Here is our dependency list for yt
+log_cmd conda config --system --add channels http://repo.continuum.io/pkgs/free
+log_cmd conda config --system --add channels http://repo.continuum.io/pkgs/dev
+log_cmd conda config --system --add channels http://repo.continuum.io/pkgs/gpl
+log_cmd conda update --yes conda
+
+echo "Current dependencies: ${YT_DEPS[@]}"
+log_cmd echo "DEPENDENCIES" ${YT_DEPS[@]}
+log_cmd conda install --yes ${YT_DEPS[@]}
+
+echo "Installing mercurial."
+get_ytrecipe mercurial
+
+if [ $INST_YT_SOURCE -eq 0 ]
+then
+  echo "Installing yt as a package."
+  get_ytrecipe yt
+else
+  # We do a source install.
+  YT_DIR="${DEST_DIR}/src/yt-hg"
+  export PNG_DIR=${DEST_DIR}
+  export FTYPE_DIR=${DEST_DIR}
+  export HDF5_DIR=${DEST_DIR}
+  log_cmd hg clone -r ${BRANCH} https://bitbucket.org/yt_analysis/yt ${YT_DIR}
+  pushd ${YT_DIR}
+  echo $DEST_DIR > hdf5.cfg
+  log_cmd python setup.py develop
+  popd
+  log_cmd cp ${YT_DIR}/doc/activate ${DEST_DIR}/bin/activate 
+  log_cmd sed -i.bak -e "s,__YT_DIR__,${DEST_DIR}," ${DEST_DIR}/bin/activate
+  log_cmd cp ${YT_DIR}/doc/activate.csh ${DEST_DIR}/bin/activate.csh
+  log_cmd sed -i.bak -e "s,__YT_DIR__,${DEST_DIR}," ${DEST_DIR}/bin/activate.csh
+fi
+
+echo
+echo
+echo "========================================================================"
+echo
+echo "yt and the Conda system are now installed in $DEST_DIR ."
+echo
+if [ $INST_YT_SOURCE -eq 0 ]
+then
+  echo "You must now modify your PATH variable by prepending:"
+  echo 
+  echo "   $DEST_DIR/bin"
+  echo
+  echo "For example, if you use bash, place something like this at the end"
+  echo "of your ~/.bashrc :"
+  echo
+  echo "   export PATH=$DEST_DIR/bin:$PATH"
+else
+  echo "To run from this new installation, use the activate script for this "
+  echo "environment."
+  echo
+  echo "    $ source $DEST_DIR/bin/activate"
+  echo
+  echo "This modifies the environment variables YT_DEST, PATH, PYTHONPATH, and"
+  echo "LD_LIBRARY_PATH to match your new yt install.  If you use csh, just"
+  echo "append .csh to the above."
+fi
+echo
+echo "To get started with yt, check out the orientation:"
+echo
+echo "    http://yt-project.org/doc/orientation/"
+echo
+echo "or just activate your environment and run 'yt serve' to bring up the"
+echo "yt GUI."
+echo
+echo "For support, see the website and join the mailing list:"
+echo
+echo "    http://yt-project.org/"
+echo "    http://yt-project.org/data/      (Sample data)"
+echo "    http://yt-project.org/doc/       (Docs)"
+echo
+echo "    http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
+echo
+echo "========================================================================"
+echo
+echo "Oh, look at me, still talking when there's science to do!"
+echo "Good luck, and email the user list if you run into any problems."

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 doc/install_script.sh
--- a/doc/install_script.sh
+++ b/doc/install_script.sh
@@ -918,6 +918,8 @@
 do_setup_py $SYMPY
 [ $INST_PYX -eq 1 ] && do_setup_py $PYX
 
+( ${DEST_DIR}/bin/pip install jinja2 2>&1 ) 1>> ${LOG_FILE}
+
 # Now we build Rockstar and set its environment variable.
 if [ $INST_ROCKSTAR -eq 1 ]
 then

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
@@ -86,6 +86,10 @@
     #Empty fit without any lines
     yFit = na.ones(len(fluxData))
 
+    #Force the first and last flux pixel to be 1 to prevent OOB
+    fluxData[0]=1
+    fluxData[-1]=1
+
     #Find all regions where lines/groups of lines are present
     cBounds = _find_complexes(x, fluxData, fitLim=fitLim,
             complexLim=complexLim, minLength=minLength,
@@ -120,9 +124,10 @@
                     z,fitLim,minError*(b[2]-b[1]),speciesDict)
 
             #Check existence of partner lines if applicable
-            newLinesP = _remove_unaccepted_partners(newLinesP, x, fluxData, 
-                    b, minError*(b[2]-b[1]),
-                    x0, xRes, speciesDict)
+            if len(speciesDict['wavelength']) != 1:
+                newLinesP = _remove_unaccepted_partners(newLinesP, x, fluxData, 
+                        b, minError*(b[2]-b[1]),
+                        x0, xRes, speciesDict)
 
             #If flagged as a bad fit, species is lyman alpha,
             #   and it may be a saturated line, use special tools
@@ -548,6 +553,10 @@
         #Index of the redshifted wavelength
         indexRedWl = (redWl-x0)/xRes
 
+        #Check to see if even in flux range
+        if indexRedWl > len(y):
+            return False
+
         #Check if surpasses minimum absorption bound
         if y[int(indexRedWl)]>fluxMin:
             return False

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/api.py
--- a/yt/analysis_modules/api.py
+++ b/yt/analysis_modules/api.py
@@ -103,5 +103,8 @@
     TwoPointFunctions, \
     FcnSet
 
+from .sunyaev_zeldovich.api import SZProjection
+
 from .radmc3d_export.api import \
     RadMC3DWriter
+

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/setup.py
--- a/yt/analysis_modules/setup.py
+++ b/yt/analysis_modules/setup.py
@@ -21,4 +21,5 @@
     config.add_subpackage("star_analysis")
     config.add_subpackage("two_point_functions")
     config.add_subpackage("radmc3d_export")
+    config.add_subpackage("sunyaev_zeldovich")    
     return config

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/sunyaev_zeldovich/api.py
--- /dev/null
+++ b/yt/analysis_modules/sunyaev_zeldovich/api.py
@@ -0,0 +1,12 @@
+"""
+API for sunyaev_zeldovich
+"""
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
+from projection import SZProjection

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/sunyaev_zeldovich/projection.py
--- /dev/null
+++ b/yt/analysis_modules/sunyaev_zeldovich/projection.py
@@ -0,0 +1,349 @@
+"""
+Projection class for the Sunyaev-Zeldovich effect. Requires SZpack (at least
+version 1.1.1) to be downloaded and installed:
+
+http://www.chluba.de/SZpack/
+
+For details on the computations involved please refer to the following references:
+
+Chluba, Nagai, Sazonov, Nelson, MNRAS, 2012, arXiv:1205.5778
+Chluba, Switzer, Nagai, Nelson, MNRAS, 2012, arXiv:1211.3206 
+"""
+
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
+from yt.utilities.physical_constants import sigma_thompson, clight, hcgs, kboltz, mh, Tcmb
+from yt.data_objects.image_array import ImageArray
+from yt.data_objects.field_info_container import add_field
+from yt.funcs import fix_axis, mylog, iterable, get_pbar
+from yt.utilities.definitions import inv_axis_names
+from yt.visualization.image_writer import write_fits, write_projection
+from yt.visualization.volume_rendering.camera import off_axis_projection
+from yt.utilities.parallel_tools.parallel_analysis_interface import \
+     communication_system, parallel_root_only
+import numpy as np
+
+I0 = 2*(kboltz*Tcmb)**3/((hcgs*clight)**2)*1.0e17
+        
+try:
+    import SZpack
+except ImportError:
+    pass
+
+vlist = "xyz"
+
+def _t_squared(field, data):
+    return data["Density"]*data["TempkeV"]*data["TempkeV"]
+add_field("TSquared", function=_t_squared)
+
+def _beta_perp_squared(field, data):
+    return data["Density"]*data["VelocityMagnitude"]**2/clight/clight - data["BetaParSquared"]
+add_field("BetaPerpSquared", function=_beta_perp_squared)
+
+def _beta_par_squared(field, data):
+    return data["BetaPar"]**2/data["Density"]
+add_field("BetaParSquared", function=_beta_par_squared)
+
+def _t_beta_par(field, data):
+    return data["TempkeV"]*data["BetaPar"]
+add_field("TBetaPar", function=_t_beta_par)
+
+def _t_sz(field, data):
+    return data["Density"]*data["TempkeV"]
+add_field("TeSZ", function=_t_sz)
+
+class SZProjection(object):
+    r""" Initialize a SZProjection object.
+
+    Parameters
+    ----------
+    pf : parameter_file
+        The parameter file.
+    freqs : array_like
+        The frequencies (in GHz) at which to compute the SZ spectral distortion.
+    mue : float, optional
+        Mean molecular weight for determining the electron number density.
+    high_order : boolean, optional
+        Should we calculate high-order moments of velocity and temperature?
+
+    Examples
+    --------
+    >>> freqs = [90., 180., 240.]
+    >>> szprj = SZProjection(pf, freqs, high_order=True)
+    """
+    def __init__(self, pf, freqs, mue=1.143, high_order=False):
+            
+        self.pf = pf
+        self.num_freqs = len(freqs)
+        self.high_order = high_order
+        self.freqs = np.array(freqs)
+        self.mueinv = 1./mue
+        self.xinit = hcgs*self.freqs*1.0e9/(kboltz*Tcmb)
+        self.freq_fields = ["%d_GHz" % (int(freq)) for freq in freqs]
+        self.data = {}
+
+        self.units = {}
+        self.units["TeSZ"] = r"$\mathrm{keV}$"
+        self.units["Tau"] = None
+
+        self.display_names = {}
+        self.display_names["TeSZ"] = r"$\mathrm{T_e}$"
+        self.display_names["Tau"] = r"$\mathrm{\tau}$"
+
+        for f, field in zip(self.freqs, self.freq_fields):
+            self.units[field] = r"$\mathrm{MJy\ sr^{-1}}$"
+            self.display_names[field] = r"$\mathrm{\Delta{I}_{%d\ GHz}}$" % (int(f))
+            
+    def on_axis(self, axis, center="c", width=(1, "unitary"), nx=800, source=None):
+        r""" Make an on-axis projection of the SZ signal.
+
+        Parameters
+        ----------
+        axis : integer or string
+            The axis of the simulation domain along which to make the SZprojection.
+        center : array_like or string, optional
+            The center of the projection.
+        width : float or tuple
+            The width of the projection.
+        nx : integer, optional
+            The dimensions on a side of the projection image.
+        source : yt.data_objects.api.AMRData, optional
+            If specified, this will be the data source used for selecting regions to project.
+
+        Examples
+        --------
+        >>> szprj.on_axis("y", center="max", width=(1.0, "mpc"), source=my_sphere)
+        """
+        axis = fix_axis(axis)
+
+        def _beta_par(field, data):
+            axis = data.get_field_parameter("axis")
+            vpar = data["Density"]*data["%s-velocity" % (vlist[axis])]
+            return vpar/clight
+        add_field("BetaPar", function=_beta_par)    
+
+        proj = self.pf.h.proj(axis, "Density", source=source)
+        proj.set_field_parameter("axis", axis)
+        frb = proj.to_frb(width, nx)
+        dens = frb["Density"]
+        Te = frb["TeSZ"]/dens
+        bpar = frb["BetaPar"]/dens
+        omega1 = frb["TSquared"]/dens/(Te*Te) - 1.
+        bperp2 = np.zeros((nx,nx))
+        sigma1 = np.zeros((nx,nx))
+        kappa1 = np.zeros((nx,nx))                                    
+        if self.high_order:
+            bperp2 = frb["BetaPerpSquared"]/dens
+            sigma1 = frb["TBetaPar"]/dens/Te - bpar
+            kappa1 = frb["BetaParSquared"]/dens - bpar*bpar
+        tau = sigma_thompson*dens*self.mueinv/mh
+
+        nx,ny = frb.buff_size
+        self.bounds = frb.bounds
+        self.dx = (frb.bounds[1]-frb.bounds[0])/nx
+        self.dy = (frb.bounds[3]-frb.bounds[2])/ny
+        self.nx = nx
+        
+        self._compute_intensity(tau, Te, bpar, omega1, sigma1, kappa1, bperp2)
+                                                                                                                
+    def off_axis(self, L, center="c", width=(1, "unitary"), nx=800, source=None):
+        r""" Make an off-axis projection of the SZ signal.
+        
+        Parameters
+        ----------
+        L : array_like
+            The normal vector of the projection. 
+        center : array_like or string, optional
+            The center of the projection.
+        width : float or tuple
+            The width of the projection.
+        nx : integer, optional
+            The dimensions on a side of the projection image.
+        source : yt.data_objects.api.AMRData, optional
+            If specified, this will be the data source used for selecting regions to project.
+            Currently unsupported in yt 2.x.
+                    
+        Examples
+        --------
+        >>> L = np.array([0.5, 1.0, 0.75])
+        >>> szprj.off_axis(L, center="c", width=(2.0, "mpc"))
+        """
+        if iterable(width):
+            w = width[0]/self.pf.units[width[1]]
+        else:
+            w = width
+        if center == "c":
+            ctr = self.pf.domain_center
+        elif center == "max":
+            ctr = self.pf.h.find_max("Density")
+        else:
+            ctr = center
+
+        if source is not None:
+            mylog.error("Source argument is not currently supported for off-axis S-Z projections.")
+            raise NotImplementedError
+                
+        def _beta_par(field, data):
+            vpar = data["Density"]*(data["x-velocity"]*L[0]+
+                                    data["y-velocity"]*L[1]+
+                                    data["z-velocity"]*L[2])
+            return vpar/clight
+        add_field("BetaPar", function=_beta_par)
+
+        dens    = off_axis_projection(self.pf, ctr, L, w, nx, "Density")
+        Te      = off_axis_projection(self.pf, ctr, L, w, nx, "TeSZ")/dens
+        bpar    = off_axis_projection(self.pf, ctr, L, w, nx, "BetaPar")/dens
+        omega1  = off_axis_projection(self.pf, ctr, L, w, nx, "TSquared")/dens
+        omega1  = omega1/(Te*Te) - 1.
+        if self.high_order:
+            bperp2  = off_axis_projection(self.pf, ctr, L, w, nx, "BetaPerpSquared")/dens
+            sigma1  = off_axis_projection(self.pf, ctr, L, w, nx, "TBetaPar")/dens
+            sigma1  = sigma1/Te - bpar
+            kappa1  = off_axis_projection(self.pf, ctr, L, w, nx, "BetaParSquared")/dens
+            kappa1 -= bpar
+        else:
+            bperp2 = np.zeros((nx,nx))
+            sigma1 = np.zeros((nx,nx))
+            kappa1 = np.zeros((nx,nx))
+        tau = sigma_thompson*dens*self.mueinv/mh
+
+        self.bounds = np.array([-0.5*w, 0.5*w, -0.5*w, 0.5*w])
+        self.dx = w/nx
+        self.dy = w/nx
+        self.nx = nx
+
+        self._compute_intensity(tau, Te, bpar, omega1, sigma1, kappa1, bperp2)
+
+    def _compute_intensity(self, tau, Te, bpar, omega1, sigma1, kappa1, bperp2):
+
+        # Bad hack, but we get NaNs if we don't do something like this
+        small_beta = np.abs(bpar) < 1.0e-20
+        bpar[small_beta] = 1.0e-20
+                                                                   
+        comm = communication_system.communicators[-1]
+
+        nx, ny = self.nx,self.nx
+        signal = np.zeros((self.num_freqs,nx,ny))
+        xo = np.zeros((self.num_freqs))
+        
+        k = int(0)
+
+        start_i = comm.rank*nx/comm.size
+        end_i = (comm.rank+1)*nx/comm.size
+                        
+        pbar = get_pbar("Computing SZ signal.", nx*nx)
+
+        for i in xrange(start_i, end_i):
+            for j in xrange(ny):
+                xo[:] = self.xinit[:]
+                SZpack.compute_combo_means(xo, tau[i,j], Te[i,j],
+                                           bpar[i,j], omega1[i,j],
+                                           sigma1[i,j], kappa1[i,j], bperp2[i,j])
+                signal[:,i,j] = xo[:]
+                pbar.update(k)
+                k += 1
+
+        signal = comm.mpi_allreduce(signal)
+        
+        pbar.finish()
+                
+        for i, field in enumerate(self.freq_fields):
+            self.data[field] = ImageArray(I0*self.xinit[i]**3*signal[i,:,:])
+        self.data["Tau"] = ImageArray(tau)
+        self.data["TeSZ"] = ImageArray(Te)
+
+    @parallel_root_only
+    def write_fits(self, filename_prefix, clobber=True):
+        r""" Export images to a FITS file. Writes the SZ distortion in all
+        specified frequencies as well as the mass-weighted temperature and the
+        optical depth. Distance units are in kpc.  
+        
+        Parameters
+        ----------
+        filename_prefix : string
+            The prefix of the FITS filename.
+        clobber : boolean, optional
+            If the file already exists, do we overwrite?
+                    
+        Examples
+        --------
+        >>> szprj.write_fits("SZbullet", clobber=False)
+        """
+        coords = {}
+        coords["dx"] = self.dx*self.pf.units["kpc"]
+        coords["dy"] = self.dy*self.pf.units["kpc"]
+        coords["xctr"] = 0.0
+        coords["yctr"] = 0.0
+        coords["units"] = "kpc"
+        other_keys = {"Time" : self.pf.current_time}
+        write_fits(self.data, filename_prefix, clobber=clobber, coords=coords,
+                   other_keys=other_keys)
+
+    @parallel_root_only
+    def write_png(self, filename_prefix):
+        r""" Export images to PNG files. Writes the SZ distortion in all
+        specified frequencies as well as the mass-weighted temperature and the
+        optical depth. Distance units are in kpc. 
+        
+        Parameters
+        ----------
+        filename_prefix : string
+            The prefix of the image filenames.
+                
+        Examples
+        --------
+        >>> szprj.write_png("SZsloshing")
+        """     
+        extent = tuple([bound*self.pf.units["kpc"] for bound in self.bounds])
+        for field, image in self.items():
+            filename=filename_prefix+"_"+field+".png"
+            label = self.display_names[field]
+            if self.units[field] is not None:
+                label += " ("+self.units[field]+")"
+            write_projection(image, filename, colorbar_label=label, take_log=False,
+                             extent=extent, xlabel=r"$\mathrm{x\ (kpc)}$",
+                             ylabel=r"$\mathrm{y\ (kpc)}$")
+
+    @parallel_root_only
+    def write_hdf5(self, filename):
+        r"""Export the set of S-Z fields to a set of HDF5 datasets.
+        
+        Parameters
+        ----------
+        filename : string
+            This file will be opened in "write" mode.
+        
+        Examples
+        --------
+        >>> szprj.write_hdf5("SZsloshing.h5")                        
+        """
+        import h5py
+        f = h5py.File(filename, "w")
+        for field, data in self.items():
+            f.create_dataset(field,data=data)
+        f.close()
+   
+    def keys(self):
+        return self.data.keys()
+
+    def items(self):
+        return self.data.items()
+
+    def values(self):
+        return self.data.values()
+    
+    def has_key(self, key):
+        return key in self.data.keys()
+
+    def __getitem__(self, key):
+        return self.data[key]
+
+    @property
+    def shape(self):
+        return (self.nx,self.nx)

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/sunyaev_zeldovich/setup.py
--- /dev/null
+++ b/yt/analysis_modules/sunyaev_zeldovich/setup.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+import setuptools
+import os
+import sys
+import os.path
+
+
+def configuration(parent_package='', top_path=None):
+    from numpy.distutils.misc_util import Configuration
+    config = Configuration('sunyaev_zeldovich', parent_package, top_path)
+    config.add_subpackage("tests")
+    config.make_config_py()  # installs __config__.py
+    #config.make_svn_version_py()
+    return config

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/sunyaev_zeldovich/tests/test_projection.py
--- /dev/null
+++ b/yt/analysis_modules/sunyaev_zeldovich/tests/test_projection.py
@@ -0,0 +1,139 @@
+"""
+Unit test the sunyaev_zeldovich analysis module.
+"""
+
+#-----------------------------------------------------------------------------
+# 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.
+#-----------------------------------------------------------------------------
+
+from yt.frontends.stream.api import load_uniform_grid
+from yt.funcs import get_pbar, mylog
+from yt.utilities.physical_constants import cm_per_kpc, K_per_keV, \
+     mh, cm_per_km, kboltz, Tcmb, hcgs, clight, sigma_thompson
+from yt.testing import *
+from yt.utilities.answer_testing.framework import requires_pf, \
+     GenericArrayTest, data_dir_load, GenericImageTest
+try:
+    from yt.analysis_modules.sunyaev_zeldovich.projection import SZProjection, I0
+except ImportError:
+    pass
+import numpy as np
+try:
+    import SZpack
+except ImportError:
+    pass
+
+mue = 1./0.88
+freqs = np.array([30., 90., 240.])
+
+def setup():
+    """Test specific setup."""
+    from yt.config import ytcfg
+    ytcfg["yt", "__withintesting"] = "True"
+
+def full_szpack3d(pf, xo):
+    data = pf.h.grids[0]
+    dz = pf.h.get_smallest_dx()*pf.units["cm"]
+    nx,ny,nz = data["Density"].shape
+    dn = np.zeros((nx,ny,nz))
+    Dtau = sigma_thompson*data["Density"]/(mh*mue)*dz
+    Te = data["Temperature"]/K_per_keV
+    betac = data["z-velocity"]/clight
+    pbar = get_pbar("Computing 3-D cell-by-cell S-Z signal for comparison.", nx)
+    for i in xrange(nx):
+        pbar.update(i)
+        for j in xrange(ny):
+            for k in xrange(nz):
+                dn[i,j,k] = SZpack.compute_3d(xo, Dtau[i,j,k],
+                                              Te[i,j,k], betac[i,j,k],
+                                              1.0, 0.0, 0.0, 1.0e-5)
+    pbar.finish()
+    return I0*xo**3*np.sum(dn, axis=2)
+
+def setup_cluster():
+
+    R = 1000.
+    r_c = 100.
+    rho_c = 1.673e-26
+    beta = 1.
+    T0 = 4.
+    nx,ny,nz = 16,16,16
+    c = 0.17
+    a_c = 30.
+    a = 200.
+    v0 = 300.*cm_per_km
+    ddims = (nx,ny,nz)
+
+    x, y, z = np.mgrid[-R:R:nx*1j,
+                       -R:R:ny*1j,
+                       -R:R:nz*1j]
+
+    r = np.sqrt(x**2+y**2+z**2)
+
+    dens = np.zeros(ddims)
+    dens = rho_c*(1.+(r/r_c)**2)**(-1.5*beta)
+    temp = T0*K_per_keV/(1.+r/a)*(c+r/a_c)/(1.+r/a_c)
+    velz = v0*temp/(T0*K_per_keV)
+
+    data = {}
+    data["Density"] = dens
+    data["Temperature"] = temp
+    data["x-velocity"] = np.zeros(ddims)
+    data["y-velocity"] = np.zeros(ddims)
+    data["z-velocity"] = velz
+
+    bbox = np.array([[-0.5,0.5],[-0.5,0.5],[-0.5,0.5]])
+
+    L = 2*R*cm_per_kpc
+    dl = L/nz
+
+    pf = load_uniform_grid(data, ddims, L, bbox=bbox)
+
+    return pf
+
+ at requires_module("SZpack")
+def test_projection():
+    pf = setup_cluster()
+    nx,ny,nz = pf.domain_dimensions
+    xinit = 1.0e9*hcgs*freqs/(kboltz*Tcmb)
+    szprj = SZProjection(pf, freqs, mue=mue, high_order=True)
+    szprj.on_axis(2, nx=nx)
+    deltaI = np.zeros((3,nx,ny))
+    for i in xrange(3):
+        deltaI[i,:,:] = full_szpack3d(pf, xinit[i])
+        yield assert_almost_equal, deltaI[i,:,:], szprj["%d_GHz" % int(freqs[i])], 6
+
+M7 = "DD0010/moving7_0010"
+ at requires_module("SZpack")
+ at requires_pf(M7)
+def test_M7_onaxis():
+    pf = data_dir_load(M7)
+    szprj = SZProjection(pf, freqs)
+    szprj.on_axis(2, nx=100)
+    def onaxis_array_func():
+        return szprj.data
+    def onaxis_image_func(filename_prefix):
+        szprj.write_png(filename_prefix)
+    for test in [GenericArrayTest(pf, onaxis_array_func),
+                 GenericImageTest(pf, onaxis_image_func, 3)]:
+        test_M7_onaxis.__name__ = test.description
+        yield test
+
+ at requires_module("SZpack")
+ at requires_pf(M7)
+def test_M7_offaxis():
+    pf = data_dir_load(M7)
+    szprj = SZProjection(pf, freqs)
+    szprj.off_axis(np.array([0.1,-0.2,0.4]), nx=100)
+    def offaxis_array_func():
+        return szprj.data
+    def offaxis_image_func(filename_prefix):
+        szprj.write_png(filename_prefix)
+    for test in [GenericArrayTest(pf, offaxis_array_func),
+                 GenericImageTest(pf, offaxis_image_func, 3)]:
+        test_M7_offaxis.__name__ = test.description
+        yield test

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/analysis_modules/two_point_functions/two_point_functions.py
--- a/yt/analysis_modules/two_point_functions/two_point_functions.py
+++ b/yt/analysis_modules/two_point_functions/two_point_functions.py
@@ -499,7 +499,7 @@
             points[:, 2] = points[:, 2] / self.period[2]
             fKD.qv_many = points.T
             fKD.nn_tags = np.asfortranarray(np.empty((1, points.shape[0]), dtype='int64'))
-            find_many_nn_nearest_neighbors()
+            fKD.find_many_nn_nearest_neighbors()
             # The -1 is for fortran counting.
             n = fKD.nn_tags[0,:] - 1
         return n

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -1864,7 +1864,7 @@
         new_buf.append(self.comm.mpi_allreduce(buf.pop(0), op=op))
         tree = self._get_tree(len(fields))
         tree.frombuffer(new_buf[0], new_buf[1], new_buf[2], merge_style)
-        coord_data, field_data, weight_data, dxs = [], [], [], []
+        coord_data, field_data, weight_data, dxs, dys = [], [], [], [], []
         for level in range(0, self._max_level + 1):
             npos, nvals, nwvals = tree.get_all_from_level(level, False)
             coord_data.append(npos)
@@ -1873,10 +1873,12 @@
             weight_data.append(nwvals)
             gs = self.source.select_grids(level)
             if len(gs) > 0:
-                ds = gs[0].dds[0]
+                dx = gs[0].dds[x_dict[self.axis]]
+                dy = gs[0].dds[y_dict[self.axis]]
             else:
-                ds = 0.0
-            dxs.append(np.ones(nvals.shape[0], dtype='float64') * ds)
+                dx = dy = 0.0
+            dxs.append(np.ones(nvals.shape[0], dtype='float64') * dx)
+            dys.append(np.ones(nvals.shape[0], dtype='float64') * dy)
         coord_data = np.concatenate(coord_data, axis=0).transpose()
         field_data = np.concatenate(field_data, axis=0).transpose()
         if self._weight is None:
@@ -1884,17 +1886,19 @@
             field_data *= convs[:,None]
         weight_data = np.concatenate(weight_data, axis=0).transpose()
         dxs = np.concatenate(dxs, axis=0).transpose()
+        dys = np.concatenate(dys, axis=0).transpose()
         # We now convert to half-widths and center-points
         data = {}
         data['pdx'] = dxs
+        data['pdy'] = dys
         ox = self.pf.domain_left_edge[x_dict[self.axis]]
         oy = self.pf.domain_left_edge[y_dict[self.axis]]
         data['px'] = (coord_data[0,:]+0.5) * data['pdx'] + ox
-        data['py'] = (coord_data[1,:]+0.5) * data['pdx'] + oy
+        data['py'] = (coord_data[1,:]+0.5) * data['pdy'] + oy
         data['weight_field'] = weight_data
         del coord_data
         data['pdx'] *= 0.5
-        data['pdy'] = data['pdx'] # generalization is out the window!
+        data['pdy'] *= 0.5
         data['fields'] = field_data
         # Now we run the finalizer, which is ignored if we don't need it
         field_data = np.vsplit(data.pop('fields'), len(fields))

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/data_objects/hierarchy.py
--- a/yt/data_objects/hierarchy.py
+++ b/yt/data_objects/hierarchy.py
@@ -395,6 +395,23 @@
           [self.grid_left_edge[:,0], self.grid_right_edge[:,1], self.grid_right_edge[:,2]],
         ], dtype='float64')
 
+    def lock_grids_to_parents(self):
+        r"""This function locks grid edges to their parents.
+
+        This is useful in cases where the grid structure may be somewhat
+        irregular, or where setting the left and right edges is a lossy
+        process.  It is designed to correct situations where left/right edges
+        may be set slightly incorrectly, resulting in discontinuities in images
+        and the like.
+        """
+        mylog.info("Locking grids to parents.")
+        for i, g in enumerate(self.grids):
+            si = g.get_global_startindex()
+            g.LeftEdge = self.pf.domain_left_edge + g.dds * si
+            g.RightEdge = g.LeftEdge + g.ActiveDimensions * g.dds
+            self.grid_left_edge[i,:] = g.LeftEdge
+            self.grid_right_edge[i,:] = g.RightEdge
+
     def print_stats(self):
         """
         Prints out (stdout) relevant information about the simulation

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/data_objects/tests/test_fields.py
--- a/yt/data_objects/tests/test_fields.py
+++ b/yt/data_objects/tests/test_fields.py
@@ -86,6 +86,9 @@
         if field.startswith("particle"): continue
         if field.startswith("CIC"): continue
         if field.startswith("WeakLensingConvergence"): continue
+        if field.startswith("BetaPar"): continue
+        if field.startswith("TBetaPar"): continue
+        if field.startswith("BetaPerp"): continue
         if FieldInfo[field].particle_type: continue
         for nproc in [1, 4, 8]:
             yield TestFieldAccess(field, nproc)

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/frontends/athena/data_structures.py
--- a/yt/frontends/athena/data_structures.py
+++ b/yt/frontends/athena/data_structures.py
@@ -197,13 +197,18 @@
             raise TypeError
 
         # Need to determine how many grids: self.num_grids
-        dname = self.hierarchy_filename
-        gridlistread = glob.glob('id*/%s-id*%s' % (dname[4:-9],dname[-9:] ))
+        dataset_dir = os.path.dirname(self.hierarchy_filename)
+        dname = os.path.split(self.hierarchy_filename)[-1]
+        if dataset_dir.endswith("id0"):
+            dname = "id0/"+dname
+            dataset_dir = dataset_dir[:-3]
+                        
+        gridlistread = glob.glob(os.path.join(dataset_dir, 'id*/%s-id*%s' % (dname[4:-9],dname[-9:])))
         gridlistread.insert(0,self.hierarchy_filename)
         if 'id0' in dname :
-            gridlistread += glob.glob('id*/lev*/%s*-lev*%s' % (dname[4:-9],dname[-9:]))
+            gridlistread += glob.glob(os.path.join(dataset_dir, 'id*/lev*/%s*-lev*%s' % (dname[4:-9],dname[-9:])))
         else :
-            gridlistread += glob.glob('lev*/%s*-lev*%s' % (dname[:-9],dname[-9:]))
+            gridlistread += glob.glob(os.path.join(dataset_dir, 'lev*/%s*-lev*%s' % (dname[:-9],dname[-9:])))
         self.num_grids = len(gridlistread)
         dxs=[]
         self.grids = np.empty(self.num_grids, dtype='object')
@@ -426,12 +431,17 @@
         else:
             self.periodicity = (True,)*self.dimensionality
 
-        dname = self.parameter_filename
-        gridlistread = glob.glob('id*/%s-id*%s' % (dname[4:-9],dname[-9:] ))
+        dataset_dir = os.path.dirname(self.parameter_filename)
+        dname = os.path.split(self.parameter_filename)[-1]
+        if dataset_dir.endswith("id0"):
+            dname = "id0/"+dname
+            dataset_dir = dataset_dir[:-3]
+            
+        gridlistread = glob.glob(os.path.join(dataset_dir, 'id*/%s-id*%s' % (dname[4:-9],dname[-9:])))
         if 'id0' in dname :
-            gridlistread += glob.glob('id*/lev*/%s*-lev*%s' % (dname[4:-9],dname[-9:]))
+            gridlistread += glob.glob(os.path.join(dataset_dir, 'id*/lev*/%s*-lev*%s' % (dname[4:-9],dname[-9:])))
         else :
-            gridlistread += glob.glob('lev*/%s*-lev*%s' % (dname[:-9],dname[-9:]))
+            gridlistread += glob.glob(os.path.join(dataset_dir, 'lev*/%s*-lev*%s' % (dname[:-9],dname[-9:])))
         self.nvtk = len(gridlistread)+1 
 
         self.current_redshift = self.omega_lambda = self.omega_matter = \

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/frontends/chombo/tests/test_outputs.py
--- a/yt/frontends/chombo/tests/test_outputs.py
+++ b/yt/frontends/chombo/tests/test_outputs.py
@@ -29,6 +29,7 @@
     pf = data_dir_load(gc)
     yield assert_equal, str(pf), "data.0077.3d.hdf5"
     for test in small_patch_amr(gc, _fields):
+        test_gc.__name__ = test.description
         yield test
 
 tb = "TurbBoxLowRes/data.0005.3d.hdf5"
@@ -37,4 +38,5 @@
     pf = data_dir_load(tb)
     yield assert_equal, str(pf), "data.0005.3d.hdf5"
     for test in small_patch_amr(tb, _fields):
+        test_tb.__name__ = test.description
         yield test

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -40,6 +40,7 @@
 from yt.utilities.definitions import \
     mpc_conversion, sec_conversion
 from yt.utilities import hdf5_light_reader
+from yt.utilities.io_handler import io_registry
 from yt.utilities.logger import ytLogger as mylog
 
 from .definitions import parameterDict
@@ -131,10 +132,11 @@
 
     def retrieve_ghost_zones(self, n_zones, fields, all_levels=False,
                              smoothed=False):
-        # We ignore smoothed in this case.
-        if n_zones > 3:
+        NGZ = self.pf.parameters.get("NumberOfGhostZones", 3)
+        if n_zones > NGZ:
             return EnzoGrid.retrieve_ghost_zones(
                 self, n_zones, fields, all_levels, smoothed)
+
         # ----- Below is mostly the original code, except we remove the field
         # ----- access section
         # We will attempt this by creating a datacube that is exactly bigger
@@ -162,7 +164,12 @@
                 level, new_left_edge, **kwargs)
         # ----- This is EnzoGrid.get_data, duplicated here mostly for
         # ----  efficiency's sake.
-        sl = [slice(3 - n_zones, -(3 - n_zones)) for i in range(3)]
+        start_zone = NGZ - n_zones
+        if start_zone == 0:
+            end_zone = None
+        else:
+            end_zone = -(NGZ - n_zones)
+        sl = [slice(start_zone, end_zone) for i in range(3)]
         if fields is None: return cube
         for field in ensure_list(fields):
             if field in self.hierarchy.field_list:
@@ -543,6 +550,9 @@
                     result[p] = result[p][0:max_num]
         return result
 
+    def _setup_data_io(self):
+            self.io = io_registry[self.data_style](self.parameter_file)
+
 
 class EnzoHierarchyInMemory(EnzoHierarchy):
 

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -32,6 +32,10 @@
 
     _data_style = "enzo_hdf4"
 
+    def __init__(self, pf, *args, **kwargs):
+        BaseIOHandler.__init__(self, *args, **kwargs)
+        self.pf = pf
+
     def modify(self, field):
         return field.swapaxes(0,2)
 
@@ -61,6 +65,10 @@
     _data_style = "enzo_hdf5"
     _particle_reader = True
 
+    def __init__(self, pf, *args, **kwargs):
+        BaseIOHandler.__init__(self, *args, **kwargs)
+        self.pf = pf
+
     def _read_field_names(self, grid):
         """
         Returns a list of fields associated with the filename
@@ -90,6 +98,10 @@
     _data_style = "enzo_packed_3d"
     _particle_reader = True
 
+    def __init__(self, pf, *args, **kwargs):
+        BaseIOHandler.__init__(self, *args, **kwargs)
+        self.pf = pf
+
     def _read_particles(self, fields, rtype, args, grid_list, enclosed,
                         conv_factors):
         filenames = [g.filename for g in grid_list]
@@ -144,10 +156,18 @@
 class IOHandlerPackedHDF5GhostZones(IOHandlerPackedHDF5):
     _data_style = "enzo_packed_3d_gz"
 
+    def __init__(self, pf, *args, **kwargs):
+        BaseIOHandler.__init__(self, *args, **kwargs)
+        self.pf = pf
+
     def modify(self, field):
+        NGZ = self.pf.parameters.get("NumberOfGhostZones", 3)
+        sl =  (slice(NGZ,-NGZ),
+               slice(NGZ,-NGZ),
+               slice(NGZ,-NGZ))
         if len(field.shape) < 3:
             return field
-        tr = field[3:-3,3:-3,3:-3].swapaxes(0,2)
+        tr = field[sl].swapaxes(0,2)
         return tr.copy() # To ensure contiguous
 
     def _read_raw_data_set(self, grid, field):
@@ -158,7 +178,7 @@
 
     _data_style = "enzo_inline"
 
-    def __init__(self, ghost_zones=3):
+    def __init__(self, pf, ghost_zones=3):
         import enzo
         self.enzo = enzo
         self.grids_in_memory = enzo.grid_data
@@ -166,6 +186,7 @@
         self.my_slice = (slice(ghost_zones,-ghost_zones),
                       slice(ghost_zones,-ghost_zones),
                       slice(ghost_zones,-ghost_zones))
+        self.pf = pf
         BaseIOHandler.__init__(self)
 
     def _read_data(self, grid, field):
@@ -210,6 +231,10 @@
     _data_style = "enzo_packed_2d"
     _particle_reader = False
 
+    def __init__(self, pf, *args, **kwargs):
+        BaseIOHandler.__init__(self, *args, **kwargs)
+        self.pf = pf
+
     def _read_data(self, grid, field):
         return hdf5_light_reader.ReadData(grid.filename,
             "/Grid%08i/%s" % (grid.id, field)).transpose()[:,:,None]
@@ -228,6 +253,10 @@
     _data_style = "enzo_packed_1d"
     _particle_reader = False
 
+    def __init__(self, pf, *args, **kwargs):
+        BaseIOHandler.__init__(self, *args, **kwargs)
+        self.pf = pf
+
     def _read_data(self, grid, field):
         return hdf5_light_reader.ReadData(grid.filename,
             "/Grid%08i/%s" % (grid.id, field)).transpose()[:,None,None]

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/frontends/enzo/tests/test_outputs.py
--- a/yt/frontends/enzo/tests/test_outputs.py
+++ b/yt/frontends/enzo/tests/test_outputs.py
@@ -30,6 +30,7 @@
     pf = data_dir_load(m7)
     yield assert_equal, str(pf), "moving7_0010"
     for test in small_patch_amr(m7, _fields):
+        test_moving7.__name__ = test.description
         yield test
 
 g30 = "IsolatedGalaxy/galaxy0030/galaxy0030"
@@ -38,4 +39,5 @@
     pf = data_dir_load(g30)
     yield assert_equal, str(pf), "galaxy0030"
     for test in big_patch_amr(g30, _fields):
+        test_galaxy0030.__name__ = test.description
         yield test

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/frontends/flash/tests/test_outputs.py
--- a/yt/frontends/flash/tests/test_outputs.py
+++ b/yt/frontends/flash/tests/test_outputs.py
@@ -29,6 +29,7 @@
     pf = data_dir_load(sloshing)
     yield assert_equal, str(pf), "sloshing_low_res_hdf5_plt_cnt_0300"
     for test in small_patch_amr(sloshing, _fields):
+        test_sloshing.__name__ = test.description
         yield test
 
 _fields_2d = ("Temperature", "Density")
@@ -39,4 +40,5 @@
     pf = data_dir_load(wt)
     yield assert_equal, str(pf), "windtunnel_4lev_hdf5_plt_cnt_0030"
     for test in small_patch_amr(wt, _fields_2d):
+        test_wind_tunnel.__name__ = test.description
         yield test

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/frontends/orion/tests/test_outputs.py
--- a/yt/frontends/orion/tests/test_outputs.py
+++ b/yt/frontends/orion/tests/test_outputs.py
@@ -29,6 +29,7 @@
     pf = data_dir_load(radadvect)
     yield assert_equal, str(pf), "plt00000"
     for test in small_patch_amr(radadvect, _fields):
+        test_radadvect.__name__ = test.description
         yield test
 
 rt = "RadTube/plt00500"
@@ -37,4 +38,5 @@
     pf = data_dir_load(rt)
     yield assert_equal, str(pf), "plt00500"
     for test in small_patch_amr(rt, _fields):
+        test_radtube.__name__ = test.description
         yield test

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -625,3 +625,38 @@
         return
     if not os.path.exists(my_dir):
         only_on_root(os.makedirs, my_dir)
+
+ at contextlib.contextmanager
+def memory_checker(interval = 15):
+    r"""This is a context manager that monitors memory usage.
+
+    Parameters
+    ----------
+    interval : int
+        The number of seconds between printing the current memory usage in
+        gigabytes of the current Python interpreter.
+
+    Examples
+    --------
+
+    >>> with memory_checker(10):
+    ...     arr = np.zeros(1024*1024*1024, dtype="float64")
+    ...     time.sleep(15)
+    ...     del arr
+    """
+    import threading
+    class MemoryChecker(threading.Thread):
+        def __init__(self, event, interval):
+            self.event = event
+            self.interval = interval
+            threading.Thread.__init__(self)
+
+        def run(self):
+            while not self.event.wait(self.interval):
+                print "MEMORY: %0.3e gb" % (get_memory_usage()/1024.)
+
+    e = threading.Event()
+    mem_check = MemoryChecker(e, interval)
+    mem_check.start()
+    yield
+    e.set()

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/gui/reason/extdirect_router.py
--- a/yt/gui/reason/extdirect_router.py
+++ b/yt/gui/reason/extdirect_router.py
@@ -9,6 +9,13 @@
 This code was released under the BSD License.
 """
 
+#-----------------------------------------------------------------------------
+# 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 inspect
 
 class DirectException(Exception):
@@ -186,12 +193,4 @@
 
 
 
-"""
 
-#-----------------------------------------------------------------------------
-# 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.
-#-----------------------------------------------------------------------------

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/testing.py
--- a/yt/testing.py
+++ b/yt/testing.py
@@ -14,6 +14,7 @@
 
 import itertools as it
 import numpy as np
+import importlib
 from yt.funcs import *
 from numpy.testing import assert_array_equal, assert_almost_equal, \
     assert_approx_equal, assert_array_almost_equal, assert_equal, \
@@ -251,3 +252,23 @@
                     list_of_kwarg_dicts[i][key] = keywords[key][0]
 
     return list_of_kwarg_dicts
+
+def requires_module(module):
+    """
+    Decorator that takes a module name as an argument and tries to import it.
+    If the module imports without issue, the function is returned, but if not, 
+    a null function is returned. This is so tests that depend on certain modules
+    being imported will not fail if the module is not installed on the testing
+    platform.
+    """
+    def ffalse(func):
+        return lambda: None
+    def ftrue(func):
+        return func
+    try:
+        importlib.import_module(module)
+    except ImportError:
+        return ffalse
+    else:
+        return ftrue
+    

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -24,6 +24,7 @@
 import shelve
 import zlib
 import tempfile
+import glob
 
 from matplotlib.testing.compare import compare_images
 from nose.plugins import Plugin
@@ -576,6 +577,16 @@
         for newc, oldc in zip(new_result["children"], old_result["children"]):
             assert(newp == oldp)
 
+def compare_image_lists(new_result, old_result, decimals):
+    fns = ['old.png', 'new.png']
+    num_images = len(old_result)
+    assert(num_images > 0)
+    for i in xrange(num_images):
+        mpimg.imsave(fns[0], np.loads(zlib.decompress(old_result[i])))
+        mpimg.imsave(fns[1], np.loads(zlib.decompress(new_result[i])))
+        assert compare_images(fns[0], fns[1], 10**(decimals)) == None
+        for fn in fns: os.remove(fn)
+            
 class PlotWindowAttributeTest(AnswerTestingTest):
     _type_name = "PlotWindowAttribute"
     _attrs = ('plot_type', 'plot_field', 'plot_axis', 'attr_name', 'attr_args')
@@ -603,12 +614,71 @@
         return [zlib.compress(image.dumps())]
 
     def compare(self, new_result, old_result):
-        fns = ['old.png', 'new.png']
-        mpimg.imsave(fns[0], np.loads(zlib.decompress(old_result[0])))
-        mpimg.imsave(fns[1], np.loads(zlib.decompress(new_result[0])))
-        assert compare_images(fns[0], fns[1], 10**(-self.decimals)) == None
-        for fn in fns: os.remove(fn)
+        compare_image_lists(new_result, old_result, self.decimals)
+        
+class GenericArrayTest(AnswerTestingTest):
+    _type_name = "GenericArray"
+    _attrs = ('array_func_name','args','kwargs')
+    def __init__(self, pf_fn, array_func, args=None, kwargs=None, decimals=None):
+        super(GenericArrayTest, self).__init__(pf_fn)
+        self.array_func = array_func
+        self.array_func_name = array_func.func_name
+        self.args = args
+        self.kwargs = kwargs
+        self.decimals = decimals
+    def run(self):
+        if self.args is None:
+            args = []
+        else:
+            args = self.args
+        if self.kwargs is None:
+            kwargs = {}
+        else:
+            kwargs = self.kwargs
+        return self.array_func(*args, **kwargs)
+    def compare(self, new_result, old_result):
+        assert_equal(len(new_result), len(old_result),
+                                          err_msg="Number of outputs not equal.",
+                                          verbose=True)
+        for k in new_result:
+            if self.decimals is None:
+                assert_equal(new_result[k], old_result[k])
+            else:
+                assert_allclose(new_result[k], old_result[k], 10**(-self.decimals))
 
+class GenericImageTest(AnswerTestingTest):
+    _type_name = "GenericImage"
+    _attrs = ('image_func_name','args','kwargs')
+    def __init__(self, pf_fn, image_func, decimals, args=None, kwargs=None):
+        super(GenericImageTest, self).__init__(pf_fn)
+        self.image_func = image_func
+        self.image_func_name = image_func.func_name
+        self.args = args
+        self.kwargs = kwargs
+        self.decimals = decimals
+    def run(self):
+        if self.args is None:
+            args = []
+        else:
+            args = self.args
+        if self.kwargs is None:
+            kwargs = {}
+        else:
+            kwargs = self.kwargs
+        comp_imgs = []
+        tmpdir = tempfile.mkdtemp()
+        image_prefix = os.path.join(tmpdir,"test_img")
+        self.image_func(image_prefix, *args, **kwargs)
+        imgs = glob.glob(image_prefix+"*")
+        assert(len(imgs) > 0)
+        for img in imgs:
+            img_data = mpimg.imread(img)
+            os.remove(img)
+            comp_imgs.append(zlib.compress(img_data.dumps()))
+        return comp_imgs
+    def compare(self, new_result, old_result):
+        compare_image_lists(new_result, old_result, self.decimals)
+        
 def requires_pf(pf_fn, big_data = False):
     def ffalse(func):
         return lambda: None

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/utilities/lib/grid_traversal.pyx
--- a/yt/utilities/lib/grid_traversal.pyx
+++ b/yt/utilities/lib/grid_traversal.pyx
@@ -953,6 +953,14 @@
             tl = (vc.right_edge[i] - v_pos[i])*iv_dir[i]
         temp_x = (v_pos[x] + tl*v_dir[x])
         temp_y = (v_pos[y] + tl*v_dir[y])
+        if fabs(temp_x - vc.left_edge[x]) < 1e-10*vc.dds[x]:
+            temp_x = vc.left_edge[x]
+        elif fabs(temp_x - vc.right_edge[x]) < 1e-10*vc.dds[x]:
+            temp_x = vc.right_edge[x]
+        if fabs(temp_y - vc.left_edge[y]) < 1e-10*vc.dds[y]:
+            temp_y = vc.left_edge[y]
+        elif fabs(temp_y - vc.right_edge[y]) < 1e-10*vc.dds[y]:
+            temp_y = vc.right_edge[y]
         if vc.left_edge[x] <= temp_x and temp_x <= vc.right_edge[x] and \
            vc.left_edge[y] <= temp_y and temp_y <= vc.right_edge[y] and \
            0.0 <= tl and tl < intersect_t:

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/utilities/physical_constants.py
--- a/yt/utilities/physical_constants.py
+++ b/yt/utilities/physical_constants.py
@@ -8,7 +8,7 @@
 # http://physics.nist.gov/cuu/Constants/index.html
 
 # Masses
-mass_electron_cgs = 9.109382-28  # g
+mass_electron_cgs = 9.109382e-28  # g
 amu_cgs           = 1.660538921e-24  # g
 mass_hydrogen_cgs = 1.007947*amu_cgs  # g
 mass_sun_cgs = 1.98841586e33  # g
@@ -84,6 +84,7 @@
 erg_per_keV = erg_per_eV * 1.0e3
 K_per_keV = erg_per_keV / boltzmann_constant_cgs
 keV_per_K = 1.0 / K_per_keV
+Tcmb = 2.726 # Current CMB temperature
 
 #Short cuts
 G = gravitational_constant_cgs

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/utilities/setup.py
--- a/yt/utilities/setup.py
+++ b/yt/utilities/setup.py
@@ -36,7 +36,7 @@
     _archs = ['lib64', 'lib']
     if platform.system() == 'Linux':
         distname, version, did = platform.linux_distribution()
-        if distname in ('Ubuntu', 'Debian'):
+        if distname.lower() in ('ubuntu', 'debian'):
             _archs.extend(
                 ['lib/x86_64-linux-gnu',
                  'lib/i686-linux-gnu',
@@ -73,11 +73,12 @@
 def check_prefix(inc_dir, lib_dir):
     if platform.system() == 'Linux':
         distname, version, did = platform.linux_distribution()
-        if distname in ('Ubuntu', 'Debian'):
+        if distname.lower() in ('ubuntu', 'debian'):
             print("Since you are using multiarch distro it's hard to detect")
             print("whether library matches the header file. We will assume")
             print("it does. If you encounter any build failures please use")
             print("proper cfg files to provide path to the dependencies")
+            print("")
             return (inc_dir, lib_dir)
     prefix = os.path.commonprefix([inc_dir, lib_dir]).rstrip('/\\')
     if prefix is not '' and prefix == os.path.dirname(inc_dir):

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/visualization/api.py
--- a/yt/visualization/api.py
+++ b/yt/visualization/api.py
@@ -20,8 +20,7 @@
 from plot_collection import \
     PlotCollection, \
     PlotCollectionInteractive, \
-    concatenate_pdfs, \
-    get_multi_plot
+    concatenate_pdfs
 
 from fixed_resolution import \
     FixedResolutionBuffer, \
@@ -54,5 +53,7 @@
     OffAxisSlicePlot, \
     ProjectionPlot, \
     OffAxisProjectionPlot
-    
 
+from base_plot_types import \
+    get_multi_plot
+

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/visualization/base_plot_types.py
--- a/yt/visualization/base_plot_types.py
+++ b/yt/visualization/base_plot_types.py
@@ -94,3 +94,86 @@
         canvas.print_figure(f)
         f.seek(0)
         return f.read()
+
+def get_multi_plot(nx, ny, colorbar = 'vertical', bw = 4, dpi=300,
+                   cbar_padding = 0.4):
+    r"""Construct a multiple axes plot object, with or without a colorbar, into
+    which multiple plots may be inserted.
+
+    This will create a set of :class:`matplotlib.axes.Axes`, all lined up into
+    a grid, which are then returned to the user and which can be used to plot
+    multiple plots on a single figure.
+
+    Parameters
+    ----------
+    nx : int
+        Number of axes to create along the x-direction
+    ny : int
+        Number of axes to create along the y-direction
+    colorbar : {'vertical', 'horizontal', None}, optional
+        Should Axes objects for colorbars be allocated, and if so, should they
+        correspond to the horizontal or vertical set of axes?
+    bw : number
+        The base height/width of an axes object inside the figure, in inches
+    dpi : number
+        The dots per inch fed into the Figure instantiation
+
+    Returns
+    -------
+    fig : :class:`matplotlib.figure.Figure`
+        The figure created inside which the axes reside
+    tr : list of list of :class:`matplotlib.axes.Axes` objects
+        This is a list, where the inner list is along the x-axis and the outer
+        is along the y-axis
+    cbars : list of :class:`matplotlib.axes.Axes` objects
+        Each of these is an axes onto which a colorbar can be placed.
+
+    Notes
+    -----
+    This is a simple implementation for a common use case.  Viewing the source
+    can be instructure, and is encouraged to see how to generate more
+    complicated or more specific sets of multiplots for your own purposes.
+    """
+    hf, wf = 1.0/ny, 1.0/nx
+    fudge_x = fudge_y = 1.0
+    if colorbar is None:
+        fudge_x = fudge_y = 1.0
+    elif colorbar.lower() == 'vertical':
+        fudge_x = nx/(cbar_padding+nx)
+        fudge_y = 1.0
+    elif colorbar.lower() == 'horizontal':
+        fudge_x = 1.0
+        fudge_y = ny/(cbar_padding+ny)
+    fig = matplotlib.figure.Figure((bw*nx/fudge_x, bw*ny/fudge_y), dpi=dpi)
+    from _mpl_imports import FigureCanvasAgg
+    fig.set_canvas(FigureCanvasAgg(fig))
+    fig.subplots_adjust(wspace=0.0, hspace=0.0,
+                        top=1.0, bottom=0.0,
+                        left=0.0, right=1.0)
+    tr = []
+    for j in range(ny):
+        tr.append([])
+        for i in range(nx):
+            left = i*wf*fudge_x
+            bottom = fudge_y*(1.0-(j+1)*hf) + (1.0-fudge_y)
+            ax = fig.add_axes([left, bottom, wf*fudge_x, hf*fudge_y])
+            tr[-1].append(ax)
+    cbars = []
+    if colorbar is None:
+        pass
+    elif colorbar.lower() == 'horizontal':
+        for i in range(nx):
+            # left, bottom, width, height
+            # Here we want 0.10 on each side of the colorbar
+            # We want it to be 0.05 tall
+            # And we want a buffer of 0.15
+            ax = fig.add_axes([wf*(i+0.10)*fudge_x, hf*fudge_y*0.20,
+                               wf*(1-0.20)*fudge_x, hf*fudge_y*0.05])
+            cbars.append(ax)
+    elif colorbar.lower() == 'vertical':
+        for j in range(ny):
+            ax = fig.add_axes([wf*(nx+0.05)*fudge_x, hf*fudge_y*(ny-(j+0.95)),
+                               wf*fudge_x*0.05, hf*fudge_y*0.90])
+            ax.clear()
+            cbars.append(ax)
+    return fig, tr, cbars

diff -r e9a293ee32092b2c19732f886a0f94ba9a364e22 -r 30d1bf8d7effe85074aa4142722dde348c50efd9 yt/visualization/fixed_resolution.py
--- a/yt/visualization/fixed_resolution.py
+++ b/yt/visualization/fixed_resolution.py
@@ -19,6 +19,7 @@
     y_dict, \
     axis_names
 from .volume_rendering.api import off_axis_projection
+from image_writer import write_fits
 from yt.data_objects.image_array import ImageArray
 import _MPL
 import numpy as np
@@ -263,8 +264,8 @@
             output.create_dataset(field,data=self[field])
         output.close()
 
-    def export_fits(self, filename_prefix, fields = None, clobber=False,
-                    other_keys=None, gzip_file=False, units="1"):
+    def export_fits(self, filename_prefix, fields=None, clobber=False,
+                    other_keys=None, units="cm", sky_center=(0.0,0.0), D_A=None):
 
         """
         This will export a set of FITS images of either the fields specified
@@ -273,106 +274,80 @@
         existing FITS file.
 
         This requires the *pyfits* module, which is a standalone module
-        provided by STSci to interface with FITS-format files.
+        provided by STSci to interface with FITS-format files, and is also
+        part of AstroPy.
         """
         r"""Export a set of pixelized fields to a FITS file.
 
         This will export a set of FITS images of either the fields specified
-        or all the fields already in the object.  The output filename is the
-        the specified prefix.
+        or all the fields already in the object.
 
         Parameters
         ----------
         filename_prefix : string
-            This prefix will be prepended to every FITS file name.
+            This prefix will be prepended to the FITS file name.
         fields : list of strings
             These fields will be pixelized and output.
         clobber : boolean
             If the file exists, this governs whether we will overwrite.
         other_keys : dictionary, optional
             A set of header keys and values to write into the FITS header.
-        gzip_file : boolean, optional
-            gzip the file after writing, default False
         units : string, optional
-            the length units that the coordinates are written in, default '1'
+            the length units that the coordinates are written in, default 'cm'
+            If units are set to "deg" then assume that sky coordinates are
+            requested.
+        sky_center : array_like, optional
+            Center of the image in (ra,dec) in degrees if sky coordinates
+            (units="deg") are requested.
+        D_A : float or tuple, optional
+            Angular diameter distance, given in code units as a float or
+            a tuple containing the value and the length unit. Required if
+            using sky coordinates.                                                                                            
         """
-        
-        import pyfits
-        from os import system
-        
+
+        if units == "deg" and D_A is None:
+            mylog.error("Sky coordinates require an angular diameter distance. Please specify D_A.")    
+        if iterable(D_A):
+            dist = D_A[0]/self.pf.units[D_A[1]]
+        else:
+            dist = D_A
+
+        if other_keys is None:
+            hdu_keys = {}
+        else:
+            hdu_keys = other_keys
+            
         extra_fields = ['x','y','z','px','py','pz','pdx','pdy','pdz','weight_field']
-        if filename_prefix.endswith('.fits'): filename_prefix=filename_prefix[:-5]
         if fields is None: 
             fields = [field for field in self.data_source.fields 
                       if field not in extra_fields]
 
+        coords = {}
         nx, ny = self.buff_size
-        dx = (self.bounds[1]-self.bounds[0])/nx*self.pf[units]
-        dy = (self.bounds[3]-self.bounds[2])/ny*self.pf[units]
-        xmin = self.bounds[0]*self.pf[units]
-        ymin = self.bounds[2]*self.pf[units]
-        simtime = self.pf.current_time
+        dx = (self.bounds[1]-self.bounds[0])/nx
+        dy = (self.bounds[3]-self.bounds[2])/ny
+        if units == "deg":  
+            coords["dx"] = -np.rad2deg(dx/dist)
+            coords["dy"] = np.rad2deg(dy/dist)
+            coords["xctr"] = sky_center[0]
+            coords["yctr"] = sky_center[1]
+            hdu_keys["MTYPE1"] = "EQPOS"
+            hdu_keys["MFORM1"] = "RA,DEC"
+            hdu_keys["CTYPE1"] = "RA---TAN"
+            hdu_keys["CTYPE2"] = "DEC--TAN"
+        else:
+            coords["dx"] = dx*self.pf.units[units]
+            coords["dy"] = dy*self.pf.units[units]
+            coords["xctr"] = 0.5*(self.bounds[0]+self.bounds[1])*self.pf.units[units]
+            coords["yctr"] = 0.5*(self.bounds[2]+self.bounds[3])*self.pf.units[units]
+        coords["units"] = units
+        
+        hdu_keys["Time"] = self.pf.current_time
 
-        hdus = []
-
-        first = True
-        
-        for field in fields:
-
-            if (first) :
-                hdu = pyfits.PrimaryHDU(self[field])
-                first = False
-            else :
-                hdu = pyfits.ImageHDU(self[field])
+        data = dict([(field,self[field]) for field in fields])
+        write_fits(data, filename_prefix, clobber=clobber, coords=coords,
+                   other_keys=hdu_keys)
                 
-            if self.data_source.has_key('weight_field'):
-                weightname = self.data_source._weight
-                if weightname is None: weightname = 'None'
-                field = field +'_'+weightname
-
-            hdu.header.update("Field", field)
-            hdu.header.update("Time", simtime)
-
-            hdu.header.update('WCSNAMEP', "PHYSICAL")            
-            hdu.header.update('CTYPE1P', "LINEAR")
-            hdu.header.update('CTYPE2P', "LINEAR")
-            hdu.header.update('CRPIX1P', 0.5)
-            hdu.header.update('CRPIX2P', 0.5)
-            hdu.header.update('CRVAL1P', xmin)
-            hdu.header.update('CRVAL2P', ymin)
-            hdu.header.update('CDELT1P', dx)
-            hdu.header.update('CDELT2P', dy)
-                    
-            hdu.header.update('CTYPE1', "LINEAR")
-            hdu.header.update('CTYPE2', "LINEAR")                                
-            hdu.header.update('CUNIT1', units)
-            hdu.header.update('CUNIT2', units)
-            hdu.header.update('CRPIX1', 0.5)
-            hdu.header.update('CRPIX2', 0.5)
-            hdu.header.update('CRVAL1', xmin)
-            hdu.header.update('CRVAL2', ymin)
-            hdu.header.update('CDELT1', dx)
-            hdu.header.update('CDELT2', dy)
-
-            if (other_keys is not None) :
-
-                for k,v in other_keys.items() :
-
-                    hdu.header.update(k,v)
-
-            hdus.append(hdu)
-
-            del hdu
-            
-        hdulist = pyfits.HDUList(hdus)
-
-        hdulist.writeto("%s.fits" % (filename_prefix), clobber=clobber)
-        
-        if (gzip_file) :
-            clob = ""
-            if (clobber) : clob = "-f"
-            system("gzip "+clob+" %s.fits" % (filename_prefix))
-        
     def open_in_ds9(self, field, take_log=True):
         """
         This will open a given field in the DS9 viewer.

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

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

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list