[Yt-svn] yt-commit r797 - trunk/yt/lagos

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Mon Sep 22 08:35:21 PDT 2008


Author: mturk
Date: Mon Sep 22 08:35:20 2008
New Revision: 797
URL: http://yt.spacepope.org/changeset/797

Log:
Fixed multiple fields in the Octree

Added EnzoRay, which is an arbitrary ray caster, accepting start&end points.

This code sports a warning, because I've only tested it in the orthogonal case
(where it gives alrighty results) and also because I have recruited somebody
else to help out with that.

Additionally, I found that OrthoRay wasn't returning any points if it was on a
grid boundary, which I have fixed by giving the tie-breaker to the Left side.

I'm still learning Cython, so all these Cython routines end up being a lot
faster.



Modified:
   trunk/yt/lagos/BaseDataTypes.py
   trunk/yt/lagos/DepthFirstOctree.c
   trunk/yt/lagos/DepthFirstOctree.pyx
   trunk/yt/lagos/HierarchyType.py
   trunk/yt/lagos/RTIntegrator.c
   trunk/yt/lagos/RTIntegrator.pyx
   trunk/yt/lagos/RayTracer.py

Modified: trunk/yt/lagos/BaseDataTypes.py
==============================================================================
--- trunk/yt/lagos/BaseDataTypes.py	(original)
+++ trunk/yt/lagos/BaseDataTypes.py	Mon Sep 22 08:35:20 2008
@@ -366,29 +366,90 @@
         self._refresh_data()
 
     def _get_list_of_grids(self):
-        y = na.where( (self.px > self.pf.hierarchy.gridLeftEdge[:,self.px_ax])
+        # This bugs me, but we will give the tie to the LeftEdge
+        y = na.where( (self.px >=  self.pf.hierarchy.gridLeftEdge[:,self.px_ax])
                     & (self.px < self.pf.hierarchy.gridRightEdge[:,self.px_ax])
-                    & (self.py > self.pf.hierarchy.gridLeftEdge[:,self.py_ax])
+                    & (self.py >=  self.pf.hierarchy.gridLeftEdge[:,self.py_ax])
                     & (self.py < self.pf.hierarchy.gridRightEdge[:,self.py_ax]))
         self._grids = self.hierarchy.grids[y]
 
     def _get_data_from_grid(self, grid, field):
         # We are orthogonal, so we can feel free to make assumptions
         # for the sake of speed.
-        gdx = just_one(grid[self.px_dx])
-        gdy = just_one(grid[self.py_dx])
-        x_coord = int((self.px - grid.LeftEdge[self.px_ax])/gdx)
-        y_coord = int((self.py - grid.LeftEdge[self.py_ax])/gdy)
-        sl = [None,None,None]
-        sl[self.px_ax] = slice(x_coord,x_coord+1,None)
-        sl[self.py_ax] = slice(y_coord,y_coord+1,None)
-        sl[self.axis] = slice(None)
+        if grid.id not in self._cut_masks:
+            gdx = just_one(grid[self.px_dx])
+            gdy = just_one(grid[self.py_dx])
+            x_coord = int((self.px - grid.LeftEdge[self.px_ax])/gdx)
+            y_coord = int((self.py - grid.LeftEdge[self.py_ax])/gdy)
+            sl = [None,None,None]
+            sl[self.px_ax] = slice(x_coord,x_coord+1,None)
+            sl[self.py_ax] = slice(y_coord,y_coord+1,None)
+            sl[self.axis] = slice(None)
+            self._cut_masks[grid.id] = sl
+        else:
+            sl = self._cut_masks[grid.id]
         if not iterable(grid[field]):
             gf = grid[field] * na.ones(grid.child_mask[sl].shape)
         else:
             gf = grid[field][sl]
         return gf[na.where(grid.child_mask[sl])]
 
+class EnzoRayBase(Enzo1DData):
+    def __init__(self, start_point, end_point, fields=None, pf=None, **kwargs):
+        """
+        We accept a start point and an end point and then get all the data
+        between those two.
+        """
+        mylog.warning("This code is poorly tested.  It may give bad data!")
+        Enzo1DData.__init__(self, pf, fields, **kwargs)
+        self.start_point = na.array(start_point)
+        self.end_point = na.array(end_point)
+        self.vec = self.end_point - self.start_point
+        self.center = self.start_point
+        self.set_field_parameter('center', self.start_point)
+        #self._refresh_data()
+
+    def _get_list_of_grids(self):
+        # Get the value of the line at each LeftEdge and RightEdge
+        LE = self.pf.h.gridLeftEdge
+        RE = self.pf.h.gridRightEdge
+        p = na.zeros(self.pf.h.num_grids, dtype='bool')
+        # Check left faces first
+        for i in range(3):
+            i1 = (i+1) % 3
+            i2 = (i+2) % 3
+            vs = self._get_line_at_coord(LE[:,i], i)
+            p = p | ( ( (LE[:,i1] < vs[:,i1]) & (RE[:,i1] > vs[:,i1]) ) \
+                    & ( (LE[:,i2] < vs[:,i2]) & (RE[:,i2] > vs[:,i2]) ) )
+            vs = self._get_line_at_coord(RE[:,i], i)
+            p = p | ( ( (LE[:,i1] < vs[:,i1]) & (RE[:,i1] > vs[:,i1]) ) \
+                    & ( (LE[:,i2] < vs[:,i2]) & (RE[:,i2] > vs[:,i2]) ) )
+        p = p | ( na.all( LE < self.start_point, axis=1 ) 
+                & na.all( RE > self.start_point, axis=1 ) )
+        p = p | ( na.all( LE < self.end_point,   axis=1 ) 
+                & na.all( RE > self.end_point,   axis=1 ) )
+        self._grids = self.hierarchy.grids.copy()#[p]
+
+    def _get_line_at_coord(self, v, index):
+        # t*self.vec + self.start_point = self.end_point
+        t = (v - self.start_point[index])/self.vec[index]
+        t = t.reshape((t.shape[0],1))
+        return self.start_point + t*self.vec
+
+    def _get_data_from_grid(self, grid, field):
+        mask = na.logical_and(self._get_cut_mask(grid),
+                              grid.child_mask)
+        return grid[field][mask]
+        
+    @cache_mask
+    def _get_cut_mask(self, grid):
+        mask = na.zeros(grid.ActiveDimensions, dtype='int')
+        import RTIntegrator as RT
+        RT.VoxelTraversal(mask, grid.LeftEdge, grid.RightEdge,
+                          na.array([grid.dx, grid.dy, grid.dz]),
+                          self.center, self.vec)
+        return mask
+
 class Enzo2DData(EnzoData, GridPropertiesMixin):
     _key_fields = ['px','py','pdx','pdy']
     """

Modified: trunk/yt/lagos/DepthFirstOctree.c
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.c	(original)
+++ trunk/yt/lagos/DepthFirstOctree.c	Mon Sep 22 08:35:20 2008
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.8.1.1 on Mon Sep 22 10:18:51 2008 */
+/* Generated by Cython 0.9.8.1.1 on Mon Sep 22 11:45:23 2008 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -189,6 +189,8 @@
 static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd); /*proto*/
 #define __Pyx_BufPtrStrided1d(buf, i0, s0) ((char*)buf + i0 * s0)
 #define __Pyx_BufPtrStrided3d(buf, i0, s0, i1, s1, i2, s2) ((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
+#define __Pyx_BufPtrStrided4d(buf, i0, s0, i1, s1, i2, s2, i3, s3) ((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
+#define __Pyx_BufPtrStrided2d(buf, i0, s0, i1, s1) ((char*)buf + i0 * s0 + i1 * s1)
 
 static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
 
@@ -203,8 +205,8 @@
 #define __Pyx_ReleaseBuffer PyObject_ReleaseBuffer
 #endif
 
-Py_ssize_t __Pyx_zeros[] = {0, 0, 0};
-Py_ssize_t __Pyx_minusones[] = {-1, -1, -1};
+Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0};
+Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1};
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
@@ -286,21 +288,45 @@
 
 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":30
+ * cimport cython
+ * 
+ * cdef class position:             # <<<<<<<<<<<<<<
+ *     cdef public int output_pos, refined_pos
+ * 
+ */
+
 struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_position {
   PyObject_HEAD
   int output_pos;
   int refined_pos;
 };
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":33
+ *     cdef public int output_pos, refined_pos
+ * 
+ * cdef class OctreeGrid:             # <<<<<<<<<<<<<<
+ *     cdef public object child_indices, fields, left_edges, dimensions, dx
+ *     def __cinit__(self,
+ */
+
 struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid {
   PyObject_HEAD
   PyObject *child_indices;
-  PyObject *field;
+  PyObject *fields;
   PyObject *left_edges;
   PyObject *dimensions;
   PyObject *dx;
 };
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":47
+ *         self.dx = dx
+ * 
+ * cdef class OctreeGridList:             # <<<<<<<<<<<<<<
+ *     cdef public object grids
+ *     def __cinit__(self, grids):
+ */
+
 struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList {
   PyObject_HEAD
   PyObject *grids;
@@ -357,10 +383,18 @@
 static char __pyx_k_15[] = "O";
 static char __pyx_k_16[] = "only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)";
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":35
+ * cdef class OctreeGrid:
+ *     cdef public object child_indices, fields, left_edges, dimensions, dx
+ *     def __cinit__(self,             # <<<<<<<<<<<<<<
+ *                   np.ndarray[np.int_t, ndim=3] child_indices,
+ *                   np.ndarray[np.float64_t, ndim=4] fields,
+ */
+
 static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_10OctreeGrid___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_10OctreeGrid___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_child_indices = 0;
-  PyArrayObject *__pyx_v_field = 0;
+  PyArrayObject *__pyx_v_fields = 0;
   PyArrayObject *__pyx_v_left_edges = 0;
   PyArrayObject *__pyx_v_dimensions = 0;
   PyArrayObject *__pyx_v_dx = 0;
@@ -371,13 +405,15 @@
   Py_ssize_t __pyx_bshape_0_child_indices = 0;
   Py_ssize_t __pyx_bshape_1_child_indices = 0;
   Py_ssize_t __pyx_bshape_2_child_indices = 0;
-  Py_buffer __pyx_bstruct_field;
-  Py_ssize_t __pyx_bstride_0_field = 0;
-  Py_ssize_t __pyx_bstride_1_field = 0;
-  Py_ssize_t __pyx_bstride_2_field = 0;
-  Py_ssize_t __pyx_bshape_0_field = 0;
-  Py_ssize_t __pyx_bshape_1_field = 0;
-  Py_ssize_t __pyx_bshape_2_field = 0;
+  Py_buffer __pyx_bstruct_fields;
+  Py_ssize_t __pyx_bstride_0_fields = 0;
+  Py_ssize_t __pyx_bstride_1_fields = 0;
+  Py_ssize_t __pyx_bstride_2_fields = 0;
+  Py_ssize_t __pyx_bstride_3_fields = 0;
+  Py_ssize_t __pyx_bshape_0_fields = 0;
+  Py_ssize_t __pyx_bshape_1_fields = 0;
+  Py_ssize_t __pyx_bshape_2_fields = 0;
+  Py_ssize_t __pyx_bshape_3_fields = 0;
   Py_buffer __pyx_bstruct_dx;
   Py_ssize_t __pyx_bstride_0_dx = 0;
   Py_ssize_t __pyx_bshape_0_dx = 0;
@@ -388,16 +424,16 @@
   Py_ssize_t __pyx_bstride_0_dimensions = 0;
   Py_ssize_t __pyx_bshape_0_dimensions = 0;
   int __pyx_r;
-  static char *__pyx_argnames[] = {"child_indices","field","left_edges","dimensions","dx",0};
+  static char *__pyx_argnames[] = {"child_indices","fields","left_edges","dimensions","dx",0};
   if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 5)) {
     __pyx_v_child_indices = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
-    __pyx_v_field = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
+    __pyx_v_fields = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
     __pyx_v_left_edges = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2));
     __pyx_v_dimensions = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
     __pyx_v_dx = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 4));
   }
   else {
-    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_child_indices, &__pyx_v_field, &__pyx_v_left_edges, &__pyx_v_dimensions, &__pyx_v_dx))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_child_indices, &__pyx_v_fields, &__pyx_v_left_edges, &__pyx_v_dimensions, &__pyx_v_dx))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4;
   __pyx_L3_error:;
@@ -405,16 +441,16 @@
   return -1;
   __pyx_L4:;
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child_indices), __pyx_ptype_5numpy_ndarray, 1, "child_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_5numpy_ndarray, 1, "field", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fields), __pyx_ptype_5numpy_ndarray, 1, "fields", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_child_indices = __pyx_bstruct_child_indices.strides[0]; __pyx_bstride_1_child_indices = __pyx_bstruct_child_indices.strides[1]; __pyx_bstride_2_child_indices = __pyx_bstruct_child_indices.strides[2];
   __pyx_bshape_0_child_indices = __pyx_bstruct_child_indices.shape[0]; __pyx_bshape_1_child_indices = __pyx_bstruct_child_indices.shape[1]; __pyx_bshape_2_child_indices = __pyx_bstruct_child_indices.shape[2];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_field, &__pyx_bstruct_field, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_bstride_0_field = __pyx_bstruct_field.strides[0]; __pyx_bstride_1_field = __pyx_bstruct_field.strides[1]; __pyx_bstride_2_field = __pyx_bstruct_field.strides[2];
-  __pyx_bshape_0_field = __pyx_bstruct_field.shape[0]; __pyx_bshape_1_field = __pyx_bstruct_field.shape[1]; __pyx_bshape_2_field = __pyx_bstruct_field.shape[2];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_fields = __pyx_bstruct_fields.strides[0]; __pyx_bstride_1_fields = __pyx_bstruct_fields.strides[1]; __pyx_bstride_2_fields = __pyx_bstruct_fields.strides[2]; __pyx_bstride_3_fields = __pyx_bstruct_fields.strides[3];
+  __pyx_bshape_0_fields = __pyx_bstruct_fields.shape[0]; __pyx_bshape_1_fields = __pyx_bstruct_fields.shape[1]; __pyx_bshape_2_fields = __pyx_bstruct_fields.shape[2]; __pyx_bshape_3_fields = __pyx_bstruct_fields.shape[3];
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_left_edges, &__pyx_bstruct_left_edges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_left_edges = __pyx_bstruct_left_edges.strides[0];
   __pyx_bshape_0_left_edges = __pyx_bstruct_left_edges.shape[0];
@@ -424,18 +460,58 @@
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_dx = __pyx_bstruct_dx.strides[0];
   __pyx_bshape_0_dx = __pyx_bstruct_dx.shape[0];
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":41
+ *                   np.ndarray[np.int_t, ndim=1] dimensions,
+ *                   np.ndarray[np.float64_t, ndim=1] dx):
+ *         self.child_indices = child_indices             # <<<<<<<<<<<<<<
+ *         self.fields = fields
+ *         self.left_edges = left_edges
+ */
   Py_INCREF(((PyObject *)__pyx_v_child_indices));
   Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->child_indices);
   ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->child_indices = ((PyObject *)__pyx_v_child_indices);
-  Py_INCREF(((PyObject *)__pyx_v_field));
-  Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->field);
-  ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->field = ((PyObject *)__pyx_v_field);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":42
+ *                   np.ndarray[np.float64_t, ndim=1] dx):
+ *         self.child_indices = child_indices
+ *         self.fields = fields             # <<<<<<<<<<<<<<
+ *         self.left_edges = left_edges
+ *         self.dimensions = dimensions
+ */
+  Py_INCREF(((PyObject *)__pyx_v_fields));
+  Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->fields);
+  ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->fields = ((PyObject *)__pyx_v_fields);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":43
+ *         self.child_indices = child_indices
+ *         self.fields = fields
+ *         self.left_edges = left_edges             # <<<<<<<<<<<<<<
+ *         self.dimensions = dimensions
+ *         self.dx = dx
+ */
   Py_INCREF(((PyObject *)__pyx_v_left_edges));
   Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->left_edges);
   ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->left_edges = ((PyObject *)__pyx_v_left_edges);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":44
+ *         self.fields = fields
+ *         self.left_edges = left_edges
+ *         self.dimensions = dimensions             # <<<<<<<<<<<<<<
+ *         self.dx = dx
+ * 
+ */
   Py_INCREF(((PyObject *)__pyx_v_dimensions));
   Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dimensions);
   ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dimensions = ((PyObject *)__pyx_v_dimensions);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":45
+ *         self.left_edges = left_edges
+ *         self.dimensions = dimensions
+ *         self.dx = dx             # <<<<<<<<<<<<<<
+ * 
+ * cdef class OctreeGridList:
+ */
   Py_INCREF(((PyObject *)__pyx_v_dx));
   Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dx);
   ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dx = ((PyObject *)__pyx_v_dx);
@@ -446,7 +522,7 @@
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     PyErr_Fetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
-    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_field, &__pyx_bstruct_field);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_left_edges, &__pyx_bstruct_left_edges);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
@@ -456,7 +532,7 @@
   goto __pyx_L2;
   __pyx_L0:;
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
-  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_field, &__pyx_bstruct_field);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_left_edges, &__pyx_bstruct_left_edges);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
@@ -464,6 +540,14 @@
   return __pyx_r;
 }
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":49
+ * cdef class OctreeGridList:
+ *     cdef public object grids
+ *     def __cinit__(self, grids):             # <<<<<<<<<<<<<<
+ *         self.grids = grids
+ * 
+ */
+
 static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_grids = 0;
@@ -480,6 +564,14 @@
   __Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__cinit__");
   return -1;
   __pyx_L4:;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":50
+ *     cdef public object grids
+ *     def __cinit__(self, grids):
+ *         self.grids = grids             # <<<<<<<<<<<<<<
+ * 
+ *     def __getitem__(self, int item):
+ */
   Py_INCREF(__pyx_v_grids);
   Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)__pyx_v_self)->grids);
   ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)__pyx_v_self)->grids = __pyx_v_grids;
@@ -488,6 +580,14 @@
   return __pyx_r;
 }
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":52
+ *         self.grids = grids
+ * 
+ *     def __getitem__(self, int item):             # <<<<<<<<<<<<<<
+ *         return self.grids[item]
+ * 
+ */
+
 static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_item); /*proto*/
 static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_item) {
   int __pyx_v_item;
@@ -501,6 +601,14 @@
   __Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__getitem__");
   return NULL;
   __pyx_L4:;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":53
+ * 
+ *     def __getitem__(self, int item):
+ *         return self.grids[item]             # <<<<<<<<<<<<<<
+ * 
+ * @cython.boundscheck(False)
+ */
   __pyx_1 = __Pyx_GetItemInt(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)__pyx_v_self)->grids, __pyx_v_item, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_1;
   __pyx_1 = 0;
@@ -516,6 +624,14 @@
   return __pyx_r;
 }
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":56
+ * 
+ * @cython.boundscheck(False)
+ * def WalkRootgrid(np.ndarray[np.float64_t, ndim=2] output,             # <<<<<<<<<<<<<<
+ *                  np.ndarray[np.int_t, ndim=1] refined,
+ *                  OctreeGridList grids, int pi, int s = 0, int r = 0):
+ */
+
 static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_WalkRootgrid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_2yt_5lagos_16DepthFirstOctree_WalkRootgrid[] = "\n    This function only gets called on a 'root grid' -- a base grid\n    of the simulation we are converting.  It will call a recursive walker.\n    ";
 static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_WalkRootgrid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -529,6 +645,7 @@
   int __pyx_v_j;
   int __pyx_v_k;
   int __pyx_v_gi;
+  int __pyx_v_fi;
   int __pyx_v_child_i;
   int __pyx_v_child_j;
   int __pyx_v_child_k;
@@ -536,7 +653,7 @@
   struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *__pyx_v_grid = 0;
   PyArrayObject *__pyx_v_child_indices = 0;
   PyArrayObject *__pyx_v_dimensions = 0;
-  PyArrayObject *__pyx_v_field = 0;
+  PyArrayObject *__pyx_v_fields = 0;
   PyArrayObject *__pyx_v_leftedges = 0;
   PyArrayObject *__pyx_v_dx = 0;
   PyArrayObject *__pyx_v_child_dx;
@@ -557,13 +674,6 @@
   Py_buffer __pyx_bstruct_child_dx;
   Py_ssize_t __pyx_bstride_0_child_dx = 0;
   Py_ssize_t __pyx_bshape_0_child_dx = 0;
-  Py_buffer __pyx_bstruct_field;
-  Py_ssize_t __pyx_bstride_0_field = 0;
-  Py_ssize_t __pyx_bstride_1_field = 0;
-  Py_ssize_t __pyx_bstride_2_field = 0;
-  Py_ssize_t __pyx_bshape_0_field = 0;
-  Py_ssize_t __pyx_bshape_1_field = 0;
-  Py_ssize_t __pyx_bshape_2_field = 0;
   Py_buffer __pyx_bstruct_child_leftedges;
   Py_ssize_t __pyx_bstride_0_child_leftedges = 0;
   Py_ssize_t __pyx_bshape_0_child_leftedges = 0;
@@ -574,9 +684,20 @@
   Py_ssize_t __pyx_bshape_0_child_indices = 0;
   Py_ssize_t __pyx_bshape_1_child_indices = 0;
   Py_ssize_t __pyx_bshape_2_child_indices = 0;
+  Py_buffer __pyx_bstruct_fields;
+  Py_ssize_t __pyx_bstride_0_fields = 0;
+  Py_ssize_t __pyx_bstride_1_fields = 0;
+  Py_ssize_t __pyx_bstride_2_fields = 0;
+  Py_ssize_t __pyx_bstride_3_fields = 0;
+  Py_ssize_t __pyx_bshape_0_fields = 0;
+  Py_ssize_t __pyx_bshape_1_fields = 0;
+  Py_ssize_t __pyx_bshape_2_fields = 0;
+  Py_ssize_t __pyx_bshape_3_fields = 0;
   Py_buffer __pyx_bstruct_output;
   Py_ssize_t __pyx_bstride_0_output = 0;
+  Py_ssize_t __pyx_bstride_1_output = 0;
   Py_ssize_t __pyx_bshape_0_output = 0;
+  Py_ssize_t __pyx_bshape_1_output = 0;
   PyObject *__pyx_r;
   long __pyx_1;
   PyObject *__pyx_2 = 0;
@@ -586,13 +707,14 @@
   __pyx_t_5numpy_int_t __pyx_6;
   __pyx_t_5numpy_int_t __pyx_7;
   int __pyx_8;
-  __pyx_t_5numpy_float64_t __pyx_9;
-  PyObject *__pyx_10 = 0;
-  int __pyx_11;
-  PyObject *__pyx_12 = 0;
+  npy_intp __pyx_9;
+  __pyx_t_5numpy_float64_t __pyx_10;
+  PyObject *__pyx_11 = 0;
+  int __pyx_12;
   PyObject *__pyx_13 = 0;
   PyObject *__pyx_14 = 0;
   PyObject *__pyx_15 = 0;
+  PyObject *__pyx_16 = 0;
   PyArrayObject *__pyx_t_1 = NULL;
   PyArrayObject *__pyx_t_2 = NULL;
   PyArrayObject *__pyx_t_3 = NULL;
@@ -610,18 +732,20 @@
   int __pyx_t_15;
   int __pyx_t_16;
   int __pyx_t_17;
-  PyArrayObject *__pyx_t_18 = NULL;
+  int __pyx_t_18;
   int __pyx_t_19;
-  PyObject *__pyx_t_20 = NULL;
-  PyObject *__pyx_t_21 = NULL;
+  PyArrayObject *__pyx_t_20 = NULL;
+  int __pyx_t_21;
   PyObject *__pyx_t_22 = NULL;
-  PyArrayObject *__pyx_t_23 = NULL;
-  long __pyx_t_24;
-  long __pyx_t_25;
+  PyObject *__pyx_t_23 = NULL;
+  PyObject *__pyx_t_24 = NULL;
+  PyArrayObject *__pyx_t_25 = NULL;
   long __pyx_t_26;
   long __pyx_t_27;
   long __pyx_t_28;
   long __pyx_t_29;
+  long __pyx_t_30;
+  long __pyx_t_31;
   static char *__pyx_argnames[] = {"output","refined","grids","pi","s","r",0};
   __pyx_self = __pyx_self;
   __pyx_v_s = 0;
@@ -649,7 +773,7 @@
   __pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)Py_None); Py_INCREF(Py_None);
   __pyx_bstruct_child_indices.buf = NULL;
   __pyx_bstruct_dimensions.buf = NULL;
-  __pyx_bstruct_field.buf = NULL;
+  __pyx_bstruct_fields.buf = NULL;
   __pyx_bstruct_leftedges.buf = NULL;
   __pyx_bstruct_dx.buf = NULL;
   __pyx_v_child_dx = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
@@ -660,17 +784,33 @@
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refined), __pyx_ptype_5numpy_ndarray, 1, "refined", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGridList, 1, "grids", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
-  __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_output = __pyx_bstruct_output.strides[0]; __pyx_bstride_1_output = __pyx_bstruct_output.strides[1];
+  __pyx_bshape_0_output = __pyx_bstruct_output.shape[0]; __pyx_bshape_1_output = __pyx_bstruct_output.shape[1];
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_refined = __pyx_bstruct_refined.strides[0];
   __pyx_bshape_0_refined = __pyx_bstruct_refined.shape[0];
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":66
+ *     cdef int child_i, child_j, child_k
+ *     cdef OctreeGrid child_grid
+ *     cdef OctreeGrid grid = grids[pi-1]             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ */
   __pyx_1 = (__pyx_v_pi - 1);
   __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_2);
   __pyx_2 = 0;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":67
+ *     cdef OctreeGrid child_grid
+ *     cdef OctreeGrid grid = grids[pi-1]
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ */
   if (!(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_1 = ((PyArrayObject *)__pyx_v_grid->child_indices);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_t_1, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {
@@ -682,6 +822,14 @@
   __pyx_t_1 = 0;
   Py_INCREF(__pyx_v_grid->child_indices);
   __pyx_v_child_indices = ((PyArrayObject *)__pyx_v_grid->child_indices);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":68
+ *     cdef OctreeGrid grid = grids[pi-1]
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ */
   if (!(__Pyx_TypeTest(__pyx_v_grid->dimensions, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_2 = ((PyArrayObject *)__pyx_v_grid->dimensions);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_t_2, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
@@ -693,17 +841,33 @@
   __pyx_t_2 = 0;
   Py_INCREF(__pyx_v_grid->dimensions);
   __pyx_v_dimensions = ((PyArrayObject *)__pyx_v_grid->dimensions);
-  if (!(__Pyx_TypeTest(__pyx_v_grid->field, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = ((PyArrayObject *)__pyx_v_grid->field);
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_field, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {
-    __pyx_v_field = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_field.buf = NULL;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":69
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ *     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx
+ */
+  if (!(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = ((PyArrayObject *)__pyx_v_grid->fields);
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4) == -1)) {
+    __pyx_v_fields = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_fields.buf = NULL;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  } else {__pyx_bstride_0_field = __pyx_bstruct_field.strides[0]; __pyx_bstride_1_field = __pyx_bstruct_field.strides[1]; __pyx_bstride_2_field = __pyx_bstruct_field.strides[2];
-    __pyx_bshape_0_field = __pyx_bstruct_field.shape[0]; __pyx_bshape_1_field = __pyx_bstruct_field.shape[1]; __pyx_bshape_2_field = __pyx_bstruct_field.shape[2];
+  } else {__pyx_bstride_0_fields = __pyx_bstruct_fields.strides[0]; __pyx_bstride_1_fields = __pyx_bstruct_fields.strides[1]; __pyx_bstride_2_fields = __pyx_bstruct_fields.strides[2]; __pyx_bstride_3_fields = __pyx_bstruct_fields.strides[3];
+    __pyx_bshape_0_fields = __pyx_bstruct_fields.shape[0]; __pyx_bshape_1_fields = __pyx_bstruct_fields.shape[1]; __pyx_bshape_2_fields = __pyx_bstruct_fields.shape[2]; __pyx_bshape_3_fields = __pyx_bstruct_fields.shape[3];
   }
   __pyx_t_3 = 0;
-  Py_INCREF(__pyx_v_grid->field);
-  __pyx_v_field = ((PyArrayObject *)__pyx_v_grid->field);
+  Py_INCREF(__pyx_v_grid->fields);
+  __pyx_v_fields = ((PyArrayObject *)__pyx_v_grid->fields);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":70
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_dx
+ */
   if (!(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_4 = ((PyArrayObject *)__pyx_v_grid->left_edges);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
@@ -715,6 +879,14 @@
   __pyx_t_4 = 0;
   Py_INCREF(__pyx_v_grid->left_edges);
   __pyx_v_leftedges = ((PyArrayObject *)__pyx_v_grid->left_edges);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":71
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ *     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_dx
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
+ */
   if (!(__Pyx_TypeTest(__pyx_v_grid->dx, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_5 = ((PyArrayObject *)__pyx_v_grid->dx);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_5, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
@@ -726,26 +898,82 @@
   __pyx_t_5 = 0;
   Py_INCREF(__pyx_v_grid->dx);
   __pyx_v_dx = ((PyArrayObject *)__pyx_v_grid->dx);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":75
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
+ *     cdef position curpos
+ *     curpos.output_pos = s             # <<<<<<<<<<<<<<
+ *     curpos.refined_pos = r
+ *     for k in range(dimensions[2]):
+ */
   __pyx_v_curpos->output_pos = __pyx_v_s;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":76
+ *     cdef position curpos
+ *     curpos.output_pos = s
+ *     curpos.refined_pos = r             # <<<<<<<<<<<<<<
+ *     for k in range(dimensions[2]):
+ *         print k
+ */
   __pyx_v_curpos->refined_pos = __pyx_v_r;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":77
+ *     curpos.output_pos = s
+ *     curpos.refined_pos = r
+ *     for k in range(dimensions[2]):             # <<<<<<<<<<<<<<
+ *         print k
+ *         for j in range(dimensions[1]):
+ */
   __pyx_t_6 = 2;
   if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_bshape_0_dimensions;
   __pyx_3 = *((__pyx_t_5numpy_int_t *)((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_dimensions.buf, __pyx_t_6, __pyx_bstride_0_dimensions)));
   for (__pyx_v_k = 0; __pyx_v_k < __pyx_3; __pyx_v_k+=1) {
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":78
+ *     curpos.refined_pos = r
+ *     for k in range(dimensions[2]):
+ *         print k             # <<<<<<<<<<<<<<
+ *         for j in range(dimensions[1]):
+ *             for i in range(dimensions[0]):
+ */
     __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
     __pyx_2 = 0;
     if (__Pyx_Print(((PyObject *)__pyx_4), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":79
+ *     for k in range(dimensions[2]):
+ *         print k
+ *         for j in range(dimensions[1]):             # <<<<<<<<<<<<<<
+ *             for i in range(dimensions[0]):
+ *                 gi = child_indices[i,j,k]
+ */
     __pyx_t_7 = 1;
     if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_bshape_0_dimensions;
     __pyx_5 = *((__pyx_t_5numpy_int_t *)((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_dimensions.buf, __pyx_t_7, __pyx_bstride_0_dimensions)));
     for (__pyx_v_j = 0; __pyx_v_j < __pyx_5; __pyx_v_j+=1) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":80
+ *         print k
+ *         for j in range(dimensions[1]):
+ *             for i in range(dimensions[0]):             # <<<<<<<<<<<<<<
+ *                 gi = child_indices[i,j,k]
+ *                 if gi == -1:
+ */
       __pyx_t_8 = 0;
       if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_bshape_0_dimensions;
       __pyx_6 = *((__pyx_t_5numpy_int_t *)((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_dimensions.buf, __pyx_t_8, __pyx_bstride_0_dimensions)));
       for (__pyx_v_i = 0; __pyx_v_i < __pyx_6; __pyx_v_i+=1) {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":81
+ *         for j in range(dimensions[1]):
+ *             for i in range(dimensions[0]):
+ *                 gi = child_indices[i,j,k]             # <<<<<<<<<<<<<<
+ *                 if gi == -1:
+ *                     for fi in range(fields.shape[0]):
+ */
         __pyx_t_9 = __pyx_v_i;
         __pyx_t_10 = __pyx_v_j;
         __pyx_t_11 = __pyx_v_k;
@@ -754,173 +982,300 @@
         if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_bshape_2_child_indices;
         __pyx_7 = *((__pyx_t_5numpy_int_t *)((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided3d(__pyx_bstruct_child_indices.buf, __pyx_t_9, __pyx_bstride_0_child_indices, __pyx_t_10, __pyx_bstride_1_child_indices, __pyx_t_11, __pyx_bstride_2_child_indices)));
         __pyx_v_gi = __pyx_7;
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":82
+ *             for i in range(dimensions[0]):
+ *                 gi = child_indices[i,j,k]
+ *                 if gi == -1:             # <<<<<<<<<<<<<<
+ *                     for fi in range(fields.shape[0]):
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ */
         __pyx_8 = (__pyx_v_gi == -1);
         if (__pyx_8) {
-          __pyx_t_12 = __pyx_v_i;
-          __pyx_t_13 = __pyx_v_j;
-          __pyx_t_14 = __pyx_v_k;
-          if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_0_field;
-          if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_bshape_1_field;
-          if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_bshape_2_field;
-          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided3d(__pyx_bstruct_field.buf, __pyx_t_12, __pyx_bstride_0_field, __pyx_t_13, __pyx_bstride_1_field, __pyx_t_14, __pyx_bstride_2_field)));
-          __pyx_t_15 = __pyx_v_curpos->output_pos;
-          if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_output;
-          *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_output.buf, __pyx_t_15, __pyx_bstride_0_output)) = __pyx_9;
-          __pyx_t_16 = __pyx_v_curpos->refined_pos;
-          if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_0_refined;
-          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_16, __pyx_bstride_0_refined)) = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":83
+ *                 gi = child_indices[i,j,k]
+ *                 if gi == -1:
+ *                     for fi in range(fields.shape[0]):             # <<<<<<<<<<<<<<
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ *                     refined[curpos.refined_pos] = 0
+ */
+          __pyx_9 = (__pyx_v_fields->dimensions[0]);
+          for (__pyx_v_fi = 0; __pyx_v_fi < __pyx_9; __pyx_v_fi+=1) {
+
+            /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":84
+ *                 if gi == -1:
+ *                     for fi in range(fields.shape[0]):
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]             # <<<<<<<<<<<<<<
+ *                     refined[curpos.refined_pos] = 0
+ *                     curpos.output_pos += 1
+ */
+            __pyx_t_12 = __pyx_v_fi;
+            __pyx_t_13 = __pyx_v_i;
+            __pyx_t_14 = __pyx_v_j;
+            __pyx_t_15 = __pyx_v_k;
+            if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_0_fields;
+            if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_bshape_1_fields;
+            if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_bshape_2_fields;
+            if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_3_fields;
+            __pyx_10 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided4d(__pyx_bstruct_fields.buf, __pyx_t_12, __pyx_bstride_0_fields, __pyx_t_13, __pyx_bstride_1_fields, __pyx_t_14, __pyx_bstride_2_fields, __pyx_t_15, __pyx_bstride_3_fields)));
+            __pyx_t_16 = __pyx_v_curpos->output_pos;
+            __pyx_t_17 = __pyx_v_fi;
+            if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_0_output;
+            if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_1_output;
+            *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_output.buf, __pyx_t_16, __pyx_bstride_0_output, __pyx_t_17, __pyx_bstride_1_output)) = __pyx_10;
+          }
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":85
+ *                     for fi in range(fields.shape[0]):
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ *                     refined[curpos.refined_pos] = 0             # <<<<<<<<<<<<<<
+ *                     curpos.output_pos += 1
+ *                     curpos.refined_pos += 1
+ */
+          __pyx_t_18 = __pyx_v_curpos->refined_pos;
+          if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_bshape_0_refined;
+          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_18, __pyx_bstride_0_refined)) = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":86
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ *                     refined[curpos.refined_pos] = 0
+ *                     curpos.output_pos += 1             # <<<<<<<<<<<<<<
+ *                     curpos.refined_pos += 1
+ *                 else:
+ */
           __pyx_v_curpos->output_pos += 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":87
+ *                     refined[curpos.refined_pos] = 0
+ *                     curpos.output_pos += 1
+ *                     curpos.refined_pos += 1             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     refined[curpos.refined_pos] = 1
+ */
           __pyx_v_curpos->refined_pos += 1;
           goto __pyx_L11;
         }
         /*else*/ {
-          __pyx_t_17 = __pyx_v_curpos->refined_pos;
-          if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_0_refined;
-          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_17, __pyx_bstride_0_refined)) = 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":89
+ *                     curpos.refined_pos += 1
+ *                 else:
+ *                     refined[curpos.refined_pos] = 1             # <<<<<<<<<<<<<<
+ *                     curpos.refined_pos += 1
+ *                     child_grid = grids[gi-1]
+ */
+          __pyx_t_19 = __pyx_v_curpos->refined_pos;
+          if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_bshape_0_refined;
+          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_19, __pyx_bstride_0_refined)) = 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":90
+ *                 else:
+ *                     refined[curpos.refined_pos] = 1
+ *                     curpos.refined_pos += 1             # <<<<<<<<<<<<<<
+ *                     child_grid = grids[gi-1]
+ *                     child_dx = child_grid.dx
+ */
           __pyx_v_curpos->refined_pos += 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":91
+ *                     refined[curpos.refined_pos] = 1
+ *                     curpos.refined_pos += 1
+ *                     child_grid = grids[gi-1]             # <<<<<<<<<<<<<<
+ *                     child_dx = child_grid.dx
+ *                     child_leftedges = child_grid.left_edges
+ */
           __pyx_1 = (__pyx_v_gi - 1);
-          __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(((PyObject *)__pyx_v_child_grid));
           __pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_2);
           __pyx_2 = 0;
-          if (!(__Pyx_TypeTest(__pyx_v_child_grid->dx, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_18 = ((PyArrayObject *)__pyx_v_child_grid->dx);
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":92
+ *                     curpos.refined_pos += 1
+ *                     child_grid = grids[gi-1]
+ *                     child_dx = child_grid.dx             # <<<<<<<<<<<<<<
+ *                     child_leftedges = child_grid.left_edges
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ */
+          if (!(__Pyx_TypeTest(__pyx_v_child_grid->dx, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_20 = ((PyArrayObject *)__pyx_v_child_grid->dx);
           __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx);
-          __pyx_t_19 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_18, &__pyx_bstruct_child_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1);
-          if (unlikely(__pyx_t_19 < 0)) 
+          __pyx_t_21 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_20, &__pyx_bstruct_child_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1);
+          if (unlikely(__pyx_t_21 < 0)) 
           {
-              PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
+              PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
               if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
-                  Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
+                  Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
                   __Pyx_RaiseBufferFallbackError();
                 } else {
-                  PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
+                  PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
               }
           }
           __pyx_bstride_0_child_dx = __pyx_bstruct_child_dx.strides[0];
           __pyx_bshape_0_child_dx = __pyx_bstruct_child_dx.shape[0];
-          if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_18 = 0;
+          if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_20 = 0;
           Py_INCREF(__pyx_v_child_grid->dx);
           Py_DECREF(((PyObject *)__pyx_v_child_dx));
           __pyx_v_child_dx = ((PyArrayObject *)__pyx_v_child_grid->dx);
-          if (!(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_23 = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":93
+ *                     child_grid = grids[gi-1]
+ *                     child_dx = child_grid.dx
+ *                     child_leftedges = child_grid.left_edges             # <<<<<<<<<<<<<<
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ */
+          if (!(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_25 = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
           __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
-          __pyx_t_19 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_23, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1);
-          if (unlikely(__pyx_t_19 < 0)) 
+          __pyx_t_21 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_25, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1);
+          if (unlikely(__pyx_t_21 < 0)) 
           {
-              PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
+              PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
               if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
-                  Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
+                  Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
                   __Pyx_RaiseBufferFallbackError();
                 } else {
-                  PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
+                  PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
               }
           }
           __pyx_bstride_0_child_leftedges = __pyx_bstruct_child_leftedges.strides[0];
           __pyx_bshape_0_child_leftedges = __pyx_bstruct_child_leftedges.shape[0];
-          if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_23 = 0;
+          if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_25 = 0;
           Py_INCREF(__pyx_v_child_grid->left_edges);
           Py_DECREF(((PyObject *)__pyx_v_child_leftedges));
           __pyx_v_child_leftedges = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
-          __pyx_t_24 = 0;
-          if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_0_leftedges;
-          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_24, __pyx_bstride_0_leftedges)));
-          __pyx_4 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_10 = PyNumber_Multiply(__pyx_2, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":94
+ *                     child_dx = child_grid.dx
+ *                     child_leftedges = child_grid.left_edges
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx             # <<<<<<<<<<<<<<
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx
+ */
+          __pyx_t_26 = 0;
+          if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_0_leftedges;
+          __pyx_10 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_26, __pyx_bstride_0_leftedges)));
+          __pyx_4 = PyFloat_FromDouble(__pyx_10); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_11 = PyNumber_Multiply(__pyx_2, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_2 = PyNumber_Add(__pyx_4, __pyx_10); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyNumber_Add(__pyx_4, __pyx_11); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
-          __pyx_t_25 = 0;
-          if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_0_child_leftedges;
-          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_25, __pyx_bstride_0_child_leftedges)));
-          __pyx_4 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_10 = PyNumber_Subtract(__pyx_2, __pyx_4); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
+          __pyx_t_27 = 0;
+          if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_0_child_leftedges;
+          __pyx_10 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_27, __pyx_bstride_0_child_leftedges)));
+          __pyx_4 = PyFloat_FromDouble(__pyx_10); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_11 = PyNumber_Subtract(__pyx_2, __pyx_4); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
           Py_DECREF(__pyx_4); __pyx_4 = 0;
-          __pyx_2 = __Pyx_PyNumber_Divide(__pyx_10, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
-          __pyx_11 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = __Pyx_PyNumber_Divide(__pyx_11, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
+          __pyx_12 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_v_child_i = __pyx_11;
-          __pyx_t_26 = 1;
-          if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_0_leftedges;
-          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_26, __pyx_bstride_0_leftedges)));
-          __pyx_4 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_10 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyNumber_Multiply(__pyx_10, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
-          __pyx_10 = PyNumber_Add(__pyx_4, __pyx_2); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_v_child_i = __pyx_12;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":95
+ *                     child_leftedges = child_grid.left_edges
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx             # <<<<<<<<<<<<<<
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx
+ *                     RecurseOctree(child_i, child_j, child_k, curpos, gi, pi, output, refined, grids)
+ */
+          __pyx_t_28 = 1;
+          if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_0_leftedges;
+          __pyx_10 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_28, __pyx_bstride_0_leftedges)));
+          __pyx_4 = PyFloat_FromDouble(__pyx_10); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_11 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyNumber_Multiply(__pyx_11, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
+          __pyx_11 = PyNumber_Add(__pyx_4, __pyx_2); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_t_27 = 1;
-          if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_0_child_leftedges;
-          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_27, __pyx_bstride_0_child_leftedges)));
-          __pyx_4 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyNumber_Subtract(__pyx_10, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
+          __pyx_t_29 = 1;
+          if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_bshape_0_child_leftedges;
+          __pyx_10 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_29, __pyx_bstride_0_child_leftedges)));
+          __pyx_4 = PyFloat_FromDouble(__pyx_10); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyNumber_Subtract(__pyx_11, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
           Py_DECREF(__pyx_4); __pyx_4 = 0;
-          __pyx_10 = __Pyx_PyNumber_Divide(__pyx_2, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_11 = __Pyx_PyNumber_Divide(__pyx_2, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_11 = __pyx_PyInt_int(__pyx_10); if (unlikely((__pyx_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
-          __pyx_v_child_j = __pyx_11;
-          __pyx_t_28 = 2;
-          if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_0_leftedges;
-          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_28, __pyx_bstride_0_leftedges)));
-          __pyx_4 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_10 = PyNumber_Multiply(__pyx_2, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_12 = __pyx_PyInt_int(__pyx_11); if (unlikely((__pyx_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
+          __pyx_v_child_j = __pyx_12;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":96
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx             # <<<<<<<<<<<<<<
+ *                     RecurseOctree(child_i, child_j, child_k, curpos, gi, pi, output, refined, grids)
+ * 
+ */
+          __pyx_t_30 = 2;
+          if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_bshape_0_leftedges;
+          __pyx_10 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_30, __pyx_bstride_0_leftedges)));
+          __pyx_4 = PyFloat_FromDouble(__pyx_10); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_11 = PyNumber_Multiply(__pyx_2, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_2 = PyNumber_Add(__pyx_4, __pyx_10); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyNumber_Add(__pyx_4, __pyx_11); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
-          __pyx_t_29 = 2;
-          if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_bshape_0_child_leftedges;
-          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_29, __pyx_bstride_0_child_leftedges)));
-          __pyx_4 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_10 = PyNumber_Subtract(__pyx_2, __pyx_4); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
+          __pyx_t_31 = 2;
+          if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_bshape_0_child_leftedges;
+          __pyx_10 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_31, __pyx_bstride_0_child_leftedges)));
+          __pyx_4 = PyFloat_FromDouble(__pyx_10); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_11 = PyNumber_Subtract(__pyx_2, __pyx_4); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
           Py_DECREF(__pyx_4); __pyx_4 = 0;
-          __pyx_2 = __Pyx_PyNumber_Divide(__pyx_10, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
-          __pyx_11 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = __Pyx_PyNumber_Divide(__pyx_11, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
+          __pyx_12 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_v_child_k = __pyx_11;
-          __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_RecurseOctree); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_10 = PyInt_FromLong(__pyx_v_child_i); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyInt_FromLong(__pyx_v_child_j); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_12 = PyInt_FromLong(__pyx_v_child_k); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_13 = PyInt_FromLong(__pyx_v_gi); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_14 = PyInt_FromLong(__pyx_v_pi); if (unlikely(!__pyx_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_15 = PyTuple_New(9); if (unlikely(!__pyx_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          PyTuple_SET_ITEM(__pyx_15, 0, __pyx_10);
-          PyTuple_SET_ITEM(__pyx_15, 1, __pyx_2);
-          PyTuple_SET_ITEM(__pyx_15, 2, __pyx_12);
+          __pyx_v_child_k = __pyx_12;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":97
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx
+ *                     RecurseOctree(child_i, child_j, child_k, curpos, gi, pi, output, refined, grids)             # <<<<<<<<<<<<<<
+ * 
+ * @cython.boundscheck(False)
+ */
+          __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_RecurseOctree); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_11 = PyInt_FromLong(__pyx_v_child_i); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyInt_FromLong(__pyx_v_child_j); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_13 = PyInt_FromLong(__pyx_v_child_k); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_14 = PyInt_FromLong(__pyx_v_gi); if (unlikely(!__pyx_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_15 = PyInt_FromLong(__pyx_v_pi); if (unlikely(!__pyx_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_16 = PyTuple_New(9); if (unlikely(!__pyx_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          PyTuple_SET_ITEM(__pyx_16, 0, __pyx_11);
+          PyTuple_SET_ITEM(__pyx_16, 1, __pyx_2);
+          PyTuple_SET_ITEM(__pyx_16, 2, __pyx_13);
           Py_INCREF(((PyObject *)__pyx_v_curpos));
-          PyTuple_SET_ITEM(__pyx_15, 3, ((PyObject *)__pyx_v_curpos));
-          PyTuple_SET_ITEM(__pyx_15, 4, __pyx_13);
-          PyTuple_SET_ITEM(__pyx_15, 5, __pyx_14);
+          PyTuple_SET_ITEM(__pyx_16, 3, ((PyObject *)__pyx_v_curpos));
+          PyTuple_SET_ITEM(__pyx_16, 4, __pyx_14);
+          PyTuple_SET_ITEM(__pyx_16, 5, __pyx_15);
           Py_INCREF(((PyObject *)__pyx_v_output));
-          PyTuple_SET_ITEM(__pyx_15, 6, ((PyObject *)__pyx_v_output));
+          PyTuple_SET_ITEM(__pyx_16, 6, ((PyObject *)__pyx_v_output));
           Py_INCREF(((PyObject *)__pyx_v_refined));
-          PyTuple_SET_ITEM(__pyx_15, 7, ((PyObject *)__pyx_v_refined));
+          PyTuple_SET_ITEM(__pyx_16, 7, ((PyObject *)__pyx_v_refined));
           Py_INCREF(((PyObject *)__pyx_v_grids));
-          PyTuple_SET_ITEM(__pyx_15, 8, ((PyObject *)__pyx_v_grids));
-          __pyx_10 = 0;
+          PyTuple_SET_ITEM(__pyx_16, 8, ((PyObject *)__pyx_v_grids));
+          __pyx_11 = 0;
           __pyx_2 = 0;
-          __pyx_12 = 0;
           __pyx_13 = 0;
           __pyx_14 = 0;
-          __pyx_10 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_15), NULL); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_15 = 0;
+          __pyx_11 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_16), NULL); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
-          Py_DECREF(((PyObject *)__pyx_15)); __pyx_15 = 0;
-          Py_DECREF(__pyx_10); __pyx_10 = 0;
+          Py_DECREF(((PyObject *)__pyx_16)); __pyx_16 = 0;
+          Py_DECREF(__pyx_11); __pyx_11 = 0;
         }
         __pyx_L11:;
       }
@@ -932,11 +1287,11 @@
   __pyx_L1_error:;
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_4);
-  Py_XDECREF(__pyx_10);
-  Py_XDECREF(__pyx_12);
+  Py_XDECREF(__pyx_11);
   Py_XDECREF(__pyx_13);
   Py_XDECREF(__pyx_14);
   Py_XDECREF(__pyx_15);
+  Py_XDECREF(__pyx_16);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     PyErr_Fetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_leftedges, &__pyx_bstruct_leftedges);
@@ -944,9 +1299,9 @@
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx);
-    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_field, &__pyx_bstruct_field);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
   PyErr_Restore(__pyx_type, __pyx_value, __pyx_tb);}
   __Pyx_AddTraceback("yt.lagos.DepthFirstOctree.WalkRootgrid");
@@ -958,16 +1313,16 @@
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx);
-  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_field, &__pyx_bstruct_field);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
   __pyx_L2:;
   Py_DECREF(__pyx_v_child_grid);
   Py_XDECREF(__pyx_v_grid);
   Py_XDECREF(__pyx_v_child_indices);
   Py_XDECREF(__pyx_v_dimensions);
-  Py_XDECREF(__pyx_v_field);
+  Py_XDECREF(__pyx_v_fields);
   Py_XDECREF(__pyx_v_leftedges);
   Py_XDECREF(__pyx_v_dx);
   Py_DECREF(__pyx_v_child_dx);
@@ -976,6 +1331,14 @@
   return __pyx_r;
 }
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":100
+ * 
+ * @cython.boundscheck(False)
+ * def RecurseOctree(int i_i, int j_i, int k_i,             # <<<<<<<<<<<<<<
+ *                   position curpos, int gi, int pi,
+ *                   np.ndarray[np.float64_t, ndim=2] output,
+ */
+
 static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_RecurseOctree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_RecurseOctree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   int __pyx_v_i_i;
@@ -994,6 +1357,7 @@
   int __pyx_v_k;
   int __pyx_v_k_off;
   int __pyx_v_ci;
+  int __pyx_v_fi;
   PyObject *__pyx_v_child_i;
   PyObject *__pyx_v_child_j;
   PyObject *__pyx_v_child_k;
@@ -1001,7 +1365,7 @@
   struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *__pyx_v_grid = 0;
   PyArrayObject *__pyx_v_child_indices = 0;
   PyArrayObject *__pyx_v_dimensions = 0;
-  PyArrayObject *__pyx_v_field = 0;
+  PyArrayObject *__pyx_v_fields = 0;
   PyArrayObject *__pyx_v_leftedges = 0;
   PyArrayObject *__pyx_v_dx = 0;
   PyArrayObject *__pyx_v_child_dx;
@@ -1019,13 +1383,6 @@
   Py_buffer __pyx_bstruct_child_dx;
   Py_ssize_t __pyx_bstride_0_child_dx = 0;
   Py_ssize_t __pyx_bshape_0_child_dx = 0;
-  Py_buffer __pyx_bstruct_field;
-  Py_ssize_t __pyx_bstride_0_field = 0;
-  Py_ssize_t __pyx_bstride_1_field = 0;
-  Py_ssize_t __pyx_bstride_2_field = 0;
-  Py_ssize_t __pyx_bshape_0_field = 0;
-  Py_ssize_t __pyx_bshape_1_field = 0;
-  Py_ssize_t __pyx_bshape_2_field = 0;
   Py_buffer __pyx_bstruct_child_leftedges;
   Py_ssize_t __pyx_bstride_0_child_leftedges = 0;
   Py_ssize_t __pyx_bshape_0_child_leftedges = 0;
@@ -1039,9 +1396,20 @@
   Py_ssize_t __pyx_bshape_0_child_indices = 0;
   Py_ssize_t __pyx_bshape_1_child_indices = 0;
   Py_ssize_t __pyx_bshape_2_child_indices = 0;
+  Py_buffer __pyx_bstruct_fields;
+  Py_ssize_t __pyx_bstride_0_fields = 0;
+  Py_ssize_t __pyx_bstride_1_fields = 0;
+  Py_ssize_t __pyx_bstride_2_fields = 0;
+  Py_ssize_t __pyx_bstride_3_fields = 0;
+  Py_ssize_t __pyx_bshape_0_fields = 0;
+  Py_ssize_t __pyx_bshape_1_fields = 0;
+  Py_ssize_t __pyx_bshape_2_fields = 0;
+  Py_ssize_t __pyx_bshape_3_fields = 0;
   Py_buffer __pyx_bstruct_output;
   Py_ssize_t __pyx_bstride_0_output = 0;
+  Py_ssize_t __pyx_bstride_1_output = 0;
   Py_ssize_t __pyx_bshape_0_output = 0;
+  Py_ssize_t __pyx_bshape_1_output = 0;
   PyObject *__pyx_r;
   long __pyx_1;
   PyObject *__pyx_2 = 0;
@@ -1050,7 +1418,8 @@
   PyObject *__pyx_5 = 0;
   int __pyx_6;
   int __pyx_7;
-  __pyx_t_5numpy_float64_t __pyx_8;
+  npy_intp __pyx_8;
+  __pyx_t_5numpy_float64_t __pyx_9;
   PyArrayObject *__pyx_t_1 = NULL;
   PyArrayObject *__pyx_t_2 = NULL;
   PyArrayObject *__pyx_t_3 = NULL;
@@ -1059,33 +1428,38 @@
   int __pyx_t_6;
   int __pyx_t_7;
   int __pyx_t_8;
-  PyArrayObject *__pyx_t_9 = NULL;
+  int __pyx_t_9;
   int __pyx_t_10;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
+  int __pyx_t_11;
+  int __pyx_t_12;
+  int __pyx_t_13;
   PyArrayObject *__pyx_t_14 = NULL;
-  long __pyx_t_15;
-  long __pyx_t_16;
-  long __pyx_t_17;
-  long __pyx_t_18;
-  long __pyx_t_19;
+  int __pyx_t_15;
+  PyObject *__pyx_t_16 = NULL;
+  PyObject *__pyx_t_17 = NULL;
+  PyObject *__pyx_t_18 = NULL;
+  PyArrayObject *__pyx_t_19 = NULL;
   long __pyx_t_20;
+  long __pyx_t_21;
+  long __pyx_t_22;
+  long __pyx_t_23;
+  long __pyx_t_24;
+  long __pyx_t_25;
   static char *__pyx_argnames[] = {"i_i","j_i","k_i","curpos","gi","pi","output","refined","grids",0};
   __pyx_self = __pyx_self;
   if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 9)) {
-    __pyx_v_i_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_j_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_k_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_i_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_j_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_k_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_curpos = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_position *)PyTuple_GET_ITEM(__pyx_args, 3));
-    __pyx_v_gi = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_pi = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_pi == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_gi = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_pi = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_pi == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_output = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 6));
     __pyx_v_refined = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 7));
     __pyx_v_grids = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)PyTuple_GET_ITEM(__pyx_args, 8));
   }
   else {
-    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iiiOiiOOO", __pyx_argnames, &__pyx_v_i_i, &__pyx_v_j_i, &__pyx_v_k_i, &__pyx_v_curpos, &__pyx_v_gi, &__pyx_v_pi, &__pyx_v_output, &__pyx_v_refined, &__pyx_v_grids))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iiiOiiOOO", __pyx_argnames, &__pyx_v_i_i, &__pyx_v_j_i, &__pyx_v_k_i, &__pyx_v_curpos, &__pyx_v_gi, &__pyx_v_pi, &__pyx_v_output, &__pyx_v_refined, &__pyx_v_grids))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4;
   __pyx_L3_error:;
@@ -1098,7 +1472,7 @@
   __pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)Py_None); Py_INCREF(Py_None);
   __pyx_bstruct_child_indices.buf = NULL;
   __pyx_bstruct_dimensions.buf = NULL;
-  __pyx_bstruct_field.buf = NULL;
+  __pyx_bstruct_fields.buf = NULL;
   __pyx_bstruct_leftedges.buf = NULL;
   __pyx_bstruct_dx.buf = NULL;
   __pyx_v_child_dx = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
@@ -1106,275 +1480,504 @@
   __pyx_v_child_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
   __pyx_bstruct_child_leftedges.buf = NULL;
   __pyx_v_s = Py_None; Py_INCREF(Py_None);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_position, 1, "curpos", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refined), __pyx_ptype_5numpy_ndarray, 1, "refined", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGridList, 1, "grids", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
-  __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_position, 1, "curpos", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refined), __pyx_ptype_5numpy_ndarray, 1, "refined", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGridList, 1, "grids", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_output = __pyx_bstruct_output.strides[0]; __pyx_bstride_1_output = __pyx_bstruct_output.strides[1];
+  __pyx_bshape_0_output = __pyx_bstruct_output.shape[0]; __pyx_bshape_1_output = __pyx_bstruct_output.shape[1];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_refined = __pyx_bstruct_refined.strides[0];
   __pyx_bshape_0_refined = __pyx_bstruct_refined.shape[0];
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":108
+ *     cdef child_i, child_j, child_k
+ *     cdef OctreeGrid child_grid
+ *     cdef OctreeGrid grid = grids[gi-1]             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ */
   __pyx_1 = (__pyx_v_gi - 1);
-  __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_2);
   __pyx_2 = 0;
-  if (!(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":109
+ *     cdef OctreeGrid child_grid
+ *     cdef OctreeGrid grid = grids[gi-1]
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ */
+  if (!(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_1 = ((PyArrayObject *)__pyx_v_grid->child_indices);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_t_1, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {
     __pyx_v_child_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_child_indices.buf = NULL;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   } else {__pyx_bstride_0_child_indices = __pyx_bstruct_child_indices.strides[0]; __pyx_bstride_1_child_indices = __pyx_bstruct_child_indices.strides[1]; __pyx_bstride_2_child_indices = __pyx_bstruct_child_indices.strides[2];
     __pyx_bshape_0_child_indices = __pyx_bstruct_child_indices.shape[0]; __pyx_bshape_1_child_indices = __pyx_bstruct_child_indices.shape[1]; __pyx_bshape_2_child_indices = __pyx_bstruct_child_indices.shape[2];
   }
   __pyx_t_1 = 0;
   Py_INCREF(__pyx_v_grid->child_indices);
   __pyx_v_child_indices = ((PyArrayObject *)__pyx_v_grid->child_indices);
-  if (!(__Pyx_TypeTest(__pyx_v_grid->dimensions, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":110
+ *     cdef OctreeGrid grid = grids[gi-1]
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ */
+  if (!(__Pyx_TypeTest(__pyx_v_grid->dimensions, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_2 = ((PyArrayObject *)__pyx_v_grid->dimensions);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_t_2, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
     __pyx_v_dimensions = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_dimensions.buf = NULL;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   } else {__pyx_bstride_0_dimensions = __pyx_bstruct_dimensions.strides[0];
     __pyx_bshape_0_dimensions = __pyx_bstruct_dimensions.shape[0];
   }
   __pyx_t_2 = 0;
   Py_INCREF(__pyx_v_grid->dimensions);
   __pyx_v_dimensions = ((PyArrayObject *)__pyx_v_grid->dimensions);
-  if (!(__Pyx_TypeTest(__pyx_v_grid->field, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = ((PyArrayObject *)__pyx_v_grid->field);
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_field, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {
-    __pyx_v_field = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_field.buf = NULL;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  } else {__pyx_bstride_0_field = __pyx_bstruct_field.strides[0]; __pyx_bstride_1_field = __pyx_bstruct_field.strides[1]; __pyx_bstride_2_field = __pyx_bstruct_field.strides[2];
-    __pyx_bshape_0_field = __pyx_bstruct_field.shape[0]; __pyx_bshape_1_field = __pyx_bstruct_field.shape[1]; __pyx_bshape_2_field = __pyx_bstruct_field.shape[2];
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":111
+ *     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ *     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx
+ */
+  if (!(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = ((PyArrayObject *)__pyx_v_grid->fields);
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4) == -1)) {
+    __pyx_v_fields = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_fields.buf = NULL;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  } else {__pyx_bstride_0_fields = __pyx_bstruct_fields.strides[0]; __pyx_bstride_1_fields = __pyx_bstruct_fields.strides[1]; __pyx_bstride_2_fields = __pyx_bstruct_fields.strides[2]; __pyx_bstride_3_fields = __pyx_bstruct_fields.strides[3];
+    __pyx_bshape_0_fields = __pyx_bstruct_fields.shape[0]; __pyx_bshape_1_fields = __pyx_bstruct_fields.shape[1]; __pyx_bshape_2_fields = __pyx_bstruct_fields.shape[2]; __pyx_bshape_3_fields = __pyx_bstruct_fields.shape[3];
   }
   __pyx_t_3 = 0;
-  Py_INCREF(__pyx_v_grid->field);
-  __pyx_v_field = ((PyArrayObject *)__pyx_v_grid->field);
-  if (!(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_v_grid->fields);
+  __pyx_v_fields = ((PyArrayObject *)__pyx_v_grid->fields);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":112
+ *     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_dx
+ */
+  if (!(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_4 = ((PyArrayObject *)__pyx_v_grid->left_edges);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
     __pyx_v_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_leftedges.buf = NULL;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   } else {__pyx_bstride_0_leftedges = __pyx_bstruct_leftedges.strides[0];
     __pyx_bshape_0_leftedges = __pyx_bstruct_leftedges.shape[0];
   }
   __pyx_t_4 = 0;
   Py_INCREF(__pyx_v_grid->left_edges);
   __pyx_v_leftedges = ((PyArrayObject *)__pyx_v_grid->left_edges);
-  if (!(__Pyx_TypeTest(__pyx_v_grid->dx, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":113
+ *     cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ *     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ *     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_dx
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
+ */
+  if (!(__Pyx_TypeTest(__pyx_v_grid->dx, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_5 = ((PyArrayObject *)__pyx_v_grid->dx);
   if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_5, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
     __pyx_v_dx = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_dx.buf = NULL;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   } else {__pyx_bstride_0_dx = __pyx_bstruct_dx.strides[0];
     __pyx_bshape_0_dx = __pyx_bstruct_dx.shape[0];
   }
   __pyx_t_5 = 0;
   Py_INCREF(__pyx_v_grid->dx);
   __pyx_v_dx = ((PyArrayObject *)__pyx_v_grid->dx);
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":117
+ *     cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
+ *     # Not sure how to get around this
+ *     for k_off in range(2):             # <<<<<<<<<<<<<<
+ *         k = k_off + k_i
+ *         for j_off in range(2):
+ */
   for (__pyx_v_k_off = 0; __pyx_v_k_off < 2; __pyx_v_k_off+=1) {
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":118
+ *     # Not sure how to get around this
+ *     for k_off in range(2):
+ *         k = k_off + k_i             # <<<<<<<<<<<<<<
+ *         for j_off in range(2):
+ *             j = j_off + j_i
+ */
     __pyx_v_k = (__pyx_v_k_off + __pyx_v_k_i);
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":119
+ *     for k_off in range(2):
+ *         k = k_off + k_i
+ *         for j_off in range(2):             # <<<<<<<<<<<<<<
+ *             j = j_off + j_i
+ *             for i_off in range(2):
+ */
     for (__pyx_v_j_off = 0; __pyx_v_j_off < 2; __pyx_v_j_off+=1) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":120
+ *         k = k_off + k_i
+ *         for j_off in range(2):
+ *             j = j_off + j_i             # <<<<<<<<<<<<<<
+ *             for i_off in range(2):
+ *                 i = i_off + i_i
+ */
       __pyx_v_j = (__pyx_v_j_off + __pyx_v_j_i);
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":121
+ *         for j_off in range(2):
+ *             j = j_off + j_i
+ *             for i_off in range(2):             # <<<<<<<<<<<<<<
+ *                 i = i_off + i_i
+ *                 ci = grid.child_indices[i,j,k]
+ */
       for (__pyx_v_i_off = 0; __pyx_v_i_off < 2; __pyx_v_i_off+=1) {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":122
+ *             j = j_off + j_i
+ *             for i_off in range(2):
+ *                 i = i_off + i_i             # <<<<<<<<<<<<<<
+ *                 ci = grid.child_indices[i,j,k]
+ *                 if ci == -1:
+ */
         __pyx_v_i = (__pyx_v_i_off + __pyx_v_i_i);
-        __pyx_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_4 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_5 = PyTuple_New(3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":123
+ *             for i_off in range(2):
+ *                 i = i_off + i_i
+ *                 ci = grid.child_indices[i,j,k]             # <<<<<<<<<<<<<<
+ *                 if ci == -1:
+ *                     for fi in range(fields.shape[0]):
+ */
+        __pyx_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_4 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_5 = PyTuple_New(3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
         PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
         PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
         __pyx_2 = 0;
         __pyx_3 = 0;
         __pyx_4 = 0;
-        __pyx_2 = PyObject_GetItem(__pyx_v_grid->child_indices, ((PyObject *)__pyx_5)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_2 = PyObject_GetItem(__pyx_v_grid->child_indices, ((PyObject *)__pyx_5)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
-        __pyx_6 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_6 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         Py_DECREF(__pyx_2); __pyx_2 = 0;
         __pyx_v_ci = __pyx_6;
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":124
+ *                 i = i_off + i_i
+ *                 ci = grid.child_indices[i,j,k]
+ *                 if ci == -1:             # <<<<<<<<<<<<<<
+ *                     for fi in range(fields.shape[0]):
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ */
         __pyx_7 = (__pyx_v_ci == -1);
         if (__pyx_7) {
-          __pyx_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_4 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_5 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
-          PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
-          PyTuple_SET_ITEM(__pyx_2, 2, __pyx_5);
-          __pyx_3 = 0;
-          __pyx_4 = 0;
-          __pyx_5 = 0;
-          __pyx_3 = PyObject_GetItem(__pyx_v_grid->field, ((PyObject *)__pyx_2)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
-          __pyx_8 = __pyx_PyFloat_AsDouble(__pyx_3); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_3); __pyx_3 = 0;
-          __pyx_t_6 = __pyx_v_curpos->output_pos;
-          if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_bshape_0_output;
-          *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_output.buf, __pyx_t_6, __pyx_bstride_0_output)) = __pyx_8;
-          __pyx_t_7 = __pyx_v_curpos->refined_pos;
-          if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_bshape_0_refined;
-          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_7, __pyx_bstride_0_refined)) = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":125
+ *                 ci = grid.child_indices[i,j,k]
+ *                 if ci == -1:
+ *                     for fi in range(fields.shape[0]):             # <<<<<<<<<<<<<<
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ *                     refined[curpos.refined_pos] = 0
+ */
+          __pyx_8 = (__pyx_v_fields->dimensions[0]);
+          for (__pyx_v_fi = 0; __pyx_v_fi < __pyx_8; __pyx_v_fi+=1) {
+
+            /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":126
+ *                 if ci == -1:
+ *                     for fi in range(fields.shape[0]):
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]             # <<<<<<<<<<<<<<
+ *                     refined[curpos.refined_pos] = 0
+ *                     curpos.output_pos += 1
+ */
+            __pyx_t_6 = __pyx_v_fi;
+            __pyx_t_7 = __pyx_v_i;
+            __pyx_t_8 = __pyx_v_j;
+            __pyx_t_9 = __pyx_v_k;
+            if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_bshape_0_fields;
+            if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_bshape_1_fields;
+            if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_bshape_2_fields;
+            if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_bshape_3_fields;
+            __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided4d(__pyx_bstruct_fields.buf, __pyx_t_6, __pyx_bstride_0_fields, __pyx_t_7, __pyx_bstride_1_fields, __pyx_t_8, __pyx_bstride_2_fields, __pyx_t_9, __pyx_bstride_3_fields)));
+            __pyx_t_10 = __pyx_v_curpos->output_pos;
+            __pyx_t_11 = __pyx_v_fi;
+            if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_bshape_0_output;
+            if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_bshape_1_output;
+            *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output, __pyx_t_11, __pyx_bstride_1_output)) = __pyx_9;
+          }
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":127
+ *                     for fi in range(fields.shape[0]):
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ *                     refined[curpos.refined_pos] = 0             # <<<<<<<<<<<<<<
+ *                     curpos.output_pos += 1
+ *                     curpos.refined_pos += 1
+ */
+          __pyx_t_12 = __pyx_v_curpos->refined_pos;
+          if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_0_refined;
+          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_12, __pyx_bstride_0_refined)) = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":128
+ *                         output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ *                     refined[curpos.refined_pos] = 0
+ *                     curpos.output_pos += 1             # <<<<<<<<<<<<<<
+ *                     curpos.refined_pos += 1
+ *                 else:
+ */
           __pyx_v_curpos->output_pos += 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":129
+ *                     refined[curpos.refined_pos] = 0
+ *                     curpos.output_pos += 1
+ *                     curpos.refined_pos += 1             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     refined[curpos.refined_pos] = 1
+ */
           __pyx_v_curpos->refined_pos += 1;
           goto __pyx_L11;
         }
         /*else*/ {
-          __pyx_t_8 = __pyx_v_curpos->refined_pos;
-          if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_bshape_0_refined;
-          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_8, __pyx_bstride_0_refined)) = 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":131
+ *                     curpos.refined_pos += 1
+ *                 else:
+ *                     refined[curpos.refined_pos] = 1             # <<<<<<<<<<<<<<
+ *                     curpos.refined_pos += 1
+ *                     child_grid = grids[ci-1]
+ */
+          __pyx_t_13 = __pyx_v_curpos->refined_pos;
+          if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_bshape_0_refined;
+          *((__pyx_t_5numpy_int_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_13, __pyx_bstride_0_refined)) = 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":132
+ *                 else:
+ *                     refined[curpos.refined_pos] = 1
+ *                     curpos.refined_pos += 1             # <<<<<<<<<<<<<<
+ *                     child_grid = grids[ci-1]
+ *                     child_dx = child_grid.dx
+ */
           __pyx_v_curpos->refined_pos += 1;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":133
+ *                     refined[curpos.refined_pos] = 1
+ *                     curpos.refined_pos += 1
+ *                     child_grid = grids[ci-1]             # <<<<<<<<<<<<<<
+ *                     child_dx = child_grid.dx
+ *                     child_leftedges = child_grid.left_edges
+ */
           __pyx_1 = (__pyx_v_ci - 1);
-          __pyx_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          if (!(__Pyx_TypeTest(__pyx_4, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(((PyObject *)__pyx_v_child_grid));
-          __pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_4);
-          __pyx_4 = 0;
-          if (!(__Pyx_TypeTest(__pyx_v_child_grid->dx, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_9 = ((PyArrayObject *)__pyx_v_child_grid->dx);
+          __pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_3);
+          __pyx_3 = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":134
+ *                     curpos.refined_pos += 1
+ *                     child_grid = grids[ci-1]
+ *                     child_dx = child_grid.dx             # <<<<<<<<<<<<<<
+ *                     child_leftedges = child_grid.left_edges
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ */
+          if (!(__Pyx_TypeTest(__pyx_v_child_grid->dx, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_14 = ((PyArrayObject *)__pyx_v_child_grid->dx);
           __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx);
-          __pyx_t_10 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_9, &__pyx_bstruct_child_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1);
-          if (unlikely(__pyx_t_10 < 0)) 
+          __pyx_t_15 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_14, &__pyx_bstruct_child_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1);
+          if (unlikely(__pyx_t_15 < 0)) 
           {
-              PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+              PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
               if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
-                  Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
+                  Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
                   __Pyx_RaiseBufferFallbackError();
                 } else {
-                  PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+                  PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
               }
           }
           __pyx_bstride_0_child_dx = __pyx_bstruct_child_dx.strides[0];
           __pyx_bshape_0_child_dx = __pyx_bstruct_child_dx.shape[0];
-          if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_9 = 0;
+          if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_14 = 0;
           Py_INCREF(__pyx_v_child_grid->dx);
           Py_DECREF(((PyObject *)__pyx_v_child_dx));
           __pyx_v_child_dx = ((PyArrayObject *)__pyx_v_child_grid->dx);
-          if (!(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_14 = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":135
+ *                     child_grid = grids[ci-1]
+ *                     child_dx = child_grid.dx
+ *                     child_leftedges = child_grid.left_edges             # <<<<<<<<<<<<<<
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ */
+          if (!(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_19 = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
           __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
-          __pyx_t_10 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_14, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1);
-          if (unlikely(__pyx_t_10 < 0)) 
+          __pyx_t_15 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_19, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1);
+          if (unlikely(__pyx_t_15 < 0)) 
           {
-              PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
+              PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
               if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
-                  Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
+                  Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
                   __Pyx_RaiseBufferFallbackError();
                 } else {
-                  PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
+                  PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
               }
           }
           __pyx_bstride_0_child_leftedges = __pyx_bstruct_child_leftedges.strides[0];
           __pyx_bshape_0_child_leftedges = __pyx_bstruct_child_leftedges.shape[0];
-          if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_14 = 0;
+          if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_19 = 0;
           Py_INCREF(__pyx_v_child_grid->left_edges);
           Py_DECREF(((PyObject *)__pyx_v_child_leftedges));
           __pyx_v_child_leftedges = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
-          __pyx_t_15 = 0;
-          if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_leftedges;
-          __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_15, __pyx_bstride_0_leftedges)));
-          __pyx_5 = PyFloat_FromDouble(__pyx_8); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_3 = PyNumber_Multiply(__pyx_2, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_4 = PyNumber_Add(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":136
+ *                     child_dx = child_grid.dx
+ *                     child_leftedges = child_grid.left_edges
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx             # <<<<<<<<<<<<<<
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx
+ */
+          __pyx_t_20 = 0;
+          if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_bshape_0_leftedges;
+          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_20, __pyx_bstride_0_leftedges)));
+          __pyx_4 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_5 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyNumber_Multiply(__pyx_5, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_5); __pyx_5 = 0;
-          Py_DECREF(__pyx_3); __pyx_3 = 0;
-          __pyx_t_16 = 0;
-          if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_0_child_leftedges;
-          __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_16, __pyx_bstride_0_child_leftedges)));
-          __pyx_2 = PyFloat_FromDouble(__pyx_8); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_5 = PyNumber_Subtract(__pyx_4, __pyx_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_3 = PyNumber_Add(__pyx_4, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_3 = __Pyx_PyNumber_Divide(__pyx_5, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_21 = 0;
+          if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_0_child_leftedges;
+          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_21, __pyx_bstride_0_child_leftedges)));
+          __pyx_5 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_4 = PyNumber_Subtract(__pyx_3, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_3); __pyx_3 = 0;
           Py_DECREF(__pyx_5); __pyx_5 = 0;
-          Py_DECREF(__pyx_v_child_i);
-          __pyx_v_child_i = __pyx_3;
-          __pyx_3 = 0;
-          __pyx_t_17 = 1;
-          if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_0_leftedges;
-          __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_17, __pyx_bstride_0_leftedges)));
-          __pyx_4 = PyFloat_FromDouble(__pyx_8); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_5 = PyNumber_Multiply(__pyx_2, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_3 = PyNumber_Add(__pyx_4, __pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = __Pyx_PyNumber_Divide(__pyx_4, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
+          Py_DECREF(__pyx_v_child_i);
+          __pyx_v_child_i = __pyx_2;
+          __pyx_2 = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":137
+ *                     child_leftedges = child_grid.left_edges
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx             # <<<<<<<<<<<<<<
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx
+ *                     s = RecurseOctree(child_i, child_j, child_k, curpos, ci, gi, output, refined, grids)
+ */
+          __pyx_t_22 = 1;
+          if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_0_leftedges;
+          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_22, __pyx_bstride_0_leftedges)));
+          __pyx_3 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_5 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_4 = PyNumber_Multiply(__pyx_5, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_5); __pyx_5 = 0;
-          __pyx_t_18 = 1;
-          if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_bshape_0_child_leftedges;
-          __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_18, __pyx_bstride_0_child_leftedges)));
-          __pyx_2 = PyFloat_FromDouble(__pyx_8); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_4 = PyNumber_Subtract(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyNumber_Add(__pyx_3, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_3); __pyx_3 = 0;
-          Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_5 = __Pyx_PyNumber_Divide(__pyx_4, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
+          __pyx_t_23 = 1;
+          if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_bshape_0_child_leftedges;
+          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_23, __pyx_bstride_0_child_leftedges)));
+          __pyx_5 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_3 = PyNumber_Subtract(__pyx_2, __pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_2); __pyx_2 = 0;
+          Py_DECREF(__pyx_5); __pyx_5 = 0;
+          __pyx_4 = __Pyx_PyNumber_Divide(__pyx_3, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_3); __pyx_3 = 0;
           Py_DECREF(__pyx_v_child_j);
-          __pyx_v_child_j = __pyx_5;
-          __pyx_5 = 0;
-          __pyx_t_19 = 2;
-          if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_bshape_0_leftedges;
-          __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_19, __pyx_bstride_0_leftedges)));
-          __pyx_3 = PyFloat_FromDouble(__pyx_8); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_4 = PyNumber_Multiply(__pyx_2, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_v_child_j = __pyx_4;
+          __pyx_4 = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":138
+ *                     child_i = ((leftedges[0] + i * dx) - child_leftedges[0])/child_dx
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx             # <<<<<<<<<<<<<<
+ *                     s = RecurseOctree(child_i, child_j, child_k, curpos, ci, gi, output, refined, grids)
+ *     return s
+ */
+          __pyx_t_24 = 2;
+          if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_0_leftedges;
+          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_24, __pyx_bstride_0_leftedges)));
+          __pyx_2 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_5 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_3 = PyNumber_Multiply(__pyx_5, ((PyObject *)__pyx_v_dx)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_5); __pyx_5 = 0;
+          __pyx_4 = PyNumber_Add(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_5 = PyNumber_Add(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_3); __pyx_3 = 0;
+          __pyx_t_25 = 2;
+          if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_0_child_leftedges;
+          __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_25, __pyx_bstride_0_child_leftedges)));
+          __pyx_5 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyNumber_Subtract(__pyx_4, __pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_4); __pyx_4 = 0;
-          __pyx_t_20 = 2;
-          if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_bshape_0_child_leftedges;
-          __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_20, __pyx_bstride_0_child_leftedges)));
-          __pyx_2 = PyFloat_FromDouble(__pyx_8); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_3 = PyNumber_Subtract(__pyx_5, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_5); __pyx_5 = 0;
+          __pyx_3 = __Pyx_PyNumber_Divide(__pyx_2, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_2); __pyx_2 = 0;
-          __pyx_4 = __Pyx_PyNumber_Divide(__pyx_3, ((PyObject *)__pyx_v_child_dx)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_3); __pyx_3 = 0;
           Py_DECREF(__pyx_v_child_k);
-          __pyx_v_child_k = __pyx_4;
-          __pyx_4 = 0;
-          __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_RecurseOctree); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_2 = PyInt_FromLong(__pyx_v_ci); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_3 = PyInt_FromLong(__pyx_v_gi); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_4 = PyTuple_New(9); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_v_child_k = __pyx_3;
+          __pyx_3 = 0;
+
+          /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":139
+ *                     child_j = ((leftedges[1] + j * dx) - child_leftedges[1])/child_dx
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx
+ *                     s = RecurseOctree(child_i, child_j, child_k, curpos, ci, gi, output, refined, grids)             # <<<<<<<<<<<<<<
+ *     return s
+ */
+          __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_RecurseOctree); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_5 = PyInt_FromLong(__pyx_v_ci); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_2 = PyInt_FromLong(__pyx_v_gi); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_3 = PyTuple_New(9); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_INCREF(__pyx_v_child_i);
-          PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_child_i);
+          PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_child_i);
           Py_INCREF(__pyx_v_child_j);
-          PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_child_j);
+          PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_child_j);
           Py_INCREF(__pyx_v_child_k);
-          PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_child_k);
+          PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_child_k);
           Py_INCREF(((PyObject *)__pyx_v_curpos));
-          PyTuple_SET_ITEM(__pyx_4, 3, ((PyObject *)__pyx_v_curpos));
-          PyTuple_SET_ITEM(__pyx_4, 4, __pyx_2);
-          PyTuple_SET_ITEM(__pyx_4, 5, __pyx_3);
+          PyTuple_SET_ITEM(__pyx_3, 3, ((PyObject *)__pyx_v_curpos));
+          PyTuple_SET_ITEM(__pyx_3, 4, __pyx_5);
+          PyTuple_SET_ITEM(__pyx_3, 5, __pyx_2);
           Py_INCREF(((PyObject *)__pyx_v_output));
-          PyTuple_SET_ITEM(__pyx_4, 6, ((PyObject *)__pyx_v_output));
+          PyTuple_SET_ITEM(__pyx_3, 6, ((PyObject *)__pyx_v_output));
           Py_INCREF(((PyObject *)__pyx_v_refined));
-          PyTuple_SET_ITEM(__pyx_4, 7, ((PyObject *)__pyx_v_refined));
+          PyTuple_SET_ITEM(__pyx_3, 7, ((PyObject *)__pyx_v_refined));
           Py_INCREF(((PyObject *)__pyx_v_grids));
-          PyTuple_SET_ITEM(__pyx_4, 8, ((PyObject *)__pyx_v_grids));
+          PyTuple_SET_ITEM(__pyx_3, 8, ((PyObject *)__pyx_v_grids));
+          __pyx_5 = 0;
           __pyx_2 = 0;
-          __pyx_3 = 0;
-          __pyx_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          Py_DECREF(__pyx_5); __pyx_5 = 0;
-          Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
+          __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          Py_DECREF(__pyx_4); __pyx_4 = 0;
+          Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
           Py_DECREF(__pyx_v_s);
-          __pyx_v_s = __pyx_2;
-          __pyx_2 = 0;
+          __pyx_v_s = __pyx_5;
+          __pyx_5 = 0;
         }
         __pyx_L11:;
       }
     }
   }
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":140
+ *                     child_k = ((leftedges[2] + k * dx) - child_leftedges[2])/child_dx
+ *                     s = RecurseOctree(child_i, child_j, child_k, curpos, ci, gi, output, refined, grids)
+ *     return s             # <<<<<<<<<<<<<<
+ */
   Py_INCREF(__pyx_v_s);
   __pyx_r = __pyx_v_s;
   goto __pyx_L0;
@@ -1392,10 +1995,10 @@
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_leftedges, &__pyx_bstruct_leftedges);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx);
-    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_field, &__pyx_bstruct_field);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
     __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
   PyErr_Restore(__pyx_type, __pyx_value, __pyx_tb);}
   __Pyx_AddTraceback("yt.lagos.DepthFirstOctree.RecurseOctree");
@@ -1406,10 +2009,10 @@
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_leftedges, &__pyx_bstruct_leftedges);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_dx, &__pyx_bstruct_child_dx);
-  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_field, &__pyx_bstruct_field);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
   __pyx_L2:;
   Py_DECREF(__pyx_v_child_i);
@@ -1419,7 +2022,7 @@
   Py_XDECREF(__pyx_v_grid);
   Py_XDECREF(__pyx_v_child_indices);
   Py_XDECREF(__pyx_v_dimensions);
-  Py_XDECREF(__pyx_v_field);
+  Py_XDECREF(__pyx_v_fields);
   Py_XDECREF(__pyx_v_leftedges);
   Py_XDECREF(__pyx_v_dx);
   Py_DECREF(__pyx_v_child_dx);
@@ -1428,6 +2031,14 @@
   return __pyx_r;
 }
 
+/* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":36
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP (specifically,
+ */
+
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_t;
@@ -1436,8 +2047,24 @@
   int __pyx_1;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":42
+ *             # so the flags are not even checked).
+ * 
+ *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
+ *                 raise RuntimeError("Py_intptr_t and Py_ssize_t differs in size, numpy.pxd does not support this")
+ * 
+ */
   __pyx_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
   if (__pyx_1) {
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":43
+ * 
+ *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ *                 raise RuntimeError("Py_intptr_t and Py_ssize_t differs in size, numpy.pxd does not support this")             # <<<<<<<<<<<<<<
+ * 
+ *             info.buf = PyArray_DATA(self)
+ */
     __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_INCREF(__pyx_kp_1);
     PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_1);
@@ -1449,61 +2076,261 @@
     goto __pyx_L5;
   }
   __pyx_L5:;
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":45
+ *                 raise RuntimeError("Py_intptr_t and Py_ssize_t differs in size, numpy.pxd does not support this")
+ * 
+ *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
+ *             info.ndim = PyArray_NDIM(self)
+ *             info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
   __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":46
+ * 
+ *             info.buf = PyArray_DATA(self)
+ *             info.ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
+ *             info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ *             info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ */
   __pyx_v_info->ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":47
+ *             info.buf = PyArray_DATA(self)
+ *             info.ndim = PyArray_NDIM(self)
+ *             info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
+ *             info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ *             info.suboffsets = NULL
+ */
   __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":48
+ *             info.ndim = PyArray_NDIM(self)
+ *             info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ *             info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
+ *             info.suboffsets = NULL
+ *             info.itemsize = PyArray_ITEMSIZE(self)
+ */
   __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":49
+ *             info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ *             info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
+ *             info.itemsize = PyArray_ITEMSIZE(self)
+ *             info.readonly = not PyArray_ISWRITEABLE(self)
+ */
   __pyx_v_info->suboffsets = NULL;
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":50
+ *             info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ *             info.suboffsets = NULL
+ *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
+ *             info.readonly = not PyArray_ISWRITEABLE(self)
+ * 
+ */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":51
+ *             info.suboffsets = NULL
+ *             info.itemsize = PyArray_ITEMSIZE(self)
+ *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
+ * 
+ *             # Formats that are not tested and working in Cython are not
+ */
   __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":55
+ *             # Formats that are not tested and working in Cython are not
+ *             # made available from this pxd file yet.
+ *             cdef int t = PyArray_TYPE(self)             # <<<<<<<<<<<<<<
+ *             cdef char* f = NULL
+ *             if   t == NPY_BYTE:       f = "b"
+ */
   __pyx_v_t = PyArray_TYPE(((PyArrayObject *)__pyx_v_self));
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":56
+ *             # made available from this pxd file yet.
+ *             cdef int t = PyArray_TYPE(self)
+ *             cdef char* f = NULL             # <<<<<<<<<<<<<<
+ *             if   t == NPY_BYTE:       f = "b"
+ *             elif t == NPY_UBYTE:      f = "B"
+ */
   __pyx_v_f = NULL;
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":57
+ *             cdef int t = PyArray_TYPE(self)
+ *             cdef char* f = NULL
+ *             if   t == NPY_BYTE:       f = "b"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_UBYTE:      f = "B"
+ *             elif t == NPY_SHORT:      f = "h"
+ */
   switch (__pyx_v_t) {
     case NPY_BYTE:
     __pyx_v_f = __pyx_k_2;
     break;
     case NPY_UBYTE:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":58
+ *             cdef char* f = NULL
+ *             if   t == NPY_BYTE:       f = "b"
+ *             elif t == NPY_UBYTE:      f = "B"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_SHORT:      f = "h"
+ *             elif t == NPY_USHORT:     f = "H"
+ */
     __pyx_v_f = __pyx_k_3;
     break;
     case NPY_SHORT:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":59
+ *             if   t == NPY_BYTE:       f = "b"
+ *             elif t == NPY_UBYTE:      f = "B"
+ *             elif t == NPY_SHORT:      f = "h"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_USHORT:     f = "H"
+ *             elif t == NPY_INT:        f = "i"
+ */
     __pyx_v_f = __pyx_k_4;
     break;
     case NPY_USHORT:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":60
+ *             elif t == NPY_UBYTE:      f = "B"
+ *             elif t == NPY_SHORT:      f = "h"
+ *             elif t == NPY_USHORT:     f = "H"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_INT:        f = "i"
+ *             elif t == NPY_UINT:       f = "I"
+ */
     __pyx_v_f = __pyx_k_5;
     break;
     case NPY_INT:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":61
+ *             elif t == NPY_SHORT:      f = "h"
+ *             elif t == NPY_USHORT:     f = "H"
+ *             elif t == NPY_INT:        f = "i"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_UINT:       f = "I"
+ *             elif t == NPY_LONG:       f = "l"
+ */
     __pyx_v_f = __pyx_k_6;
     break;
     case NPY_UINT:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":62
+ *             elif t == NPY_USHORT:     f = "H"
+ *             elif t == NPY_INT:        f = "i"
+ *             elif t == NPY_UINT:       f = "I"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_LONG:       f = "l"
+ *             elif t == NPY_ULONG:      f = "L"
+ */
     __pyx_v_f = __pyx_k_7;
     break;
     case NPY_LONG:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":63
+ *             elif t == NPY_INT:        f = "i"
+ *             elif t == NPY_UINT:       f = "I"
+ *             elif t == NPY_LONG:       f = "l"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_ULONG:      f = "L"
+ *             elif t == NPY_LONGLONG:   f = "q"
+ */
     __pyx_v_f = __pyx_k_8;
     break;
     case NPY_ULONG:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":64
+ *             elif t == NPY_UINT:       f = "I"
+ *             elif t == NPY_LONG:       f = "l"
+ *             elif t == NPY_ULONG:      f = "L"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_LONGLONG:   f = "q"
+ *             elif t == NPY_ULONGLONG:  f = "Q"
+ */
     __pyx_v_f = __pyx_k_9;
     break;
     case NPY_LONGLONG:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":65
+ *             elif t == NPY_LONG:       f = "l"
+ *             elif t == NPY_ULONG:      f = "L"
+ *             elif t == NPY_LONGLONG:   f = "q"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_ULONGLONG:  f = "Q"
+ *             elif t == NPY_FLOAT:      f = "f"
+ */
     __pyx_v_f = __pyx_k_10;
     break;
     case NPY_ULONGLONG:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":66
+ *             elif t == NPY_ULONG:      f = "L"
+ *             elif t == NPY_LONGLONG:   f = "q"
+ *             elif t == NPY_ULONGLONG:  f = "Q"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_FLOAT:      f = "f"
+ *             elif t == NPY_DOUBLE:     f = "d"
+ */
     __pyx_v_f = __pyx_k_11;
     break;
     case NPY_FLOAT:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":67
+ *             elif t == NPY_LONGLONG:   f = "q"
+ *             elif t == NPY_ULONGLONG:  f = "Q"
+ *             elif t == NPY_FLOAT:      f = "f"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_DOUBLE:     f = "d"
+ *             elif t == NPY_LONGDOUBLE: f = "g"
+ */
     __pyx_v_f = __pyx_k_12;
     break;
     case NPY_DOUBLE:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":68
+ *             elif t == NPY_ULONGLONG:  f = "Q"
+ *             elif t == NPY_FLOAT:      f = "f"
+ *             elif t == NPY_DOUBLE:     f = "d"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_LONGDOUBLE: f = "g"
+ *             elif t == NPY_OBJECT:     f = "O"
+ */
     __pyx_v_f = __pyx_k_13;
     break;
     case NPY_LONGDOUBLE:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":69
+ *             elif t == NPY_FLOAT:      f = "f"
+ *             elif t == NPY_DOUBLE:     f = "d"
+ *             elif t == NPY_LONGDOUBLE: f = "g"             # <<<<<<<<<<<<<<
+ *             elif t == NPY_OBJECT:     f = "O"
+ * 
+ */
     __pyx_v_f = __pyx_k_14;
     break;
     case NPY_OBJECT:
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":70
+ *             elif t == NPY_DOUBLE:     f = "d"
+ *             elif t == NPY_LONGDOUBLE: f = "g"
+ *             elif t == NPY_OBJECT:     f = "O"             # <<<<<<<<<<<<<<
+ * 
+ *             if f == NULL:
+ */
     __pyx_v_f = __pyx_k_15;
     break;
   }
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":72
+ *             elif t == NPY_OBJECT:     f = "O"
+ * 
+ *             if f == NULL:             # <<<<<<<<<<<<<<
+ *                 raise ValueError("only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)" % t)
+ *             info.format = f
+ */
   __pyx_1 = (__pyx_v_f == NULL);
   if (__pyx_1) {
+
+    /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":73
+ * 
+ *             if f == NULL:
+ *                 raise ValueError("only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)" % t)             # <<<<<<<<<<<<<<
+ *             info.format = f
+ * 
+ */
     __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_3 = PyNumber_Remainder(__pyx_kp_16, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
@@ -1518,6 +2345,14 @@
     goto __pyx_L6;
   }
   __pyx_L6:;
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":74
+ *             if f == NULL:
+ *                 raise ValueError("only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)" % t)
+ *             info.format = f             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
   __pyx_v_info->format = __pyx_v_f;
 
   __pyx_r = 0;
@@ -1699,7 +2534,7 @@
   if (!o) return 0;
   p = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)o);
   p->child_indices = Py_None; Py_INCREF(Py_None);
-  p->field = Py_None; Py_INCREF(Py_None);
+  p->fields = Py_None; Py_INCREF(Py_None);
   p->left_edges = Py_None; Py_INCREF(Py_None);
   p->dimensions = Py_None; Py_INCREF(Py_None);
   p->dx = Py_None; Py_INCREF(Py_None);
@@ -1712,7 +2547,7 @@
 static void __pyx_tp_dealloc_2yt_5lagos_16DepthFirstOctree_OctreeGrid(PyObject *o) {
   struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *p = (struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)o;
   Py_XDECREF(p->child_indices);
-  Py_XDECREF(p->field);
+  Py_XDECREF(p->fields);
   Py_XDECREF(p->left_edges);
   Py_XDECREF(p->dimensions);
   Py_XDECREF(p->dx);
@@ -1725,8 +2560,8 @@
   if (p->child_indices) {
     e = (*v)(p->child_indices, a); if (e) return e;
   }
-  if (p->field) {
-    e = (*v)(p->field, a); if (e) return e;
+  if (p->fields) {
+    e = (*v)(p->fields, a); if (e) return e;
   }
   if (p->left_edges) {
     e = (*v)(p->left_edges, a); if (e) return e;
@@ -1746,8 +2581,8 @@
   tmp = ((PyObject*)p->child_indices);
   p->child_indices = Py_None; Py_INCREF(Py_None);
   Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->field);
-  p->field = Py_None; Py_INCREF(Py_None);
+  tmp = ((PyObject*)p->fields);
+  p->fields = Py_None; Py_INCREF(Py_None);
   Py_XDECREF(tmp);
   tmp = ((PyObject*)p->left_edges);
   p->left_edges = Py_None; Py_INCREF(Py_None);
@@ -1767,7 +2602,7 @@
 
 static struct PyMemberDef __pyx_members_2yt_5lagos_16DepthFirstOctree_OctreeGrid[] = {
   {"child_indices", T_OBJECT, offsetof(struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid, child_indices), 0, 0},
-  {"field", T_OBJECT, offsetof(struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid, field), 0, 0},
+  {"fields", T_OBJECT, offsetof(struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid, fields), 0, 0},
   {"left_edges", T_OBJECT, offsetof(struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid, left_edges), 0, 0},
   {"dimensions", T_OBJECT, offsetof(struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid, dimensions), 0, 0},
   {"dx", T_OBJECT, offsetof(struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid, dx), 0, 0},
@@ -2207,9 +3042,25 @@
   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Function import code ---*/
   /*--- Execution code ---*/
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":26
+ * """
+ * 
+ * import numpy as np             # <<<<<<<<<<<<<<
+ * cimport numpy as np
+ * cimport cython
+ */
   __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":36
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP (specifically,
+ */
   #if PY_MAJOR_VERSION < 3
   return;
   #else

Modified: trunk/yt/lagos/DepthFirstOctree.pyx
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.pyx	(original)
+++ trunk/yt/lagos/DepthFirstOctree.pyx	Mon Sep 22 08:35:20 2008
@@ -31,15 +31,15 @@
     cdef public int output_pos, refined_pos
 
 cdef class OctreeGrid:
-    cdef public object child_indices, field, left_edges, dimensions, dx
+    cdef public object child_indices, fields, left_edges, dimensions, dx
     def __cinit__(self,
                   np.ndarray[np.int_t, ndim=3] child_indices,
-                  np.ndarray[np.float64_t, ndim=3] field,
+                  np.ndarray[np.float64_t, ndim=4] fields,
                   np.ndarray[np.float64_t, ndim=1] left_edges,
                   np.ndarray[np.int_t, ndim=1] dimensions,
                   np.ndarray[np.float64_t, ndim=1] dx):
         self.child_indices = child_indices
-        self.field = field
+        self.fields = fields
         self.left_edges = left_edges
         self.dimensions = dimensions
         self.dx = dx
@@ -53,20 +53,20 @@
         return self.grids[item]
 
 @cython.boundscheck(False)
-def WalkRootgrid(np.ndarray[np.float64_t, ndim=1] output,
+def WalkRootgrid(np.ndarray[np.float64_t, ndim=2] output,
                  np.ndarray[np.int_t, ndim=1] refined,
                  OctreeGridList grids, int pi, int s = 0, int r = 0):
     """
     This function only gets called on a 'root grid' -- a base grid
     of the simulation we are converting.  It will call a recursive walker.
     """
-    cdef int i, j, k, gi
+    cdef int i, j, k, gi, fi
     cdef int child_i, child_j, child_k
     cdef OctreeGrid child_grid
     cdef OctreeGrid grid = grids[pi-1]
     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
-    cdef np.ndarray[np.float64_t, ndim=3] field = grid.field
+    cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx
     cdef np.ndarray[np.float64_t, ndim=1] child_dx
@@ -80,7 +80,8 @@
             for i in range(dimensions[0]):
                 gi = child_indices[i,j,k]
                 if gi == -1:
-                    output[curpos.output_pos] = field[i,j,k]
+                    for fi in range(fields.shape[0]):
+                        output[curpos.output_pos,fi] = fields[fi,i,j,k]
                     refined[curpos.refined_pos] = 0
                     curpos.output_pos += 1
                     curpos.refined_pos += 1
@@ -98,16 +99,16 @@
 @cython.boundscheck(False)
 def RecurseOctree(int i_i, int j_i, int k_i,
                   position curpos, int gi, int pi,
-                  np.ndarray[np.float64_t, ndim=1] output,
+                  np.ndarray[np.float64_t, ndim=2] output,
                   np.ndarray[np.int_t, ndim=1] refined,
                   OctreeGridList grids):
-    cdef int i, i_off, j, j_off, k, k_off, ci
+    cdef int i, i_off, j, j_off, k, k_off, ci, fi
     cdef child_i, child_j, child_k
     cdef OctreeGrid child_grid
     cdef OctreeGrid grid = grids[gi-1]
     cdef np.ndarray[np.int_t, ndim=3] child_indices = grid.child_indices
     cdef np.ndarray[np.int_t, ndim=1] dimensions = grid.dimensions
-    cdef np.ndarray[np.float64_t, ndim=3] field = grid.field
+    cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
     cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
     cdef np.ndarray[np.float64_t, ndim=1] dx = grid.dx
     cdef np.ndarray[np.float64_t, ndim=1] child_dx
@@ -121,7 +122,8 @@
                 i = i_off + i_i
                 ci = grid.child_indices[i,j,k]
                 if ci == -1:
-                    output[curpos.output_pos] = grid.field[i,j,k]
+                    for fi in range(fields.shape[0]):
+                        output[curpos.output_pos,fi] = fields[fi,i,j,k]
                     refined[curpos.refined_pos] = 0
                     curpos.output_pos += 1
                     curpos.refined_pos += 1

Modified: trunk/yt/lagos/HierarchyType.py
==============================================================================
--- trunk/yt/lagos/HierarchyType.py	(original)
+++ trunk/yt/lagos/HierarchyType.py	Mon Sep 22 08:35:20 2008
@@ -179,7 +179,8 @@
         self.smoothed_covering_grid = classobj("EnzoSmoothedCoveringGrid",(EnzoSmoothedCoveringGrid,), dd)
         self.sphere = classobj("EnzoSphere",(EnzoSphereBase,), dd)
         self.cutting = classobj("EnzoCuttingPlane",(EnzoCuttingPlaneBase,), dd)
-        self.ray = classobj("EnzoOrthoRay",(EnzoOrthoRayBase,), dd)
+        self.ray = classobj("EnzoRay",(EnzoRayBase,), dd)
+        self.ortho_ray = classobj("EnzoOrthoRay",(EnzoOrthoRayBase,), dd)
         self.disk = classobj("EnzoCylinder",(EnzoCylinderBase,), dd)
         self.grid_collection = classobj("EnzoGridCollection",(EnzoGridCollection,), dd)
 
@@ -752,7 +753,7 @@
         f.close()
         mylog.info("Wrote %s particles to %s", tot, filename)
 
-    def _generate_flat_octree(self, field):
+    def _generate_flat_octree(self, fields):
         """
         Generates two arrays, one of the actual values in a depth-first flat
         octree array, and the other of the values describing the refinement.
@@ -760,18 +761,21 @@
         field used in the data array.
         """
         import DepthFirstOctree as dfo
+        fields = ensure_list(fields)
         o_length = r_length = 0
         grids = []
         for g in self.grids:
+            ff = na.array([g[f] for f in fields])
             grids.append(dfo.OctreeGrid(
                             g.child_index_mask,
-                            g[field].astype("float64"),
+                            ff.astype("float64"),
                             g.LeftEdge.astype('float64'),
                             g.ActiveDimensions.astype('int'),
                             na.ones(1,dtype='float64') * g.dx))
             o_length += g.child_mask.ravel().sum()
             r_length += g.ActiveDimensions.prod()
-        output = na.zeros(o_length, dtype='float64')
+            g.clear_data()
+        output = na.zeros((o_length,len(fields)), dtype='float64')
         refined = na.zeros(r_length, dtype='int')
         ogl = dfo.OctreeGridList(grids)
         dfo.WalkRootgrid(output, refined, ogl, 1, 0)

Modified: trunk/yt/lagos/RTIntegrator.c
==============================================================================
--- trunk/yt/lagos/RTIntegrator.c	(original)
+++ trunk/yt/lagos/RTIntegrator.c	Mon Sep 22 08:35:20 2008
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.8.1.1 on Thu Sep  4 08:25:13 2008 */
+/* Generated by Cython 0.9.8.1.1 on Mon Sep 22 17:29:14 2008 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -174,6 +174,8 @@
 static const char * __pyx_cfilenm= __FILE__;
 static const char *__pyx_filename;
 static const char **__pyx_f;
+
+static char __pyx_mdoc[] = "\nSimle integrators for the radiative transfer equation\n\nAuthor: Matthew Turk <matthewturk at gmail.com>\nAffiliation: KIPAC/SLAC/Stanford\nHomepage: http://yt.enzotools.org/\nLicense:\n  Copyright (C) 2008 Matthew Turk.  All Rights Reserved.\n\n  This file is part of yt.\n\n  yt is free software; you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation; either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n";
 static INLINE void __Pyx_SafeReleaseBuffer(PyObject* obj, Py_buffer* info);
 static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf); /*proto*/
 static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/
@@ -185,6 +187,12 @@
 #define __Pyx_BufPtrStrided2d(buf, i0, s0, i1, s1) ((char*)buf + i0 * s0 + i1 * s1)
 #define __Pyx_BufPtrStrided3d(buf, i0, s0, i1, s1, i2, s2) ((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
 #define __Pyx_BufPtrStrided1d(buf, i0, s0) ((char*)buf + i0 * s0)
+static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int_t(const char* ts); /*proto*/
+
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int_t(PyObject* obj, Py_buffer* buf, int flags, int nd); /*proto*/
+static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_float64_t(const char* ts); /*proto*/
+
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd); /*proto*/
 
 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name, int exact); /*proto*/
 
@@ -204,6 +212,50 @@
 
 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+
+static INLINE int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v, int is_unsigned) {
+    int r;
+    if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
+        Py_DECREF(PyList_GET_ITEM(o, i));
+        Py_INCREF(v);
+        PyList_SET_ITEM(o, i, v);
+        return 1;
+    }
+    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0) || !is_unsigned))
+        r = PySequence_SetItem(o, i, v);
+    else {
+        PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
+        if (!j)
+            return -1;
+        r = PyObject_SetItem(o, j, v);
+        Py_DECREF(j);
+    }
+    return r;
+}
+
+static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) {
+    PyObject *r;
+    if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
+        r = PyList_GET_ITEM(o, i);
+        Py_INCREF(r);
+    }
+    else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) {
+        r = PyTuple_GET_ITEM(o, i);
+        Py_INCREF(r);
+    }
+    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned))
+        r = PySequence_GetItem(o, i);
+    else {
+        PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
+        if (!j)
+            return 0;
+        r = PyObject_GetItem(o, j);
+        Py_DECREF(j);
+    }
+    return r;
+}
+
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
 static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
@@ -261,10 +313,26 @@
 
 
 /* Implementation of yt.lagos.RTIntegrator */
+static PyObject *__pyx_int_3;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
 static char __pyx_k_numpy[] = "numpy";
 static PyObject *__pyx_kp_numpy;
 static char __pyx_k_np[] = "np";
 static PyObject *__pyx_kp_np;
+static char __pyx_k_ones[] = "ones";
+static PyObject *__pyx_kp_ones;
+static char __pyx_k_dtype[] = "dtype";
+static PyObject *__pyx_kp_dtype;
+static char __pyx_k_17[] = "float64";
+static PyObject *__pyx_kp_17;
+static char __pyx_k_zeros[] = "zeros";
+static PyObject *__pyx_kp_zeros;
+static char __pyx_k_18[] = "int64";
+static PyObject *__pyx_kp_18;
+static char __pyx_k_floor[] = "floor";
+static PyObject *__pyx_kp_floor;
 static char __pyx_k___getbuffer__[] = "__getbuffer__";
 static PyObject *__pyx_kp___getbuffer__;
 static char __pyx_k_RuntimeError[] = "RuntimeError";
@@ -292,7 +360,7 @@
 static char __pyx_k_15[] = "O";
 static char __pyx_k_16[] = "only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)";
 
-/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":6
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":31
  * 
  * @cython.boundscheck(False)
  * def Transfer3D(np.ndarray[np.float_t, ndim=2] i_s,             # <<<<<<<<<<<<<<
@@ -377,42 +445,42 @@
     __pyx_v_o_s = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
     __pyx_v_e = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2));
     __pyx_v_a = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
-    __pyx_v_imin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_imin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_imax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_imax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_jmin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_jmin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_jmax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 7)); if (unlikely((__pyx_v_jmax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_kmin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 8)); if (unlikely((__pyx_v_kmin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_kmax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely((__pyx_v_kmax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_istride = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 10)); if (unlikely((__pyx_v_istride == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_jstride = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_jstride == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_dx = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 12)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_imin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_imin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_imax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_imax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_jmin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_jmin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_jmax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 7)); if (unlikely((__pyx_v_jmax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_kmin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 8)); if (unlikely((__pyx_v_kmin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_kmax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely((__pyx_v_kmax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_istride = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 10)); if (unlikely((__pyx_v_istride == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_jstride = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_jstride == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_dx = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 12)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   else {
-    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOiiiiiiiif", __pyx_argnames, &__pyx_v_i_s, &__pyx_v_o_s, &__pyx_v_e, &__pyx_v_a, &__pyx_v_imin, &__pyx_v_imax, &__pyx_v_jmin, &__pyx_v_jmax, &__pyx_v_kmin, &__pyx_v_kmax, &__pyx_v_istride, &__pyx_v_jstride, &__pyx_v_dx))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOiiiiiiiif", __pyx_argnames, &__pyx_v_i_s, &__pyx_v_o_s, &__pyx_v_e, &__pyx_v_a, &__pyx_v_imin, &__pyx_v_imax, &__pyx_v_jmin, &__pyx_v_jmax, &__pyx_v_kmin, &__pyx_v_kmax, &__pyx_v_istride, &__pyx_v_jstride, &__pyx_v_dx))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4;
   __pyx_L3_error:;
   __Pyx_AddTraceback("yt.lagos.RTIntegrator.Transfer3D");
   return NULL;
   __pyx_L4:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_i_s), __pyx_ptype_5numpy_ndarray, 1, "i_s", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_o_s), __pyx_ptype_5numpy_ndarray, 1, "o_s", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_5numpy_ndarray, 1, "e", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_i_s, &__pyx_bstruct_i_s, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_i_s), __pyx_ptype_5numpy_ndarray, 1, "i_s", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_o_s), __pyx_ptype_5numpy_ndarray, 1, "o_s", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_5numpy_ndarray, 1, "e", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_i_s, &__pyx_bstruct_i_s, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_i_s = __pyx_bstruct_i_s.strides[0]; __pyx_bstride_1_i_s = __pyx_bstruct_i_s.strides[1];
   __pyx_bshape_0_i_s = __pyx_bstruct_i_s.shape[0]; __pyx_bshape_1_i_s = __pyx_bstruct_i_s.shape[1];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_o_s, &__pyx_bstruct_o_s, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_o_s, &__pyx_bstruct_o_s, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_o_s = __pyx_bstruct_o_s.strides[0]; __pyx_bstride_1_o_s = __pyx_bstruct_o_s.strides[1]; __pyx_bstride_2_o_s = __pyx_bstruct_o_s.strides[2];
   __pyx_bshape_0_o_s = __pyx_bstruct_o_s.shape[0]; __pyx_bshape_1_o_s = __pyx_bstruct_o_s.shape[1]; __pyx_bshape_2_o_s = __pyx_bstruct_o_s.shape[2];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_e, &__pyx_bstruct_e, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_e, &__pyx_bstruct_e, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_e = __pyx_bstruct_e.strides[0]; __pyx_bstride_1_e = __pyx_bstruct_e.strides[1]; __pyx_bstride_2_e = __pyx_bstruct_e.strides[2];
   __pyx_bshape_0_e = __pyx_bstruct_e.shape[0]; __pyx_bshape_1_e = __pyx_bstruct_e.shape[1]; __pyx_bshape_2_e = __pyx_bstruct_e.shape[2];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_a, &__pyx_bstruct_a, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_a, &__pyx_bstruct_a, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_a = __pyx_bstruct_a.strides[0]; __pyx_bstride_1_a = __pyx_bstruct_a.strides[1]; __pyx_bstride_2_a = __pyx_bstruct_a.strides[2];
   __pyx_bshape_0_a = __pyx_bstruct_a.shape[0]; __pyx_bshape_1_a = __pyx_bstruct_a.shape[1]; __pyx_bshape_2_a = __pyx_bstruct_a.shape[2];
 
-  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":25
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":50
  *     cdef int k, kk
  *     cdef float temp
  *     for i in range((imax-imin)*istride):             # <<<<<<<<<<<<<<
@@ -422,7 +490,7 @@
   __pyx_1 = ((__pyx_v_imax - __pyx_v_imin) * __pyx_v_istride);
   for (__pyx_v_i = 0; __pyx_v_i < __pyx_1; __pyx_v_i+=1) {
 
-    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":26
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":51
  *     cdef float temp
  *     for i in range((imax-imin)*istride):
  *         ii = i + imin*istride             # <<<<<<<<<<<<<<
@@ -431,7 +499,7 @@
  */
     __pyx_v_ii = (__pyx_v_i + (__pyx_v_imin * __pyx_v_istride));
 
-    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":27
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":52
  *     for i in range((imax-imin)*istride):
  *         ii = i + imin*istride
  *         for j in range((jmax-jmin)*jstride):             # <<<<<<<<<<<<<<
@@ -441,7 +509,7 @@
     __pyx_2 = ((__pyx_v_jmax - __pyx_v_jmin) * __pyx_v_jstride);
     for (__pyx_v_j = 0; __pyx_v_j < __pyx_2; __pyx_v_j+=1) {
 
-      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":28
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":53
  *         ii = i + imin*istride
  *         for j in range((jmax-jmin)*jstride):
  *             jj = j + jmin*jstride             # <<<<<<<<<<<<<<
@@ -450,7 +518,7 @@
  */
       __pyx_v_jj = (__pyx_v_j + (__pyx_v_jmin * __pyx_v_jstride));
 
-      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":29
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":54
  *         for j in range((jmax-jmin)*jstride):
  *             jj = j + jmin*jstride
  *             temp = i_s[ii,jj]             # <<<<<<<<<<<<<<
@@ -464,7 +532,7 @@
       __pyx_3 = *((__pyx_t_5numpy_float_t *)((__pyx_t_5numpy_float_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_i_s.buf, __pyx_t_1, __pyx_bstride_0_i_s, __pyx_t_2, __pyx_bstride_1_i_s)));
       __pyx_v_temp = __pyx_3;
 
-      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":30
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":55
  *             jj = j + jmin*jstride
  *             temp = i_s[ii,jj]
  *             for k in range(kmax-kmin):             # <<<<<<<<<<<<<<
@@ -474,7 +542,7 @@
       __pyx_4 = (__pyx_v_kmax - __pyx_v_kmin);
       for (__pyx_v_k = 0; __pyx_v_k < __pyx_4; __pyx_v_k+=1) {
 
-        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":31
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":56
  *             temp = i_s[ii,jj]
  *             for k in range(kmax-kmin):
  *                 o_s[i,j,k] = temp + dx*(e[i,j,k] - temp*a[i,j,k])             # <<<<<<<<<<<<<<
@@ -503,7 +571,7 @@
         if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_bshape_2_o_s;
         *((__pyx_t_5numpy_float_t *)__Pyx_BufPtrStrided3d(__pyx_bstruct_o_s.buf, __pyx_t_9, __pyx_bstride_0_o_s, __pyx_t_10, __pyx_bstride_1_o_s, __pyx_t_11, __pyx_bstride_2_o_s)) = (__pyx_v_temp + (__pyx_v_dx * (__pyx_3 - (__pyx_v_temp * __pyx_5))));
 
-        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":32
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":57
  *             for k in range(kmax-kmin):
  *                 o_s[i,j,k] = temp + dx*(e[i,j,k] - temp*a[i,j,k])
  *                 temp = o_s[i,j,k]             # <<<<<<<<<<<<<<
@@ -520,7 +588,7 @@
         __pyx_v_temp = __pyx_3;
       }
 
-      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":33
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":58
  *                 o_s[i,j,k] = temp + dx*(e[i,j,k] - temp*a[i,j,k])
  *                 temp = o_s[i,j,k]
  *             i_s[ii,jj] = temp             # <<<<<<<<<<<<<<
@@ -557,7 +625,7 @@
   return __pyx_r;
 }
 
-/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":36
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":61
  * 
  * @cython.boundscheck(False)
  * def Transfer1D(float i_s,             # <<<<<<<<<<<<<<
@@ -600,40 +668,40 @@
   static char *__pyx_argnames[] = {"i_s","o_s","e","a","dx","imin","imax",0};
   __pyx_self = __pyx_self;
   if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 7)) {
-    __pyx_v_i_s = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_i_s = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_o_s = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
     __pyx_v_e = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2));
     __pyx_v_a = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
     __pyx_v_dx = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 4));
-    __pyx_v_imin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_imin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_imax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_imax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_imin = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_imin == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_imax = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_imax == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   else {
-    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "fOOOOii", __pyx_argnames, &__pyx_v_i_s, &__pyx_v_o_s, &__pyx_v_e, &__pyx_v_a, &__pyx_v_dx, &__pyx_v_imin, &__pyx_v_imax))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "fOOOOii", __pyx_argnames, &__pyx_v_i_s, &__pyx_v_o_s, &__pyx_v_e, &__pyx_v_a, &__pyx_v_dx, &__pyx_v_imin, &__pyx_v_imax))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4;
   __pyx_L3_error:;
   __Pyx_AddTraceback("yt.lagos.RTIntegrator.Transfer1D");
   return NULL;
   __pyx_L4:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_o_s), __pyx_ptype_5numpy_ndarray, 1, "o_s", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_5numpy_ndarray, 1, "e", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_o_s, &__pyx_bstruct_o_s, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_o_s), __pyx_ptype_5numpy_ndarray, 1, "o_s", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_5numpy_ndarray, 1, "e", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_o_s, &__pyx_bstruct_o_s, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_o_s = __pyx_bstruct_o_s.strides[0];
   __pyx_bshape_0_o_s = __pyx_bstruct_o_s.shape[0];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_e, &__pyx_bstruct_e, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_e, &__pyx_bstruct_e, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_e = __pyx_bstruct_e.strides[0];
   __pyx_bshape_0_e = __pyx_bstruct_e.shape[0];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_a, &__pyx_bstruct_a, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_a, &__pyx_bstruct_a, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_a = __pyx_bstruct_a.strides[0];
   __pyx_bshape_0_a = __pyx_bstruct_a.shape[0];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float_t((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_dx = __pyx_bstruct_dx.strides[0];
   __pyx_bshape_0_dx = __pyx_bstruct_dx.shape[0];
 
-  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":43
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":68
  *                int imin, int imax):
  *     cdef int i
  *     for i in range(imin, imax):             # <<<<<<<<<<<<<<
@@ -642,7 +710,7 @@
  */
   for (__pyx_v_i = __pyx_v_imin; __pyx_v_i < __pyx_v_imax; __pyx_v_i+=1) {
 
-    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":44
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":69
  *     cdef int i
  *     for i in range(imin, imax):
  *         o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i])             # <<<<<<<<<<<<<<
@@ -662,11 +730,12 @@
     if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_bshape_0_o_s;
     *((__pyx_t_5numpy_float_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_o_s.buf, __pyx_t_4, __pyx_bstride_0_o_s)) = (__pyx_v_i_s + (__pyx_1 * (__pyx_2 - (__pyx_v_i_s * __pyx_3))));
 
-    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":45
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":70
  *     for i in range(imin, imax):
  *         o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i])
  *         i_s = o_s[i]             # <<<<<<<<<<<<<<
  *     return i_s
+ * 
  */
     __pyx_t_5 = __pyx_v_i;
     if (__pyx_t_5 < 0) __pyx_t_5 += __pyx_bshape_0_o_s;
@@ -674,12 +743,14 @@
     __pyx_v_i_s = __pyx_1;
   }
 
-  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":46
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":71
  *         o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i])
  *         i_s = o_s[i]
  *     return i_s             # <<<<<<<<<<<<<<
+ * 
+ * @cython.boundscheck(False)
  */
-  __pyx_4 = PyFloat_FromDouble(__pyx_v_i_s); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = PyFloat_FromDouble(__pyx_v_i_s); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_4;
   __pyx_4 = 0;
   goto __pyx_L0;
@@ -707,6 +778,1065 @@
   return __pyx_r;
 }
 
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":74
+ * 
+ * @cython.boundscheck(False)
+ * def VoxelTraversal(np.ndarray[np.int_t, ndim=3] grid_mask,             # <<<<<<<<<<<<<<
+ *                    np.ndarray[np.float64_t, ndim=1] left_edge,
+ *                    np.ndarray[np.float64_t, ndim=1] right_edge,
+ */
+
+static PyObject *__pyx_pf_2yt_5lagos_12RTIntegrator_VoxelTraversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pf_2yt_5lagos_12RTIntegrator_VoxelTraversal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyArrayObject *__pyx_v_grid_mask = 0;
+  PyArrayObject *__pyx_v_left_edge = 0;
+  PyArrayObject *__pyx_v_right_edge = 0;
+  PyArrayObject *__pyx_v_dx = 0;
+  PyArrayObject *__pyx_v_u = 0;
+  PyArrayObject *__pyx_v_v = 0;
+  int __pyx_v_i;
+  int __pyx_v_x;
+  int __pyx_v_y;
+  double __pyx_v_tl;
+  double __pyx_v_tr;
+  double __pyx_v_intersect_t;
+  double __pyx_v_intersect;
+  PyArrayObject *__pyx_v_step = 0;
+  PyArrayObject *__pyx_v_cur_ind = 0;
+  PyArrayObject *__pyx_v_tdelta = 0;
+  PyArrayObject *__pyx_v_tmax = 0;
+  int __pyx_v_in_cells;
+  Py_buffer __pyx_bstruct_right_edge;
+  Py_ssize_t __pyx_bstride_0_right_edge = 0;
+  Py_ssize_t __pyx_bshape_0_right_edge = 0;
+  Py_buffer __pyx_bstruct_grid_mask;
+  Py_ssize_t __pyx_bstride_0_grid_mask = 0;
+  Py_ssize_t __pyx_bstride_1_grid_mask = 0;
+  Py_ssize_t __pyx_bstride_2_grid_mask = 0;
+  Py_ssize_t __pyx_bshape_0_grid_mask = 0;
+  Py_ssize_t __pyx_bshape_1_grid_mask = 0;
+  Py_ssize_t __pyx_bshape_2_grid_mask = 0;
+  Py_buffer __pyx_bstruct_u;
+  Py_ssize_t __pyx_bstride_0_u = 0;
+  Py_ssize_t __pyx_bshape_0_u = 0;
+  Py_buffer __pyx_bstruct_dx;
+  Py_ssize_t __pyx_bstride_0_dx = 0;
+  Py_ssize_t __pyx_bshape_0_dx = 0;
+  Py_buffer __pyx_bstruct_v;
+  Py_ssize_t __pyx_bstride_0_v = 0;
+  Py_ssize_t __pyx_bshape_0_v = 0;
+  Py_buffer __pyx_bstruct_left_edge;
+  Py_ssize_t __pyx_bstride_0_left_edge = 0;
+  Py_ssize_t __pyx_bshape_0_left_edge = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  PyObject *__pyx_5 = 0;
+  __pyx_t_5numpy_float64_t __pyx_6;
+  int __pyx_7;
+  __pyx_t_5numpy_float64_t __pyx_8;
+  __pyx_t_5numpy_float64_t __pyx_9;
+  double __pyx_10;
+  long __pyx_11;
+  int __pyx_t_1;
+  int __pyx_t_2;
+  int __pyx_t_3;
+  int __pyx_t_4;
+  int __pyx_t_5;
+  int __pyx_t_6;
+  int __pyx_t_7;
+  int __pyx_t_8;
+  int __pyx_t_9;
+  int __pyx_t_10;
+  int __pyx_t_11;
+  int __pyx_t_12;
+  int __pyx_t_13;
+  int __pyx_t_14;
+  int __pyx_t_15;
+  int __pyx_t_16;
+  int __pyx_t_17;
+  int __pyx_t_18;
+  int __pyx_t_19;
+  int __pyx_t_20;
+  int __pyx_t_21;
+  int __pyx_t_22;
+  int __pyx_t_23;
+  long __pyx_t_24;
+  long __pyx_t_25;
+  long __pyx_t_26;
+  long __pyx_t_27;
+  long __pyx_t_28;
+  long __pyx_t_29;
+  long __pyx_t_30;
+  long __pyx_t_31;
+  long __pyx_t_32;
+  int __pyx_t_33;
+  int __pyx_t_34;
+  int __pyx_t_35;
+  int __pyx_t_36;
+  int __pyx_t_37;
+  int __pyx_t_38;
+  int __pyx_t_39;
+  int __pyx_t_40;
+  static char *__pyx_argnames[] = {"grid_mask","left_edge","right_edge","dx","u","v",0};
+  __pyx_self = __pyx_self;
+  if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 6)) {
+    __pyx_v_grid_mask = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
+    __pyx_v_left_edge = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
+    __pyx_v_right_edge = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2));
+    __pyx_v_dx = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
+    __pyx_v_u = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 4));
+    __pyx_v_v = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 5));
+  }
+  else {
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOOO", __pyx_argnames, &__pyx_v_grid_mask, &__pyx_v_left_edge, &__pyx_v_right_edge, &__pyx_v_dx, &__pyx_v_u, &__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  }
+  goto __pyx_L4;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("yt.lagos.RTIntegrator.VoxelTraversal");
+  return NULL;
+  __pyx_L4:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grid_mask), __pyx_ptype_5numpy_ndarray, 1, "grid_mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_5numpy_ndarray, 1, "u", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_v_grid_mask, &__pyx_bstruct_grid_mask, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_grid_mask = __pyx_bstruct_grid_mask.strides[0]; __pyx_bstride_1_grid_mask = __pyx_bstruct_grid_mask.strides[1]; __pyx_bstride_2_grid_mask = __pyx_bstruct_grid_mask.strides[2];
+  __pyx_bshape_0_grid_mask = __pyx_bstruct_grid_mask.shape[0]; __pyx_bshape_1_grid_mask = __pyx_bstruct_grid_mask.shape[1]; __pyx_bshape_2_grid_mask = __pyx_bstruct_grid_mask.shape[2];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_left_edge, &__pyx_bstruct_left_edge, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_left_edge = __pyx_bstruct_left_edge.strides[0];
+  __pyx_bshape_0_left_edge = __pyx_bstruct_left_edge.shape[0];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_right_edge, &__pyx_bstruct_right_edge, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_right_edge = __pyx_bstruct_right_edge.strides[0];
+  __pyx_bshape_0_right_edge = __pyx_bstruct_right_edge.shape[0];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_dx = __pyx_bstruct_dx.strides[0];
+  __pyx_bshape_0_dx = __pyx_bstruct_dx.shape[0];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_u, &__pyx_bstruct_u, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_u = __pyx_bstruct_u.strides[0];
+  __pyx_bshape_0_u = __pyx_bstruct_u.shape[0];
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_v, &__pyx_bstruct_v, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_bstride_0_v = __pyx_bstruct_v.strides[0];
+  __pyx_bshape_0_v = __pyx_bstruct_v.shape[0];
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":85
+ *     cdef int i, x, y
+ *     cdef double tl, tr, intersect_t, intersect
+ *     cdef np.ndarray step = np.ones(3, dtype=np.float64) # maybe just ints?             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray cur_ind = np.zeros(3, dtype=np.int64) # maybe just ints?
+ *     cdef np.ndarray tdelta = np.zeros(3, dtype=np.float64)
+ */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_ones); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_int_3);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_int_3);
+  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_17); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyDict_SetItem(__pyx_3, __pyx_kp_dtype, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+  Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+  if (!(__Pyx_TypeTest(__pyx_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_step = ((PyArrayObject *)__pyx_4);
+  __pyx_4 = 0;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":86
+ *     cdef double tl, tr, intersect_t, intersect
+ *     cdef np.ndarray step = np.ones(3, dtype=np.float64) # maybe just ints?
+ *     cdef np.ndarray cur_ind = np.zeros(3, dtype=np.int64) # maybe just ints?             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray tdelta = np.zeros(3, dtype=np.float64)
+ *     cdef np.ndarray tmax = np.zeros(3, dtype=np.float64)
+ */
+  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_int_3);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_int_3);
+  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_18); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyDict_SetItem(__pyx_3, __pyx_kp_dtype, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+  Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+  if (!(__Pyx_TypeTest(__pyx_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_cur_ind = ((PyArrayObject *)__pyx_4);
+  __pyx_4 = 0;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":87
+ *     cdef np.ndarray step = np.ones(3, dtype=np.float64) # maybe just ints?
+ *     cdef np.ndarray cur_ind = np.zeros(3, dtype=np.int64) # maybe just ints?
+ *     cdef np.ndarray tdelta = np.zeros(3, dtype=np.float64)             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray tmax = np.zeros(3, dtype=np.float64)
+ *     intersect_t = 1e30
+ */
+  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_int_3);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_int_3);
+  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_17); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyDict_SetItem(__pyx_3, __pyx_kp_dtype, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+  Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+  if (!(__Pyx_TypeTest(__pyx_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_tdelta = ((PyArrayObject *)__pyx_4);
+  __pyx_4 = 0;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":88
+ *     cdef np.ndarray cur_ind = np.zeros(3, dtype=np.int64) # maybe just ints?
+ *     cdef np.ndarray tdelta = np.zeros(3, dtype=np.float64)
+ *     cdef np.ndarray tmax = np.zeros(3, dtype=np.float64)             # <<<<<<<<<<<<<<
+ *     intersect_t = 1e30
+ *     for i in range(3):
+ */
+  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_int_3);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_int_3);
+  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_17); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyDict_SetItem(__pyx_3, __pyx_kp_dtype, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+  Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+  if (!(__Pyx_TypeTest(__pyx_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_tmax = ((PyArrayObject *)__pyx_4);
+  __pyx_4 = 0;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":89
+ *     cdef np.ndarray tdelta = np.zeros(3, dtype=np.float64)
+ *     cdef np.ndarray tmax = np.zeros(3, dtype=np.float64)
+ *     intersect_t = 1e30             # <<<<<<<<<<<<<<
+ *     for i in range(3):
+ *         # As long as we're iterating, set some other stuff, too
+ */
+  __pyx_v_intersect_t = 1e30;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":90
+ *     cdef np.ndarray tmax = np.zeros(3, dtype=np.float64)
+ *     intersect_t = 1e30
+ *     for i in range(3):             # <<<<<<<<<<<<<<
+ *         # As long as we're iterating, set some other stuff, too
+ *         if (v[i] < 0): step[i] = -1
+ */
+  for (__pyx_v_i = 0; __pyx_v_i < 3; __pyx_v_i+=1) {
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":92
+ *     for i in range(3):
+ *         # As long as we're iterating, set some other stuff, too
+ *         if (v[i] < 0): step[i] = -1             # <<<<<<<<<<<<<<
+ *         x = (i+1)%3
+ *         y = (i+2)%3
+ */
+    __pyx_t_1 = __pyx_v_i;
+    if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_bshape_0_v;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_1, __pyx_bstride_0_v)));
+    __pyx_7 = (__pyx_6 < 0);
+    if (__pyx_7) {
+      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_step), __pyx_v_i, __pyx_int_neg_1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L7;
+    }
+    __pyx_L7:;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":93
+ *         # As long as we're iterating, set some other stuff, too
+ *         if (v[i] < 0): step[i] = -1
+ *         x = (i+1)%3             # <<<<<<<<<<<<<<
+ *         y = (i+2)%3
+ *         tl = (left_edge[i] - u[i])/v[i]
+ */
+    __pyx_v_x = ((__pyx_v_i + 1) % 3);
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":94
+ *         if (v[i] < 0): step[i] = -1
+ *         x = (i+1)%3
+ *         y = (i+2)%3             # <<<<<<<<<<<<<<
+ *         tl = (left_edge[i] - u[i])/v[i]
+ *         tr = (right_edge[i] - u[i])/v[i]
+ */
+    __pyx_v_y = ((__pyx_v_i + 2) % 3);
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":95
+ *         x = (i+1)%3
+ *         y = (i+2)%3
+ *         tl = (left_edge[i] - u[i])/v[i]             # <<<<<<<<<<<<<<
+ *         tr = (right_edge[i] - u[i])/v[i]
+ *         if (left_edge[x] <= (u[x] + tl*v[x]) < right_edge[x]) and \
+ */
+    __pyx_t_2 = __pyx_v_i;
+    if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_bshape_0_left_edge;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_2, __pyx_bstride_0_left_edge)));
+    __pyx_t_3 = __pyx_v_i;
+    if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_bshape_0_u;
+    __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_3, __pyx_bstride_0_u)));
+    __pyx_t_4 = __pyx_v_i;
+    if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_bshape_0_v;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_4, __pyx_bstride_0_v)));
+    __pyx_v_tl = ((__pyx_6 - __pyx_8) / __pyx_9);
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":96
+ *         y = (i+2)%3
+ *         tl = (left_edge[i] - u[i])/v[i]
+ *         tr = (right_edge[i] - u[i])/v[i]             # <<<<<<<<<<<<<<
+ *         if (left_edge[x] <= (u[x] + tl*v[x]) < right_edge[x]) and \
+ *            (left_edge[y] <= (u[y] + tl*v[y]) < right_edge[y]) and \
+ */
+    __pyx_t_5 = __pyx_v_i;
+    if (__pyx_t_5 < 0) __pyx_t_5 += __pyx_bshape_0_right_edge;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_5, __pyx_bstride_0_right_edge)));
+    __pyx_t_6 = __pyx_v_i;
+    if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_bshape_0_u;
+    __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_6, __pyx_bstride_0_u)));
+    __pyx_t_7 = __pyx_v_i;
+    if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_bshape_0_v;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_7, __pyx_bstride_0_v)));
+    __pyx_v_tr = ((__pyx_6 - __pyx_8) / __pyx_9);
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":97
+ *         tl = (left_edge[i] - u[i])/v[i]
+ *         tr = (right_edge[i] - u[i])/v[i]
+ *         if (left_edge[x] <= (u[x] + tl*v[x]) < right_edge[x]) and \             # <<<<<<<<<<<<<<
+ *            (left_edge[y] <= (u[y] + tl*v[y]) < right_edge[y]) and \
+ *            (0 <= tl < intersect_t):
+ */
+    __pyx_t_8 = __pyx_v_x;
+    if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_bshape_0_left_edge;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_8, __pyx_bstride_0_left_edge)));
+    __pyx_t_9 = __pyx_v_x;
+    if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_bshape_0_u;
+    __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_9, __pyx_bstride_0_u)));
+    __pyx_t_10 = __pyx_v_x;
+    if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_bshape_0_v;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_10, __pyx_bstride_0_v)));
+    __pyx_10 = (__pyx_8 + (__pyx_v_tl * __pyx_9));
+    __pyx_7 = (__pyx_6 <= __pyx_10);
+    if (__pyx_7) {
+      __pyx_t_11 = __pyx_v_x;
+      if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_bshape_0_right_edge;
+      __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_11, __pyx_bstride_0_right_edge)));
+      __pyx_7 = (__pyx_10 < __pyx_8);
+    }
+    if (__pyx_7) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":98
+ *         tr = (right_edge[i] - u[i])/v[i]
+ *         if (left_edge[x] <= (u[x] + tl*v[x]) < right_edge[x]) and \
+ *            (left_edge[y] <= (u[y] + tl*v[y]) < right_edge[y]) and \             # <<<<<<<<<<<<<<
+ *            (0 <= tl < intersect_t):
+ *             intersect_t = tl
+ */
+      __pyx_t_12 = __pyx_v_y;
+      if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_0_left_edge;
+      __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_12, __pyx_bstride_0_left_edge)));
+      __pyx_t_13 = __pyx_v_y;
+      if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_bshape_0_u;
+      __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_13, __pyx_bstride_0_u)));
+      __pyx_t_14 = __pyx_v_y;
+      if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_bshape_0_v;
+      __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_14, __pyx_bstride_0_v)));
+      __pyx_10 = (__pyx_6 + (__pyx_v_tl * __pyx_8));
+      __pyx_7 = (__pyx_9 <= __pyx_10);
+      if (__pyx_7) {
+        __pyx_t_15 = __pyx_v_y;
+        if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_right_edge;
+        __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_15, __pyx_bstride_0_right_edge)));
+        __pyx_7 = (__pyx_10 < __pyx_6);
+      }
+      if (__pyx_7) {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":99
+ *         if (left_edge[x] <= (u[x] + tl*v[x]) < right_edge[x]) and \
+ *            (left_edge[y] <= (u[y] + tl*v[y]) < right_edge[y]) and \
+ *            (0 <= tl < intersect_t):             # <<<<<<<<<<<<<<
+ *             intersect_t = tl
+ *         if (left_edge[x] <= (u[x] + tr*v[x]) < right_edge[x]) and \
+ */
+        __pyx_7 = (0 <= __pyx_v_tl);
+        if (__pyx_7) {
+          __pyx_7 = (__pyx_v_tl < __pyx_v_intersect_t);
+        }
+      }
+    }
+    if (__pyx_7) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":100
+ *            (left_edge[y] <= (u[y] + tl*v[y]) < right_edge[y]) and \
+ *            (0 <= tl < intersect_t):
+ *             intersect_t = tl             # <<<<<<<<<<<<<<
+ *         if (left_edge[x] <= (u[x] + tr*v[x]) < right_edge[x]) and \
+ *            (left_edge[y] <= (u[y] + tr*v[y]) < right_edge[y]) and \
+ */
+      __pyx_v_intersect_t = __pyx_v_tl;
+      goto __pyx_L8;
+    }
+    __pyx_L8:;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":101
+ *            (0 <= tl < intersect_t):
+ *             intersect_t = tl
+ *         if (left_edge[x] <= (u[x] + tr*v[x]) < right_edge[x]) and \             # <<<<<<<<<<<<<<
+ *            (left_edge[y] <= (u[y] + tr*v[y]) < right_edge[y]) and \
+ *            (0 <= tr < intersect_t):
+ */
+    __pyx_t_16 = __pyx_v_x;
+    if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_0_left_edge;
+    __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_16, __pyx_bstride_0_left_edge)));
+    __pyx_t_17 = __pyx_v_x;
+    if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_0_u;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_17, __pyx_bstride_0_u)));
+    __pyx_t_18 = __pyx_v_x;
+    if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_bshape_0_v;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_18, __pyx_bstride_0_v)));
+    __pyx_10 = (__pyx_9 + (__pyx_v_tr * __pyx_6));
+    __pyx_7 = (__pyx_8 <= __pyx_10);
+    if (__pyx_7) {
+      __pyx_t_19 = __pyx_v_x;
+      if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_bshape_0_right_edge;
+      __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_19, __pyx_bstride_0_right_edge)));
+      __pyx_7 = (__pyx_10 < __pyx_9);
+    }
+    if (__pyx_7) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":102
+ *             intersect_t = tl
+ *         if (left_edge[x] <= (u[x] + tr*v[x]) < right_edge[x]) and \
+ *            (left_edge[y] <= (u[y] + tr*v[y]) < right_edge[y]) and \             # <<<<<<<<<<<<<<
+ *            (0 <= tr < intersect_t):
+ *             intersect_t = tr
+ */
+      __pyx_t_20 = __pyx_v_y;
+      if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_bshape_0_left_edge;
+      __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_20, __pyx_bstride_0_left_edge)));
+      __pyx_t_21 = __pyx_v_y;
+      if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_0_u;
+      __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_21, __pyx_bstride_0_u)));
+      __pyx_t_22 = __pyx_v_y;
+      if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_0_v;
+      __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_22, __pyx_bstride_0_v)));
+      __pyx_10 = (__pyx_8 + (__pyx_v_tr * __pyx_9));
+      __pyx_7 = (__pyx_6 <= __pyx_10);
+      if (__pyx_7) {
+        __pyx_t_23 = __pyx_v_y;
+        if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_bshape_0_right_edge;
+        __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_23, __pyx_bstride_0_right_edge)));
+        __pyx_7 = (__pyx_10 < __pyx_8);
+      }
+      if (__pyx_7) {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":103
+ *         if (left_edge[x] <= (u[x] + tr*v[x]) < right_edge[x]) and \
+ *            (left_edge[y] <= (u[y] + tr*v[y]) < right_edge[y]) and \
+ *            (0 <= tr < intersect_t):             # <<<<<<<<<<<<<<
+ *             intersect_t = tr
+ *     if (left_edge[0] <= u[0] <= right_edge[0]) and \
+ */
+        __pyx_7 = (0 <= __pyx_v_tr);
+        if (__pyx_7) {
+          __pyx_7 = (__pyx_v_tr < __pyx_v_intersect_t);
+        }
+      }
+    }
+    if (__pyx_7) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":104
+ *            (left_edge[y] <= (u[y] + tr*v[y]) < right_edge[y]) and \
+ *            (0 <= tr < intersect_t):
+ *             intersect_t = tr             # <<<<<<<<<<<<<<
+ *     if (left_edge[0] <= u[0] <= right_edge[0]) and \
+ *        (left_edge[1] <= u[1] <= right_edge[1]) and \
+ */
+      __pyx_v_intersect_t = __pyx_v_tr;
+      goto __pyx_L9;
+    }
+    __pyx_L9:;
+  }
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":105
+ *            (0 <= tr < intersect_t):
+ *             intersect_t = tr
+ *     if (left_edge[0] <= u[0] <= right_edge[0]) and \             # <<<<<<<<<<<<<<
+ *        (left_edge[1] <= u[1] <= right_edge[1]) and \
+ *        (left_edge[2] <= u[2] <= right_edge[2]):
+ */
+  __pyx_t_24 = 0;
+  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_0_left_edge;
+  __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_24, __pyx_bstride_0_left_edge)));
+  __pyx_t_25 = 0;
+  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_0_u;
+  __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_25, __pyx_bstride_0_u)));
+  __pyx_7 = (__pyx_9 <= __pyx_6);
+  if (__pyx_7) {
+    __pyx_t_26 = 0;
+    if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_0_right_edge;
+    __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_26, __pyx_bstride_0_right_edge)));
+    __pyx_7 = (__pyx_6 <= __pyx_8);
+  }
+  if (__pyx_7) {
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":106
+ *             intersect_t = tr
+ *     if (left_edge[0] <= u[0] <= right_edge[0]) and \
+ *        (left_edge[1] <= u[1] <= right_edge[1]) and \             # <<<<<<<<<<<<<<
+ *        (left_edge[2] <= u[2] <= right_edge[2]):
+ *         intersect_t = 0
+ */
+    __pyx_t_27 = 1;
+    if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_0_left_edge;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_27, __pyx_bstride_0_left_edge)));
+    __pyx_t_28 = 1;
+    if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_0_u;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_28, __pyx_bstride_0_u)));
+    __pyx_7 = (__pyx_9 <= __pyx_6);
+    if (__pyx_7) {
+      __pyx_t_29 = 1;
+      if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_bshape_0_right_edge;
+      __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_29, __pyx_bstride_0_right_edge)));
+      __pyx_7 = (__pyx_6 <= __pyx_8);
+    }
+    if (__pyx_7) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":107
+ *     if (left_edge[0] <= u[0] <= right_edge[0]) and \
+ *        (left_edge[1] <= u[1] <= right_edge[1]) and \
+ *        (left_edge[2] <= u[2] <= right_edge[2]):             # <<<<<<<<<<<<<<
+ *         intersect_t = 0
+ *     if intersect_t > 1e29: return
+ */
+      __pyx_t_30 = 2;
+      if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_bshape_0_left_edge;
+      __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_30, __pyx_bstride_0_left_edge)));
+      __pyx_t_31 = 2;
+      if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_bshape_0_u;
+      __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_31, __pyx_bstride_0_u)));
+      __pyx_7 = (__pyx_9 <= __pyx_6);
+      if (__pyx_7) {
+        __pyx_t_32 = 2;
+        if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_bshape_0_right_edge;
+        __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_right_edge.buf, __pyx_t_32, __pyx_bstride_0_right_edge)));
+        __pyx_7 = (__pyx_6 <= __pyx_8);
+      }
+    }
+  }
+  if (__pyx_7) {
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":108
+ *        (left_edge[1] <= u[1] <= right_edge[1]) and \
+ *        (left_edge[2] <= u[2] <= right_edge[2]):
+ *         intersect_t = 0             # <<<<<<<<<<<<<<
+ *     if intersect_t > 1e29: return
+ *     # Now get the indices of the intersection
+ */
+    __pyx_v_intersect_t = 0;
+    goto __pyx_L10;
+  }
+  __pyx_L10:;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":109
+ *        (left_edge[2] <= u[2] <= right_edge[2]):
+ *         intersect_t = 0
+ *     if intersect_t > 1e29: return             # <<<<<<<<<<<<<<
+ *     # Now get the indices of the intersection
+ *     for i in range(3):
+ */
+  __pyx_7 = (__pyx_v_intersect_t > 1e29);
+  if (__pyx_7) {
+    __pyx_r = Py_None; Py_INCREF(Py_None);
+    goto __pyx_L0;
+    goto __pyx_L11;
+  }
+  __pyx_L11:;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":111
+ *     if intersect_t > 1e29: return
+ *     # Now get the indices of the intersection
+ *     for i in range(3):             # <<<<<<<<<<<<<<
+ *         intersect = u[i] + intersect_t * v[i]
+ *         cur_ind[i] = np.floor((intersect - left_edge[i])/dx[i])
+ */
+  for (__pyx_v_i = 0; __pyx_v_i < 3; __pyx_v_i+=1) {
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":112
+ *     # Now get the indices of the intersection
+ *     for i in range(3):
+ *         intersect = u[i] + intersect_t * v[i]             # <<<<<<<<<<<<<<
+ *         cur_ind[i] = np.floor((intersect - left_edge[i])/dx[i])
+ *         if step[i] > 0: tdelta[i] = intersect - ((cur_ind[i]+1) * dx[i])
+ */
+    __pyx_t_33 = __pyx_v_i;
+    if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_bshape_0_u;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_u.buf, __pyx_t_33, __pyx_bstride_0_u)));
+    __pyx_t_34 = __pyx_v_i;
+    if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_bshape_0_v;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_34, __pyx_bstride_0_v)));
+    __pyx_v_intersect = (__pyx_9 + (__pyx_v_intersect_t * __pyx_6));
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":113
+ *     for i in range(3):
+ *         intersect = u[i] + intersect_t * v[i]
+ *         cur_ind[i] = np.floor((intersect - left_edge[i])/dx[i])             # <<<<<<<<<<<<<<
+ *         if step[i] > 0: tdelta[i] = intersect - ((cur_ind[i]+1) * dx[i])
+ *         if step[i] < 0: tdelta[i] = intersect - (cur_ind[i] * dx[i])
+ */
+    __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_floor); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    __pyx_t_35 = __pyx_v_i;
+    if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_bshape_0_left_edge;
+    __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_left_edge.buf, __pyx_t_35, __pyx_bstride_0_left_edge)));
+    __pyx_t_36 = __pyx_v_i;
+    if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_bshape_0_dx;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_dx.buf, __pyx_t_36, __pyx_bstride_0_dx)));
+    __pyx_1 = PyFloat_FromDouble(((__pyx_v_intersect - __pyx_8) / __pyx_9)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_ind), __pyx_v_i, __pyx_4, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":114
+ *         intersect = u[i] + intersect_t * v[i]
+ *         cur_ind[i] = np.floor((intersect - left_edge[i])/dx[i])
+ *         if step[i] > 0: tdelta[i] = intersect - ((cur_ind[i]+1) * dx[i])             # <<<<<<<<<<<<<<
+ *         if step[i] < 0: tdelta[i] = intersect - (cur_ind[i] * dx[i])
+ *         tmax[i] = dx[i]/v[i]
+ */
+    __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_step), __pyx_v_i, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_1 = PyObject_RichCompare(__pyx_5, __pyx_int_0, Py_GT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    if (__pyx_7) {
+      __pyx_2 = PyFloat_FromDouble(__pyx_v_intersect); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), __pyx_v_i, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_4 = PyNumber_Add(__pyx_3, __pyx_int_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __pyx_t_37 = __pyx_v_i;
+      if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_bshape_0_dx;
+      __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_dx.buf, __pyx_t_37, __pyx_bstride_0_dx)));
+      __pyx_5 = PyFloat_FromDouble(__pyx_6); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyNumber_Multiply(__pyx_4, __pyx_5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      Py_DECREF(__pyx_5); __pyx_5 = 0;
+      __pyx_3 = PyNumber_Subtract(__pyx_2, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_2); __pyx_2 = 0;
+      Py_DECREF(__pyx_1); __pyx_1 = 0;
+      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_tdelta), __pyx_v_i, __pyx_3, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      goto __pyx_L14;
+    }
+    __pyx_L14:;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":115
+ *         cur_ind[i] = np.floor((intersect - left_edge[i])/dx[i])
+ *         if step[i] > 0: tdelta[i] = intersect - ((cur_ind[i]+1) * dx[i])
+ *         if step[i] < 0: tdelta[i] = intersect - (cur_ind[i] * dx[i])             # <<<<<<<<<<<<<<
+ *         tmax[i] = dx[i]/v[i]
+ *     # We now know where we have pierced the grid initially.
+ */
+    __pyx_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_step), __pyx_v_i, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_5 = PyObject_RichCompare(__pyx_4, __pyx_int_0, Py_LT); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    if (__pyx_7) {
+      __pyx_2 = PyFloat_FromDouble(__pyx_v_intersect); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), __pyx_v_i, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_38 = __pyx_v_i;
+      if (__pyx_t_38 < 0) __pyx_t_38 += __pyx_bshape_0_dx;
+      __pyx_8 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_dx.buf, __pyx_t_38, __pyx_bstride_0_dx)));
+      __pyx_3 = PyFloat_FromDouble(__pyx_8); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_4 = PyNumber_Multiply(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_1); __pyx_1 = 0;
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __pyx_5 = PyNumber_Subtract(__pyx_2, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_2); __pyx_2 = 0;
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_tdelta), __pyx_v_i, __pyx_5, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_5); __pyx_5 = 0;
+      goto __pyx_L15;
+    }
+    __pyx_L15:;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":116
+ *         if step[i] > 0: tdelta[i] = intersect - ((cur_ind[i]+1) * dx[i])
+ *         if step[i] < 0: tdelta[i] = intersect - (cur_ind[i] * dx[i])
+ *         tmax[i] = dx[i]/v[i]             # <<<<<<<<<<<<<<
+ *     # We now know where we have pierced the grid initially.
+ *     cdef int in_cells = 1
+ */
+    __pyx_t_39 = __pyx_v_i;
+    if (__pyx_t_39 < 0) __pyx_t_39 += __pyx_bshape_0_dx;
+    __pyx_9 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_dx.buf, __pyx_t_39, __pyx_bstride_0_dx)));
+    __pyx_t_40 = __pyx_v_i;
+    if (__pyx_t_40 < 0) __pyx_t_40 += __pyx_bshape_0_v;
+    __pyx_6 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_v.buf, __pyx_t_40, __pyx_bstride_0_v)));
+    __pyx_1 = PyFloat_FromDouble((__pyx_9 / __pyx_6)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_tmax), __pyx_v_i, __pyx_1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+  }
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":118
+ *         tmax[i] = dx[i]/v[i]
+ *     # We now know where we have pierced the grid initially.
+ *     cdef int in_cells = 1             # <<<<<<<<<<<<<<
+ *     while 1:
+ *         if cur_ind[0] >= grid_mask.shape[0] or \
+ */
+  __pyx_v_in_cells = 1;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":119
+ *     # We now know where we have pierced the grid initially.
+ *     cdef int in_cells = 1
+ *     while 1:             # <<<<<<<<<<<<<<
+ *         if cur_ind[0] >= grid_mask.shape[0] or \
+ *            cur_ind[1] >= grid_mask.shape[1] or \
+ */
+  while (1) {
+    __pyx_11 = 1;
+    if (!__pyx_11) break;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":120
+ *     cdef int in_cells = 1
+ *     while 1:
+ *         if cur_ind[0] >= grid_mask.shape[0] or \             # <<<<<<<<<<<<<<
+ *            cur_ind[1] >= grid_mask.shape[1] or \
+ *            cur_ind[2] >= grid_mask.shape[2]:
+ */
+    __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_4 = PyInt_FromLong((__pyx_v_grid_mask->dimensions[0])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = PyObject_RichCompare(__pyx_2, __pyx_4, Py_GE); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_7) {
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":121
+ *     while 1:
+ *         if cur_ind[0] >= grid_mask.shape[0] or \
+ *            cur_ind[1] >= grid_mask.shape[1] or \             # <<<<<<<<<<<<<<
+ *            cur_ind[2] >= grid_mask.shape[2]:
+ *             break
+ */
+      __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 1, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyInt_FromLong((__pyx_v_grid_mask->dimensions[1])); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyObject_RichCompare(__pyx_5, __pyx_1, Py_GE); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_5); __pyx_5 = 0;
+      Py_DECREF(__pyx_1); __pyx_1 = 0;
+      __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (!__pyx_7) {
+        Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":122
+ *         if cur_ind[0] >= grid_mask.shape[0] or \
+ *            cur_ind[1] >= grid_mask.shape[1] or \
+ *            cur_ind[2] >= grid_mask.shape[2]:             # <<<<<<<<<<<<<<
+ *             break
+ *         else:
+ */
+        __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 2, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_4 = PyInt_FromLong((__pyx_v_grid_mask->dimensions[2])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_3 = PyObject_RichCompare(__pyx_2, __pyx_4, Py_GE); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_2); __pyx_2 = 0;
+        Py_DECREF(__pyx_4); __pyx_4 = 0;
+      }
+    }
+    __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    if (__pyx_7) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":123
+ *            cur_ind[1] >= grid_mask.shape[1] or \
+ *            cur_ind[2] >= grid_mask.shape[2]:
+ *             break             # <<<<<<<<<<<<<<
+ *         else:
+ *             grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1
+ */
+      goto __pyx_L17;
+      goto __pyx_L18;
+    }
+    /*else*/ {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":125
+ *             break
+ *         else:
+ *             grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1             # <<<<<<<<<<<<<<
+ *         if tmax[0] < tmax[1]:
+ *             if tmax[0] < tmax[2]:
+ */
+      __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 0, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 2, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
+      PyTuple_SET_ITEM(__pyx_4, 1, __pyx_1);
+      PyTuple_SET_ITEM(__pyx_4, 2, __pyx_2);
+      __pyx_5 = 0;
+      __pyx_1 = 0;
+      __pyx_2 = 0;
+      if (PyObject_SetItem(((PyObject *)__pyx_v_grid_mask), ((PyObject *)__pyx_4), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
+    }
+    __pyx_L18:;
+
+    /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":126
+ *         else:
+ *             grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1
+ *         if tmax[0] < tmax[1]:             # <<<<<<<<<<<<<<
+ *             if tmax[0] < tmax[2]:
+ *                 cur_ind[0] += step[0]
+ */
+    __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 1, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_1 = PyObject_RichCompare(__pyx_3, __pyx_5, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    if (__pyx_7) {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":127
+ *             grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1
+ *         if tmax[0] < tmax[1]:
+ *             if tmax[0] < tmax[2]:             # <<<<<<<<<<<<<<
+ *                 cur_ind[0] += step[0]
+ *                 tmax[0] += tdelta[0]
+ */
+      __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyObject_RichCompare(__pyx_2, __pyx_4, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_2); __pyx_2 = 0;
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      if (__pyx_7) {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":128
+ *         if tmax[0] < tmax[1]:
+ *             if tmax[0] < tmax[2]:
+ *                 cur_ind[0] += step[0]             # <<<<<<<<<<<<<<
+ *                 tmax[0] += tdelta[0]
+ *             else:
+ */
+        __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_step), 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_5 = PyNumber_InPlaceAdd(__pyx_2, __pyx_1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+        Py_DECREF(__pyx_2); __pyx_2 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_ind), 0, __pyx_5, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_5); __pyx_5 = 0;
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":129
+ *             if tmax[0] < tmax[2]:
+ *                 cur_ind[0] += step[0]
+ *                 tmax[0] += tdelta[0]             # <<<<<<<<<<<<<<
+ *             else:
+ *                 cur_ind[2] += step[2]
+ */
+        __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tdelta), 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_4 = PyNumber_InPlaceAdd(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_3); __pyx_3 = 0;
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_tmax), 0, __pyx_4, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_4); __pyx_4 = 0;
+        goto __pyx_L20;
+      }
+      /*else*/ {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":131
+ *                 tmax[0] += tdelta[0]
+ *             else:
+ *                 cur_ind[2] += step[2]             # <<<<<<<<<<<<<<
+ *                 tmax[2] += tdelta[2]
+ *         else:
+ */
+        __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_step), 2, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_2 = PyNumber_InPlaceAdd(__pyx_3, __pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_5); __pyx_5 = 0;
+        Py_DECREF(__pyx_3); __pyx_3 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_ind), 2, __pyx_2, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":132
+ *             else:
+ *                 cur_ind[2] += step[2]
+ *                 tmax[2] += tdelta[2]             # <<<<<<<<<<<<<<
+ *         else:
+ *             if tmax[1] < tmax[2]:
+ */
+        __pyx_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tdelta), 2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 2, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_1 = PyNumber_InPlaceAdd(__pyx_5, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_4); __pyx_4 = 0;
+        Py_DECREF(__pyx_5); __pyx_5 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_tmax), 2, __pyx_1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+      }
+      __pyx_L20:;
+      goto __pyx_L19;
+    }
+    /*else*/ {
+
+      /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":134
+ *                 tmax[2] += tdelta[2]
+ *         else:
+ *             if tmax[1] < tmax[2]:             # <<<<<<<<<<<<<<
+ *                 cur_ind[1] += step[1]
+ *                 tmax[1] += tdelta[1]
+ */
+      __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 2, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_4 = PyObject_RichCompare(__pyx_3, __pyx_2, Py_LT); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      Py_DECREF(__pyx_2); __pyx_2 = 0;
+      __pyx_7 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      if (__pyx_7) {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":135
+ *         else:
+ *             if tmax[1] < tmax[2]:
+ *                 cur_ind[1] += step[1]             # <<<<<<<<<<<<<<
+ *                 tmax[1] += tdelta[1]
+ *             else:
+ */
+        __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_step), 1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_5 = PyNumber_InPlaceAdd(__pyx_3, __pyx_1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+        Py_DECREF(__pyx_3); __pyx_3 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_ind), 1, __pyx_5, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_5); __pyx_5 = 0;
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":136
+ *             if tmax[1] < tmax[2]:
+ *                 cur_ind[1] += step[1]
+ *                 tmax[1] += tdelta[1]             # <<<<<<<<<<<<<<
+ *             else:
+ *                 cur_ind[2] += step[2]
+ */
+        __pyx_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tdelta), 1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_2 = PyNumber_InPlaceAdd(__pyx_1, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_4); __pyx_4 = 0;
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_tmax), 1, __pyx_2, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_2); __pyx_2 = 0;
+        goto __pyx_L21;
+      }
+      /*else*/ {
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":138
+ *                 tmax[1] += tdelta[1]
+ *             else:
+ *                 cur_ind[2] += step[2]             # <<<<<<<<<<<<<<
+ *                 tmax[2] += tdelta[2]
+ *     return
+ */
+        __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_step), 2, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_cur_ind), 2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_3 = PyNumber_InPlaceAdd(__pyx_4, __pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_5); __pyx_5 = 0;
+        Py_DECREF(__pyx_4); __pyx_4 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_ind), 2, __pyx_3, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+        /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":139
+ *             else:
+ *                 cur_ind[2] += step[2]
+ *                 tmax[2] += tdelta[2]             # <<<<<<<<<<<<<<
+ *     return
+ */
+        __pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tdelta), 2, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_tmax), 2, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_1 = PyNumber_InPlaceAdd(__pyx_5, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_2); __pyx_2 = 0;
+        Py_DECREF(__pyx_5); __pyx_5 = 0;
+        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_tmax), 2, __pyx_1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+      }
+      __pyx_L21:;
+    }
+    __pyx_L19:;
+  }
+  __pyx_L17:;
+
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":140
+ *                 cur_ind[2] += step[2]
+ *                 tmax[2] += tdelta[2]
+ *     return             # <<<<<<<<<<<<<<
+ */
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_5);
+  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+    PyErr_Fetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_right_edge, &__pyx_bstruct_right_edge);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_grid_mask, &__pyx_bstruct_grid_mask);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_u, &__pyx_bstruct_u);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_v, &__pyx_bstruct_v);
+    __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_left_edge, &__pyx_bstruct_left_edge);
+  PyErr_Restore(__pyx_type, __pyx_value, __pyx_tb);}
+  __Pyx_AddTraceback("yt.lagos.RTIntegrator.VoxelTraversal");
+  __pyx_r = NULL;
+  goto __pyx_L2;
+  __pyx_L0:;
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_right_edge, &__pyx_bstruct_right_edge);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_grid_mask, &__pyx_bstruct_grid_mask);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_u, &__pyx_bstruct_u);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_v, &__pyx_bstruct_v);
+  __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_left_edge, &__pyx_bstruct_left_edge);
+  __pyx_L2:;
+  Py_XDECREF(__pyx_v_step);
+  Py_XDECREF(__pyx_v_cur_ind);
+  Py_XDECREF(__pyx_v_tdelta);
+  Py_XDECREF(__pyx_v_tmax);
+  return __pyx_r;
+}
+
 /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":36
  *         # experimental exception made for __getbuffer__ and __releasebuffer__
  *         # -- the details of this may change.
@@ -1045,6 +2175,7 @@
 static struct PyMethodDef __pyx_methods[] = {
   {"Transfer3D", (PyCFunction)__pyx_pf_2yt_5lagos_12RTIntegrator_Transfer3D, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_5lagos_12RTIntegrator_Transfer3D},
   {"Transfer1D", (PyCFunction)__pyx_pf_2yt_5lagos_12RTIntegrator_Transfer1D, METH_VARARGS|METH_KEYWORDS, 0},
+  {"VoxelTraversal", (PyCFunction)__pyx_pf_2yt_5lagos_12RTIntegrator_VoxelTraversal, METH_VARARGS|METH_KEYWORDS, 0},
   {0, 0, 0, 0}
 };
 
@@ -1054,7 +2185,7 @@
 static struct PyModuleDef __pyx_moduledef = {
     PyModuleDef_HEAD_INIT,
     "RTIntegrator",
-    0, /* m_doc */
+    __pyx_mdoc, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
     NULL, /* m_reload */
@@ -1067,6 +2198,12 @@
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1},
   {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1},
+  {&__pyx_kp_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 1, 1, 1},
+  {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1},
+  {&__pyx_kp_17, __pyx_k_17, sizeof(__pyx_k_17), 1, 1, 1},
+  {&__pyx_kp_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 1, 1, 1},
+  {&__pyx_kp_18, __pyx_k_18, sizeof(__pyx_k_18), 1, 1, 1},
+  {&__pyx_kp_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 1, 1, 1},
   {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 0, 1, 1},
   {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1},
   {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1},
@@ -1083,6 +2220,10 @@
 }
 
 static int __Pyx_InitGlobals(void) {
+  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   return 0;
   __pyx_L1_error:;
@@ -1105,7 +2246,7 @@
   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4("RTIntegrator", __pyx_methods, 0, 0, PYTHON_API_VERSION);
+  __pyx_m = Py_InitModule4("RTIntegrator", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
@@ -1127,13 +2268,15 @@
   /*--- Function import code ---*/
   /*--- Execution code ---*/
 
-  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":1
+  /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/RTIntegrator.pyx":26
+ * """
+ * 
  * import numpy as np             # <<<<<<<<<<<<<<
  * cimport numpy as np
  * cimport cython
  */
-  __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
   /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-fat.egg/Cython/Includes/numpy.pxd":36
@@ -1271,6 +2414,100 @@
   __Pyx_ZeroBuffer(buf);
   return -1;
 }
+static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int_t(const char* ts) {
+  int ok;
+  if (*ts == '1') ++ts;
+  switch (*ts) {
+    case 'b': ok = (sizeof(__pyx_t_5numpy_int_t) == sizeof(char) && (__pyx_t_5numpy_int_t)-1 < 0); break;
+    case 'h': ok = (sizeof(__pyx_t_5numpy_int_t) == sizeof(short) && (__pyx_t_5numpy_int_t)-1 < 0); break;
+    case 'i': ok = (sizeof(__pyx_t_5numpy_int_t) == sizeof(int) && (__pyx_t_5numpy_int_t)-1 < 0); break;
+    case 'l': ok = (sizeof(__pyx_t_5numpy_int_t) == sizeof(long) && (__pyx_t_5numpy_int_t)-1 < 0); break;
+    case 'q': ok = (sizeof(__pyx_t_5numpy_int_t) == sizeof(long long) && (__pyx_t_5numpy_int_t)-1 < 0); break;  default: ok = 0;
+  }
+  if (!ok) {
+      PyErr_Format(PyExc_ValueError, "Buffer datatype mismatch (rejecting on '%s')", ts);
+      return NULL;
+  } else return ts + 1;
+  
+}
+
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int_t(PyObject* obj, Py_buffer* buf, int flags, int nd) {
+  const char* ts;
+  if (obj == Py_None) {
+    __Pyx_ZeroBuffer(buf);
+    return 0;
+  }
+  buf->buf = NULL;
+  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
+  if (buf->ndim != nd) {
+    __Pyx_BufferNdimError(buf, nd);
+    goto fail;
+  }
+  ts = buf->format;
+  ts = __Pyx_ConsumeWhitespace(ts);
+  ts = __Pyx_BufferTypestringCheckEndian(ts);
+  if (!ts) goto fail;
+  ts = __Pyx_ConsumeWhitespace(ts);
+  ts = __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int_t(ts);
+  if (!ts) goto fail;
+  ts = __Pyx_ConsumeWhitespace(ts);
+  if (*ts != 0) {
+    PyErr_Format(PyExc_ValueError,
+      "Expected non-struct buffer data type (expected end, got '%s')", ts);
+    goto fail;
+  }
+  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+  return 0;
+fail:;
+  __Pyx_ZeroBuffer(buf);
+  return -1;
+}
+static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_float64_t(const char* ts) {
+  int ok;
+  if (*ts == '1') ++ts;
+  switch (*ts) {
+    case 'f': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(float) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
+    case 'd': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(double) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
+    case 'g': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(long double) && (__pyx_t_5numpy_float64_t)-1 < 0); break;  default: ok = 0;
+  }
+  if (!ok) {
+      PyErr_Format(PyExc_ValueError, "Buffer datatype mismatch (rejecting on '%s')", ts);
+      return NULL;
+  } else return ts + 1;
+  
+}
+
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd) {
+  const char* ts;
+  if (obj == Py_None) {
+    __Pyx_ZeroBuffer(buf);
+    return 0;
+  }
+  buf->buf = NULL;
+  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
+  if (buf->ndim != nd) {
+    __Pyx_BufferNdimError(buf, nd);
+    goto fail;
+  }
+  ts = buf->format;
+  ts = __Pyx_ConsumeWhitespace(ts);
+  ts = __Pyx_BufferTypestringCheckEndian(ts);
+  if (!ts) goto fail;
+  ts = __Pyx_ConsumeWhitespace(ts);
+  ts = __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_float64_t(ts);
+  if (!ts) goto fail;
+  ts = __Pyx_ConsumeWhitespace(ts);
+  if (*ts != 0) {
+    PyErr_Format(PyExc_ValueError,
+      "Expected non-struct buffer data type (expected end, got '%s')", ts);
+    goto fail;
+  }
+  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+  return 0;
+fail:;
+  __Pyx_ZeroBuffer(buf);
+  return -1;
+}
 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name, int exact) {
     if (!type) {
         PyErr_Format(PyExc_SystemError, "Missing type object");
@@ -1358,6 +2595,20 @@
     return result;
 }
 
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+    if (!type) {
+        PyErr_Format(PyExc_SystemError, "Missing type object");
+        return 0;
+    }
+    if (obj == Py_None || PyObject_TypeCheck(obj, type))
+        return 1;
+    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
+        Py_TYPE(obj)->tp_name, type->tp_name);
+    return 0;
+}
+
+
+
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
     Py_XINCREF(type);
     Py_XINCREF(value);

Modified: trunk/yt/lagos/RTIntegrator.pyx
==============================================================================
--- trunk/yt/lagos/RTIntegrator.pyx	(original)
+++ trunk/yt/lagos/RTIntegrator.pyx	Mon Sep 22 08:35:20 2008
@@ -69,3 +69,72 @@
         o_s[i] = i_s + dx[i]*(e[i] - i_s*a[i])
         i_s = o_s[i]
     return i_s
+
+ at cython.boundscheck(False)
+def VoxelTraversal(np.ndarray[np.int_t, ndim=3] grid_mask,
+                   np.ndarray[np.float64_t, ndim=1] left_edge,
+                   np.ndarray[np.float64_t, ndim=1] right_edge,
+                   np.ndarray[np.float64_t, ndim=1] dx,
+                   np.ndarray[np.float64_t, ndim=1] u,
+                   np.ndarray[np.float64_t, ndim=1] v):
+    # We're roughly following Amanatides & Woo
+    # Find the first place the ray hits the grid on its path
+    # Do left edge then right edge in each dim
+    cdef int i, x, y
+    cdef double tl, tr, intersect_t, intersect
+    cdef np.ndarray step = np.ones(3, dtype=np.float64) # maybe just ints?
+    cdef np.ndarray cur_ind = np.zeros(3, dtype=np.int64) # maybe just ints?
+    cdef np.ndarray tdelta = np.zeros(3, dtype=np.float64) 
+    cdef np.ndarray tmax = np.zeros(3, dtype=np.float64) 
+    intersect_t = 1e30
+    for i in range(3):
+        # As long as we're iterating, set some other stuff, too
+        if (v[i] < 0): step[i] = -1
+        x = (i+1)%3
+        y = (i+2)%3
+        tl = (left_edge[i] - u[i])/v[i]
+        tr = (right_edge[i] - u[i])/v[i]
+        if (left_edge[x] <= (u[x] + tl*v[x]) < right_edge[x]) and \
+           (left_edge[y] <= (u[y] + tl*v[y]) < right_edge[y]) and \
+           (0 <= tl < intersect_t):
+            intersect_t = tl
+        if (left_edge[x] <= (u[x] + tr*v[x]) < right_edge[x]) and \
+           (left_edge[y] <= (u[y] + tr*v[y]) < right_edge[y]) and \
+           (0 <= tr < intersect_t):
+            intersect_t = tr
+    if (left_edge[0] <= u[0] <= right_edge[0]) and \
+       (left_edge[1] <= u[1] <= right_edge[1]) and \
+       (left_edge[2] <= u[2] <= right_edge[2]):
+        intersect_t = 0
+    if intersect_t > 1e29: return
+    # Now get the indices of the intersection
+    for i in range(3):
+        intersect = u[i] + intersect_t * v[i]
+        cur_ind[i] = np.floor((intersect - left_edge[i])/dx[i])
+        if step[i] > 0: tdelta[i] = intersect - ((cur_ind[i]+1) * dx[i])
+        if step[i] < 0: tdelta[i] = intersect - (cur_ind[i] * dx[i])
+        tmax[i] = dx[i]/v[i]
+    # We now know where we have pierced the grid initially.
+    cdef int in_cells = 1
+    while 1:
+        if cur_ind[0] >= grid_mask.shape[0] or \
+           cur_ind[1] >= grid_mask.shape[1] or \
+           cur_ind[2] >= grid_mask.shape[2]:
+            break
+        else:
+            grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1
+        if tmax[0] < tmax[1]:
+            if tmax[0] < tmax[2]:
+                cur_ind[0] += step[0]
+                tmax[0] += tdelta[0]
+            else:
+                cur_ind[2] += step[2]
+                tmax[2] += tdelta[2]
+        else:
+            if tmax[1] < tmax[2]:
+                cur_ind[1] += step[1]
+                tmax[1] += tdelta[1]
+            else:
+                cur_ind[2] += step[2]
+                tmax[2] += tdelta[2]
+    return

Modified: trunk/yt/lagos/RayTracer.py
==============================================================================
--- trunk/yt/lagos/RayTracer.py	(original)
+++ trunk/yt/lagos/RayTracer.py	Mon Sep 22 08:35:20 2008
@@ -37,7 +37,7 @@
         self.fill_buff()
 
     def _trace_single_ray(self, x, y):
-        ray = self.pf.h.ray(self.axis, (x, y))
+        ray = self.pf.h.ortho_ray(self.axis, (x, y))
         order = ray[axis_names[self.axis]].argsort()
         if self.reverse: order = order[::-1]
         return self.func(ray, order)



More information about the yt-svn mailing list