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

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Wed Oct 22 15:09:53 PDT 2008


Author: mturk
Date: Wed Oct 22 15:09:51 2008
New Revision: 830
URL: http://yt.spacepope.org/changeset/830

Log:
Added:
 * find_max_cell_location (more info on max location)

Deleted:
 * findMax (API incompatibility!)

Fixed some Cython stuff in the Octree generator, specifically making int32
explicit where it needs to be.  (Caused buffer-related breakage on x86_64.)

Also, I just noticed that inside the .c file, there are lots of encodings of my
source-tree path.  I might see if there's an option for removing this...



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

Modified: trunk/yt/lagos/DepthFirstOctree.c
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.c	(original)
+++ trunk/yt/lagos/DepthFirstOctree.c	Wed Oct 22 15:09:51 2008
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.8.1.1 on Tue Sep 23 12:25:13 2008 */
+/* Generated by Cython 0.9.8.1.1 on Wed Oct 22 15:05:45 2008 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -181,9 +181,9 @@
 static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/
 static INLINE const char* __Pyx_BufferTypestringCheckEndian(const char* ts); /*proto*/
 static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim); /*proto*/
-static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int_t(const char* ts); /*proto*/
+static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int32_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 int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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*/
@@ -288,12 +288,28 @@
 
 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/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;
 };
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -303,6 +319,14 @@
   PyObject *dx;
 };
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -359,6 +383,14 @@
 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)";
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/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.int32_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;
@@ -413,7 +445,7 @@
   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;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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_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;}
@@ -422,24 +454,64 @@
   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];
-  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int_t((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_bstride_0_dimensions = __pyx_bstruct_dimensions.strides[0];
   __pyx_bshape_0_dimensions = __pyx_bstruct_dimensions.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 = 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];
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":41
+ *                   np.ndarray[np.int32_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);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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);
@@ -468,6 +540,14 @@
   return __pyx_r;
 }
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -484,6 +564,14 @@
   __Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__cinit__");
   return -1;
   __pyx_L4:;
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -492,6 +580,14 @@
   return __pyx_r;
 }
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -505,6 +601,14 @@
   __Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__getitem__");
   return NULL;
   __pyx_L4:;
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -520,6 +624,14 @@
   return __pyx_r;
 }
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":56
+ * 
+ * @cython.boundscheck(False)
+ * def WalkRootgrid(np.ndarray[np.float64_t, ndim=2] output,             # <<<<<<<<<<<<<<
+ *                  np.ndarray[np.int32_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) {
@@ -589,11 +701,11 @@
   PyObject *__pyx_r;
   long __pyx_1;
   PyObject *__pyx_2 = 0;
-  __pyx_t_5numpy_int_t __pyx_3;
+  __pyx_t_5numpy_int32_t __pyx_3;
   PyObject *__pyx_4 = 0;
-  __pyx_t_5numpy_int_t __pyx_5;
-  __pyx_t_5numpy_int_t __pyx_6;
-  __pyx_t_5numpy_int_t __pyx_7;
+  __pyx_t_5numpy_int32_t __pyx_5;
+  __pyx_t_5numpy_int32_t __pyx_6;
+  __pyx_t_5numpy_int32_t __pyx_7;
   int __pyx_8;
   npy_intp __pyx_9;
   __pyx_t_5numpy_float64_t __pyx_10;
@@ -675,17 +787,33 @@
   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;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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];
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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.int32_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int32_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;
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":67
+ *     cdef OctreeGrid child_grid
+ *     cdef OctreeGrid grid = grids[pi-1]
+ *     cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.int32_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)) {
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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 = 67; __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];
@@ -694,9 +822,17 @@
   __pyx_t_1 = 0;
   Py_INCREF(__pyx_v_grid->child_indices);
   __pyx_v_child_indices = ((PyArrayObject *)__pyx_v_grid->child_indices);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":68
+ *     cdef OctreeGrid grid = grids[pi-1]
+ *     cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int32_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)) {
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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 = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   } else {__pyx_bstride_0_dimensions = __pyx_bstruct_dimensions.strides[0];
@@ -705,6 +841,14 @@
   __pyx_t_2 = 0;
   Py_INCREF(__pyx_v_grid->dimensions);
   __pyx_v_dimensions = ((PyArrayObject *)__pyx_v_grid->dimensions);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":69
+ *     cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int32_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)) {
@@ -716,6 +860,14 @@
   __pyx_t_3 = 0;
   Py_INCREF(__pyx_v_grid->fields);
   __pyx_v_fields = ((PyArrayObject *)__pyx_v_grid->fields);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":70
+ *     cdef np.ndarray[np.int32_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)) {
@@ -727,6 +879,14 @@
   __pyx_t_4 = 0;
   Py_INCREF(__pyx_v_grid->left_edges);
   __pyx_v_leftedges = ((PyArrayObject *)__pyx_v_grid->left_edges);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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)) {
@@ -738,38 +898,118 @@
   __pyx_t_5 = 0;
   Py_INCREF(__pyx_v_grid->dx);
   __pyx_v_dx = ((PyArrayObject *)__pyx_v_grid->dx);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
+  __pyx_3 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_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) {
+
+    /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+    /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
+    __pyx_5 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_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) {
+
+      /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
+      __pyx_6 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_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) {
+
+        /* "/afs/slac.stanford.edu/u/ki/mturk/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;
         if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_bshape_0_child_indices;
         if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_bshape_1_child_indices;
         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_7 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_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;
+
+        /* "/afs/slac.stanford.edu/u/ki/mturk/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) {
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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) {
+
+            /* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -785,24 +1025,80 @@
             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;
           }
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+          *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_18, __pyx_bstride_0_refined)) = 0;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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*/ {
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+          *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_19, __pyx_bstride_0_refined)) = 1;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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 = 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;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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);
@@ -824,6 +1120,14 @@
           Py_INCREF(__pyx_v_child_grid->dx);
           Py_DECREF(((PyObject *)__pyx_v_child_dx));
           __pyx_v_child_dx = ((PyArrayObject *)__pyx_v_child_grid->dx);
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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);
@@ -845,6 +1149,14 @@
           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);
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
@@ -867,6 +1179,14 @@
           __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_12;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
@@ -889,6 +1209,14 @@
           __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;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
@@ -911,6 +1239,14 @@
           __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_12;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;}
@@ -995,6 +1331,14 @@
   return __pyx_r;
 }
 
+/* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -1143,17 +1487,33 @@
   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;}
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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];
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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.int32_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int32_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 = 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;
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":109
+ *     cdef OctreeGrid child_grid
+ *     cdef OctreeGrid grid = grids[gi-1]
+ *     cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[np.int32_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)) {
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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 = 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];
@@ -1162,9 +1522,17 @@
   __pyx_t_1 = 0;
   Py_INCREF(__pyx_v_grid->child_indices);
   __pyx_v_child_indices = ((PyArrayObject *)__pyx_v_grid->child_indices);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":110
+ *     cdef OctreeGrid grid = grids[gi-1]
+ *     cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int32_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)) {
+  if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   } else {__pyx_bstride_0_dimensions = __pyx_bstruct_dimensions.strides[0];
@@ -1173,6 +1541,14 @@
   __pyx_t_2 = 0;
   Py_INCREF(__pyx_v_grid->dimensions);
   __pyx_v_dimensions = ((PyArrayObject *)__pyx_v_grid->dimensions);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":111
+ *     cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ *     cdef np.ndarray[np.int32_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)) {
@@ -1184,6 +1560,14 @@
   __pyx_t_3 = 0;
   Py_INCREF(__pyx_v_grid->fields);
   __pyx_v_fields = ((PyArrayObject *)__pyx_v_grid->fields);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":112
+ *     cdef np.ndarray[np.int32_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)) {
@@ -1195,6 +1579,14 @@
   __pyx_t_4 = 0;
   Py_INCREF(__pyx_v_grid->left_edges);
   __pyx_v_leftedges = ((PyArrayObject *)__pyx_v_grid->left_edges);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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)) {
@@ -1206,12 +1598,68 @@
   __pyx_t_5 = 0;
   Py_INCREF(__pyx_v_grid->dx);
   __pyx_v_dx = ((PyArrayObject *)__pyx_v_grid->dx);
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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) {
+
+    /* "/afs/slac.stanford.edu/u/ki/mturk/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);
+
+    /* "/afs/slac.stanford.edu/u/ki/mturk/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) {
+
+      /* "/afs/slac.stanford.edu/u/ki/mturk/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);
+
+      /* "/afs/slac.stanford.edu/u/ki/mturk/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) {
+
+        /* "/afs/slac.stanford.edu/u/ki/mturk/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);
+
+        /* "/afs/slac.stanford.edu/u/ki/mturk/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;}
@@ -1227,10 +1675,34 @@
         __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;
+
+        /* "/afs/slac.stanford.edu/u/ki/mturk/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) {
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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) {
+
+            /* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -1246,24 +1718,80 @@
             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;
           }
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+          *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_12, __pyx_bstride_0_refined)) = 0;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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*/ {
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+          *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_13, __pyx_bstride_0_refined)) = 1;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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_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_3);
           __pyx_3 = 0;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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);
@@ -1285,6 +1813,14 @@
           Py_INCREF(__pyx_v_child_grid->dx);
           Py_DECREF(((PyObject *)__pyx_v_child_dx));
           __pyx_v_child_dx = ((PyArrayObject *)__pyx_v_child_grid->dx);
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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);
@@ -1306,6 +1842,14 @@
           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);
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
@@ -1328,6 +1872,14 @@
           Py_DECREF(__pyx_v_child_i);
           __pyx_v_child_i = __pyx_2;
           __pyx_2 = 0;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
@@ -1350,6 +1902,14 @@
           Py_DECREF(__pyx_v_child_j);
           __pyx_v_child_j = __pyx_4;
           __pyx_4 = 0;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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)));
@@ -1372,6 +1932,13 @@
           Py_DECREF(__pyx_v_child_k);
           __pyx_v_child_k = __pyx_3;
           __pyx_3 = 0;
+
+          /* "/afs/slac.stanford.edu/u/ki/mturk/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;}
@@ -1405,6 +1972,12 @@
       }
     }
   }
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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;
@@ -1458,6 +2031,14 @@
   return __pyx_r;
 }
 
+/* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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;
@@ -1466,8 +2047,24 @@
   int __pyx_1;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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) {
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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);
@@ -1479,61 +2076,261 @@
     goto __pyx_L5;
   }
   __pyx_L5:;
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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));
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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));
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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)));
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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)));
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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;
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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));
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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)));
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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));
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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;
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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:
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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;
   }
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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) {
+
+    /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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;
@@ -1548,6 +2345,14 @@
     goto __pyx_L6;
   }
   __pyx_L6:;
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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;
@@ -2237,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 ---*/
+
+  /* "/afs/slac.stanford.edu/u/ki/mturk/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;
+
+  /* "/u/ki/mturk/ki12/x86_64_local/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-linux-x86_64.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
@@ -2322,15 +3143,15 @@
 }
 
 
-static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int_t(const char* ts) {
+static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int32_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;
+    case 'b': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(char) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+    case 'h': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(short) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+    case 'i': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(int) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+    case 'l': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+    case 'q': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long long) && (__pyx_t_5numpy_int32_t)-1 < 0); break;  default: ok = 0;
   }
   if (!ok) {
       PyErr_Format(PyExc_ValueError, "Buffer datatype mismatch (rejecting on '%s')", ts);
@@ -2339,7 +3160,7 @@
   
 }
 
-static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int_t(PyObject* obj, Py_buffer* buf, int flags, int nd) {
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd) {
   const char* ts;
   if (obj == Py_None) {
     __Pyx_ZeroBuffer(buf);
@@ -2356,7 +3177,7 @@
   ts = __Pyx_BufferTypestringCheckEndian(ts);
   if (!ts) goto fail;
   ts = __Pyx_ConsumeWhitespace(ts);
-  ts = __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int_t(ts);
+  ts = __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int32_t(ts);
   if (!ts) goto fail;
   ts = __Pyx_ConsumeWhitespace(ts);
   if (*ts != 0) {

Modified: trunk/yt/lagos/DepthFirstOctree.pyx
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.pyx	(original)
+++ trunk/yt/lagos/DepthFirstOctree.pyx	Wed Oct 22 15:09:51 2008
@@ -33,10 +33,10 @@
 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.int32_t, ndim=3] child_indices,
                   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.int32_t, ndim=1] dimensions,
                   np.ndarray[np.float64_t, ndim=1] dx):
         self.child_indices = child_indices
         self.fields = fields
@@ -54,7 +54,7 @@
 
 @cython.boundscheck(False)
 def WalkRootgrid(np.ndarray[np.float64_t, ndim=2] output,
-                 np.ndarray[np.int_t, ndim=1] refined,
+                 np.ndarray[np.int32_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
@@ -64,8 +64,8 @@
     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.int32_t, ndim=3] child_indices = grid.child_indices
+    cdef np.ndarray[np.int32_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
@@ -100,14 +100,14 @@
 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,
-                  np.ndarray[np.int_t, ndim=1] refined,
+                  np.ndarray[np.int32_t, ndim=1] refined,
                   OctreeGridList grids):
     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.int32_t, ndim=3] child_indices = grid.child_indices
+    cdef np.ndarray[np.int32_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

Modified: trunk/yt/lagos/HierarchyType.py
==============================================================================
--- trunk/yt/lagos/HierarchyType.py	(original)
+++ trunk/yt/lagos/HierarchyType.py	Wed Oct 22 15:09:51 2008
@@ -230,6 +230,11 @@
         """
         Returns (value, center) of location of maximum for a given field.
         """
+        mg, mc, mv, pos = self.find_max_cell_location(field, finestLevels)
+        return mv, pos
+    findMax = find_max
+
+    def find_max_cell_location(self, field, finestLevels = True):
         if finestLevels:
             gI = na.where(self.gridLevels >= self.maxLevel - NUMTOCHECK)
         else:
@@ -253,9 +258,7 @@
                              maxGrid["z-velocity"][maxCoord])
         self.parameters["Max%sValue" % (field)] = maxVal
         self.parameters["Max%sPos" % (field)] = "%s" % (pos)
-        return maxVal, pos
-
-    findMax = find_max
+        return maxGrid, maxCoord, maxVal, pos
 
     @time_execution
     def find_min(self, field):
@@ -466,16 +469,16 @@
         for g in self.grids:
             ff = na.array([g[f] for f in fields])
             grids.append(dfo.OctreeGrid(
-                            g.child_index_mask,
+                            g.child_index_mask.astype('int32'),
                             ff.astype("float64"),
                             g.LeftEdge.astype('float64'),
-                            g.ActiveDimensions.astype('int'),
+                            g.ActiveDimensions.astype('int32'),
                             na.ones(1,dtype='float64') * g.dx))
             o_length += g.child_mask.ravel().sum()
             r_length += g.ActiveDimensions.prod()
             g.clear_data()
         output = na.zeros((o_length,len(fields)), dtype='float64')
-        refined = na.zeros(r_length, dtype='int')
+        refined = na.zeros(r_length, dtype='int32')
         ogl = dfo.OctreeGridList(grids)
         dfo.WalkRootgrid(output, refined, ogl, 1, 0)
         return output, refined



More information about the yt-svn mailing list