/* Generated by Cython 0.23.1 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_1"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None)

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__yt__frontends__artio___artio_caller
#define __PYX_HAVE_API__yt__frontends__artio___artio_caller
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "math.h"
#include "search.h"
#include "platform_dep.h"
#include "stdint.h"
#include "cosmology.h"
#include "artio.h"
#include "artio_internal.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "yt/frontends/artio/_artio_caller.pyx",
  "yt/geometry/selection_routines.pxd",
  "yt/geometry/particle_deposit.pxd",
  "__init__.pxd",
  "type.pxd",
  "yt/geometry/oct_container.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;


/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif


/*--- Type declarations ---*/
struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject;
struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector;
struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer;
struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer;
struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation;
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset;
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler;
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer;
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer;
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_t_2yt_8geometry_12oct_visitors_Oct;
struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData;

/* "oct_visitors.pxd":19
 * cimport numpy as np
 * 
 * cdef struct Oct             # <<<<<<<<<<<<<<
 * cdef struct Oct:
 *     np.int64_t file_ind     # index with respect to the order in which it was
 */
struct __pyx_t_2yt_8geometry_12oct_visitors_Oct {
  __pyx_t_5numpy_int64_t file_ind;
  __pyx_t_5numpy_int64_t domain_ind;
  __pyx_t_5numpy_int64_t domain;
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **children;
};

/* "oct_visitors.pxd":27
 *     Oct **children          # Up to 8 long
 * 
 * cdef struct OctVisitorData:             # <<<<<<<<<<<<<<
 *     np.uint64_t index
 *     np.uint64_t last
 */
struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData {
  __pyx_t_5numpy_uint64_t index;
  __pyx_t_5numpy_uint64_t last;
  __pyx_t_5numpy_int64_t global_index;
  __pyx_t_5numpy_int64_t pos[3];
  __pyx_t_5numpy_uint8_t ind[3];
  void *array;
  int dims;
  __pyx_t_5numpy_int32_t domain;
  __pyx_t_5numpy_int8_t level;
  __pyx_t_5numpy_int8_t oref;
  __pyx_t_5numpy_int32_t nz;
};

/* "oct_visitors.pxd":41
 *     np.int32_t nz
 * 
 * ctypedef void oct_visitor_function(Oct *, OctVisitorData *visitor,             # <<<<<<<<<<<<<<
 *                                    np.uint8_t selected)
 * 
 */
typedef void __pyx_t_2yt_8geometry_12oct_visitors_oct_visitor_function(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *, __pyx_t_5numpy_uint8_t);
struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode;
struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData;

/* "grid_visitors.pxd":19
 * cimport numpy as np
 * 
 * cdef struct GridTreeNode:             # <<<<<<<<<<<<<<
 *     int num_children
 *     int level
 */
struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode {
  int num_children;
  int level;
  __pyx_t_5numpy_int64_t index;
  __pyx_t_5numpy_float64_t left_edge[3];
  __pyx_t_5numpy_float64_t right_edge[3];
  struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **children;
  __pyx_t_5numpy_int64_t start_index[3];
  int dims[3];
  __pyx_t_5numpy_float64_t dds[3];
};

/* "grid_visitors.pxd":30
 *     np.float64_t dds[3]
 * 
 * cdef struct GridVisitorData:             # <<<<<<<<<<<<<<
 *     GridTreeNode *grid
 *     np.uint64_t index
 */
struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData {
  struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *grid;
  __pyx_t_5numpy_uint64_t index;
  __pyx_t_5numpy_uint64_t global_index;
  __pyx_t_5numpy_int64_t pos[3];
  int n_tuples;
  int **child_tuples;
  void *array;
  int ref_factor;
};

/* "grid_visitors.pxd":46
 * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil
 * 
 * ctypedef void grid_visitor_function(GridVisitorData *data,             # <<<<<<<<<<<<<<
 *                                          np.uint8_t selected) nogil
 * # This is similar in spirit to the way oct visitor functions work.  However,
 */
typedef void __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t);
struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs;
struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid;
struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells;

/* "yt/geometry/selection_routines.pxd":41
 *     cdef bint periodicity[3]
 * 
 *     cdef void recursively_visit_octs(self, Oct *root,             # <<<<<<<<<<<<<<
 *                         np.float64_t pos[3], np.float64_t dds[3],
 *                         int level,
 */
struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs {
  int __pyx_n;
  int visit_covered;
};

/* "yt/geometry/selection_routines.pxd":50
 *                               np.float64_t spos[3], np.float64_t sdds[3],
 *                               oct_visitor_function *func, int i, int j, int k)
 *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
 *                                np.float64_t right_edge[3],
 *                                np.int32_t level, Oct *o = ?) nogil
 */
struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid {
  int __pyx_n;
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
};

/* "yt/geometry/selection_routines.pxd":65
 *                                 np.ndarray[np.uint8_t, ndim=3] mask,
 *                                 int level)
 *     cdef void visit_grid_cells(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
 *                     grid_visitor_function *func, np.uint8_t *cached_mask = ?)
 * 
 */
struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells {
  int __pyx_n;
  __pyx_t_5numpy_uint8_t *cached_mask;
};
struct __pyx_t_2yt_8geometry_13oct_container_OctKey;
struct __pyx_t_2yt_8geometry_13oct_container_OctInfo;
struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer;
struct __pyx_t_2yt_8geometry_13oct_container_OctList;
struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get;
struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs;
struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_setup_data;

/* "yt/geometry/oct_container.pxd":29
 * cdef int ORDER_MAX
 * 
 * cdef struct OctKey:             # <<<<<<<<<<<<<<
 *     np.int64_t key
 *     Oct *node
 */
struct __pyx_t_2yt_8geometry_13oct_container_OctKey {
  __pyx_t_5numpy_int64_t key;
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node;
};

/* "yt/geometry/oct_container.pxd":33
 *     Oct *node
 * 
 * cdef struct OctInfo:             # <<<<<<<<<<<<<<
 *     np.float64_t left_edge[3]
 *     np.float64_t dds[3]
 */
struct __pyx_t_2yt_8geometry_13oct_container_OctInfo {
  __pyx_t_5numpy_float64_t left_edge[3];
  __pyx_t_5numpy_float64_t dds[3];
  __pyx_t_5numpy_int64_t ipos[3];
  __pyx_t_5numpy_int32_t level;
};

/* "yt/geometry/oct_container.pxd":39
 *     np.int32_t level
 * 
 * cdef struct OctAllocationContainer             # <<<<<<<<<<<<<<
 * cdef struct OctAllocationContainer:
 *     np.int64_t n
 */
struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer {
  __pyx_t_5numpy_int64_t n;
  __pyx_t_5numpy_int64_t n_assigned;
  __pyx_t_5numpy_int64_t offset;
  __pyx_t_5numpy_int64_t con_id;
  struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *next;
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_octs;
};

/* "yt/geometry/oct_container.pxd":48
 *     Oct *my_octs
 * 
 * cdef struct OctList             # <<<<<<<<<<<<<<
 * 
 * cdef struct OctList:
 */
struct __pyx_t_2yt_8geometry_13oct_container_OctList {
  struct __pyx_t_2yt_8geometry_13oct_container_OctList *next;
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
};

/* "yt/geometry/oct_container.pxd":71
 *     cdef public np.int64_t nocts
 *     cdef public int num_domains
 *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?,             # <<<<<<<<<<<<<<
 *                   int max_level = ?)
 *     cdef int get_root(self, int ind[3], Oct **o)
 */
struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get {
  int __pyx_n;
  struct __pyx_t_2yt_8geometry_13oct_container_OctInfo *oinfo;
  int max_level;
};

/* "yt/geometry/oct_container.pxd":80
 *     # OctAllocationContainer.offset if such a thing exists.
 *     cdef np.int64_t get_domain_offset(self, int domain_id)
 *     cdef void visit_all_octs(self,             # <<<<<<<<<<<<<<
 *                         selection_routines.SelectorObject selector,
 *                         oct_visitor_function *func,
 */
struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs {
  int __pyx_n;
  int vc;
};

/* "yt/geometry/oct_container.pxd":87
 *     cdef Oct *next_root(self, int domain_id, int ind[3])
 *     cdef Oct *next_child(self, int domain_id, int ind[3], Oct *parent)
 *     cdef void setup_data(self, OctVisitorData *data, int domain_id = ?)             # <<<<<<<<<<<<<<
 *     cdef void append_domain(self, np.int64_t domain_count)
 * 
 */
struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_setup_data {
  int __pyx_n;
  int domain_id;
};

/* "yt/geometry/particle_deposit.pxd":86
 * # So in order to mimic a registry functionality,
 * # I manually created a function to lookup the kernel functions.
 * ctypedef np.float64_t (*kernel_func) (np.float64_t)             # <<<<<<<<<<<<<<
 * cdef inline kernel_func get_kernel_func(str kernel_name):
 *     if kernel_name == 'cubic':
 */
typedef __pyx_t_5numpy_float64_t (*__pyx_t_2yt_8geometry_16particle_deposit_kernel_func)(__pyx_t_5numpy_float64_t);
struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_check_artio_status;
struct __pyx_t_2yt_9frontends_5artio_13_artio_caller_particle_var_pointers;
struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid;

/* "yt/frontends/artio/_artio_caller.pyx":152
 *     void artio_sfc_coords( artio_fileset_handle *handle, int64_t index, int coords[3] ) nogil
 * 
 * cdef void check_artio_status(int status, char *fname="[unknown]"):             # <<<<<<<<<<<<<<
 *     if status != ARTIO_SUCCESS:
 *         import traceback
 */
struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_check_artio_status {
  int __pyx_n;
  char *fname;
};

/* "yt/frontends/artio/_artio_caller.pyx":871
 *     return (coords[0], coords[1], coords[2])
 * 
 * cdef struct particle_var_pointers:             # <<<<<<<<<<<<<<
 *     # The number of particles we have filled
 *     np.int64_t count
 */
struct __pyx_t_2yt_9frontends_5artio_13_artio_caller_particle_var_pointers {
  __pyx_t_5numpy_int64_t count;
  int n_p;
  int p_ind[16];
  int n_s;
  int s_ind[16];
  int n_mass;
  __pyx_t_5numpy_float64_t *mass;
  int n_pid;
  __pyx_t_5numpy_int64_t *pid;
  int n_species;
  __pyx_t_5numpy_int8_t *species;
  __pyx_t_5numpy_float64_t *pvars[16];
  __pyx_t_5numpy_float64_t *svars[16];
};

/* "yt/frontends/artio/_artio_caller.pyx":1663
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
 *                          np.float64_t right_edge[3], np.int32_t level,
 *                          Oct *o = NULL) nogil:
 */
struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid {
  int __pyx_n;
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
};

/* "yt/geometry/selection_routines.pxd":34
 *     return arr
 * 
 * cdef class SelectorObject:             # <<<<<<<<<<<<<<
 *     cdef public np.int32_t min_level
 *     cdef public np.int32_t max_level
 */
struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject {
  PyObject_HEAD
  struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtab;
  __pyx_t_5numpy_int32_t min_level;
  __pyx_t_5numpy_int32_t max_level;
  int overlap_cells;
  __pyx_t_5numpy_float64_t domain_width[3];
  int periodicity[3];
};


/* "yt/geometry/selection_routines.pxd":71
 *     cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil
 * 
 * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
};


/* "yt/geometry/selection_routines.pxd":74
 *     pass
 * 
 * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
 *     cdef SelectorObject base_selector
 *     cdef public np.int64_t domain_id
 */
struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *base_selector;
  __pyx_t_5numpy_int64_t domain_id;
};


/* "yt/geometry/oct_container.pxd":58
 * cdef void OctList_delete(OctList *list)
 * 
 * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
 *     cdef OctAllocationContainer *cont
 *     cdef OctAllocationContainer **domains
 */
struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer {
  PyObject_HEAD
  struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab;
  struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *cont;
  struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer **domains;
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh;
  __pyx_t_2yt_8geometry_12oct_visitors_oct_visitor_function *fill_func;
  int partial_coverage;
  int level_offset;
  int nn[3];
  __pyx_t_5numpy_uint8_t oref;
  __pyx_t_5numpy_float64_t DLE[3];
  __pyx_t_5numpy_float64_t DRE[3];
  __pyx_t_5numpy_int64_t nocts;
  int num_domains;
};


/* "yt/geometry/oct_container.pxd":90
 *     cdef void append_domain(self, np.int64_t domain_count)
 * 
 * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
 *     cdef OctKey *root_nodes
 *     cdef void *tree_root
 */
struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer {
  struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
  struct __pyx_t_2yt_8geometry_13oct_container_OctKey *root_nodes;
  void *tree_root;
  int num_root;
  int max_root;
};


/* "yt/geometry/oct_container.pxd":98
 *     cdef np.int64_t ipos_to_key(self, int pos[3])
 * 
 * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
  struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
};


/* "yt/geometry/particle_deposit.pxd":97
 *         raise NotImplementedError
 * 
 * cdef class ParticleDepositOperation:             # <<<<<<<<<<<<<<
 *     # We assume each will allocate and define their own temporary storage
 *     cdef kernel_func sph_kernel
 */
struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation {
  PyObject_HEAD
  struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_vtab;
  __pyx_t_2yt_8geometry_16particle_deposit_kernel_func sph_kernel;
  PyObject *nvals;
  int update_values;
};


/* "yt/frontends/artio/_artio_caller.pyx":160
 *         raise RuntimeError('failure with status', status, 'in function',fname,'from caller', callername, nline)
 * 
 * cdef class artio_fileset :             # <<<<<<<<<<<<<<
 *     cdef public object parameters
 *     cdef artio_fileset_handle *handle
 */
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset {
  PyObject_HEAD
  PyObject *parameters;
  artio_fileset *handle;
  CosmologyParameters *cosmology;
  float tcode_to_years;
  int num_grid;
  int64_t num_root_cells;
  int64_t sfc_min;
  int64_t sfc_max;
  int has_grid;
  int min_level;
  int max_level;
  int num_grid_variables;
  int *num_octs_per_level;
  float *grid_variables;
  int has_particles;
  int num_species;
  int *particle_position_index;
  int *num_particles_per_species;
  double *primary_variables;
  float *secondary_variables;
};


/* "yt/frontends/artio/_artio_caller.pyx":705
 *     return True
 * 
 * cdef class ARTIOSFCRangeHandler:             # <<<<<<<<<<<<<<
 *     cdef public np.int64_t sfc_start
 *     cdef public np.int64_t sfc_end
 */
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler {
  PyObject_HEAD
  __pyx_t_5numpy_int64_t sfc_start;
  __pyx_t_5numpy_int64_t sfc_end;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *artio_handle;
  PyObject *root_mesh_handler;
  PyObject *oct_count;
  PyObject *octree_handler;
  artio_fileset *handle;
  __pyx_t_5numpy_float64_t DLE[3];
  __pyx_t_5numpy_float64_t DRE[3];
  __pyx_t_5numpy_float64_t dds[3];
  __pyx_t_5numpy_int64_t dims[3];
  __pyx_t_5numpy_int64_t total_octs;
  __pyx_t_5numpy_int64_t *doct_count;
  __pyx_t_5numpy_int64_t **pcount;
  float **root_mesh_data;
  __pyx_t_5numpy_int64_t nvars[2];
};


/* "yt/frontends/artio/_artio_caller.pyx":891
 *     np.float64_t *svars[16]
 * 
 * cdef class ARTIOOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
 *     # This is a transitory, created-on-demand OctreeContainer.  It should not
 *     # be considered to be long-lasting, and during its creation it will read
 */
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer {
  struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *artio_handle;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *range_handler;
  __pyx_t_5numpy_int64_t level_indices[32];
  __pyx_t_5numpy_int64_t sfc_start;
  __pyx_t_5numpy_int64_t sfc_end;
};


/* "yt/frontends/artio/_artio_caller.pyx":1257
 *     return data
 * 
 * cdef class ARTIORootMeshContainer:             # <<<<<<<<<<<<<<
 *     cdef public artio_fileset artio_handle
 *     cdef np.float64_t DLE[3]
 */
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer {
  PyObject_HEAD
  struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_vtab;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *artio_handle;
  __pyx_t_5numpy_float64_t DLE[3];
  __pyx_t_5numpy_float64_t DRE[3];
  __pyx_t_5numpy_float64_t dds[3];
  __pyx_t_5numpy_int64_t dims[3];
  artio_fileset *handle;
  __pyx_t_5numpy_uint64_t sfc_start;
  __pyx_t_5numpy_uint64_t sfc_end;
  PyObject *_last_mask;
  __pyx_t_5numpy_int64_t _last_selector_id;
  __pyx_t_5numpy_int64_t _last_mask_sum;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *range_handler;
  __pyx_t_5numpy_uint8_t *sfc_mask;
  __pyx_t_5numpy_int64_t nsfc;
};


/* "yt/frontends/artio/_artio_caller.pyx":1607
 *                     field_pointers[j][i] = field_vals[j]
 * 
 * cdef class SFCRangeSelector(SelectorObject):             # <<<<<<<<<<<<<<
 * 
 *     cdef SelectorObject base_selector
 */
struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *base_selector;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *range_handler;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *mesh_container;
  __pyx_t_5numpy_int64_t sfc_start;
  __pyx_t_5numpy_int64_t sfc_end;
};



/* "yt/geometry/selection_routines.pxd":34
 *     return arr
 * 
 * cdef class SelectorObject:             # <<<<<<<<<<<<<<
 *     cdef public np.int32_t min_level
 *     cdef public np.int32_t max_level
 */

struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject {
  void (*recursively_visit_octs)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int, __pyx_t_2yt_8geometry_12oct_visitors_oct_visitor_function *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs *__pyx_optional_args);
  void (*visit_oct_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_2yt_8geometry_12oct_visitors_oct_visitor_function *, int, int, int);
  int (*select_grid)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args);
  int (*select_cell)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
  int (*select_point)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *);
  int (*select_sphere)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t);
  int (*select_bbox)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
  int (*fill_mask_selector)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, PyArrayObject *, PyArrayObject *, int);
  void (*visit_grid_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells *__pyx_optional_args);
  __pyx_t_5numpy_float64_t (*difference)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int);
};
static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject;


/* "yt/geometry/selection_routines.pxd":71
 *     cdef np.float64_t difference(self, np.float64_t x1, np.float64_t x2, int d) nogil
 * 
 * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector {
  struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
};
static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector;


/* "yt/geometry/selection_routines.pxd":74
 *     pass
 * 
 * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
 *     cdef SelectorObject base_selector
 *     cdef public np.int64_t domain_id
 */

struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
  struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
};
static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector;


/* "yt/geometry/oct_container.pxd":58
 * cdef void OctList_delete(OctList *list)
 * 
 * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
 *     cdef OctAllocationContainer *cont
 *     cdef OctAllocationContainer **domains
 */

struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer {
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*get)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_float64_t *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args);
  int (*get_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **);
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **(*neighbors)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_t_2yt_8geometry_13oct_container_OctInfo *, __pyx_t_5numpy_int64_t *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
  void (*oct_bounds)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
  __pyx_t_5numpy_int64_t (*get_domain_offset)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int);
  void (*visit_all_octs)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_2yt_8geometry_12oct_visitors_oct_visitor_function *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args);
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *);
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_child)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *);
  void (*setup_data)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_setup_data *__pyx_optional_args);
  void (*append_domain)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t);
};
static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;


/* "yt/geometry/oct_container.pxd":90
 *     cdef void append_domain(self, np.int64_t domain_count)
 * 
 * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
 *     cdef OctKey *root_nodes
 *     cdef void *tree_root
 */

struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer {
  struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
  void (*key_to_ipos)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *);
  __pyx_t_5numpy_int64_t (*ipos_to_key)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, int *);
};
static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;


/* "yt/geometry/oct_container.pxd":98
 *     cdef np.int64_t ipos_to_key(self, int pos[3])
 * 
 * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
  struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
};
static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer;


/* "yt/geometry/particle_deposit.pxd":97
 *         raise NotImplementedError
 * 
 * cdef class ParticleDepositOperation:             # <<<<<<<<<<<<<<
 *     # We assume each will allocate and define their own temporary storage
 *     cdef kernel_func sph_kernel
 */

struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation {
  void (*process)(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *, int *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int64_t);
};
static struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation;


/* "yt/frontends/artio/_artio_caller.pyx":891
 *     np.float64_t *svars[16]
 * 
 * cdef class ARTIOOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
 *     # This is a transitory, created-on-demand OctreeContainer.  It should not
 *     # be considered to be long-lasting, and during its creation it will read
 */

struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer {
  struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
  void (*initialize_local_mesh)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *, __pyx_t_5numpy_int64_t, int, int *, __pyx_t_5numpy_int64_t);
};
static struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer;


/* "yt/frontends/artio/_artio_caller.pyx":1257
 *     return data
 * 
 * cdef class ARTIORootMeshContainer:             # <<<<<<<<<<<<<<
 *     cdef public artio_fileset artio_handle
 *     cdef np.float64_t DLE[3]
 */

struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer {
  __pyx_t_5numpy_int64_t (*pos_to_sfc)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *, __pyx_t_5numpy_float64_t *);
  void (*sfc_to_pos)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *);
  __pyx_t_5numpy_int64_t (*count_cells)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *);
};
static struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer;


/* "yt/frontends/artio/_artio_caller.pyx":1607
 *                     field_pointers[j][i] = field_vals[j]
 * 
 * cdef class SFCRangeSelector(SelectorObject):             # <<<<<<<<<<<<<<
 * 
 *     cdef SelectorObject base_selector
 */

struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector {
  struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
};
static struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector;

/* --- Runtime support code (head) --- */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact);

static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

static void __Pyx_RaiseBufferFallbackError(void);

#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

static void* __Pyx_GetVtable(PyObject *dict);

static int __Pyx_SetVtable(PyObject *dict, void *vtable);

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};

static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eqf(a, b)   ((a)==(b))
    #define __Pyx_c_sumf(a, b)  ((a)+(b))
    #define __Pyx_c_difff(a, b) ((a)-(b))
    #define __Pyx_c_prodf(a, b) ((a)*(b))
    #define __Pyx_c_quotf(a, b) ((a)/(b))
    #define __Pyx_c_negf(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zerof(z) ((z)==(float)0)
    #define __Pyx_c_conjf(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_absf(z)     (::std::abs(z))
        #define __Pyx_c_powf(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zerof(z) ((z)==0)
    #define __Pyx_c_conjf(z)    (conjf(z))
    #if 1
        #define __Pyx_c_absf(z)     (cabsf(z))
        #define __Pyx_c_powf(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq(a, b)   ((a)==(b))
    #define __Pyx_c_sum(a, b)  ((a)+(b))
    #define __Pyx_c_diff(a, b) ((a)-(b))
    #define __Pyx_c_prod(a, b) ((a)*(b))
    #define __Pyx_c_quot(a, b) ((a)/(b))
    #define __Pyx_c_neg(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero(z) ((z)==(double)0)
    #define __Pyx_c_conj(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (::std::abs(z))
        #define __Pyx_c_pow(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero(z) ((z)==0)
    #define __Pyx_c_conj(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (cabs(z))
        #define __Pyx_c_pow(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

static int __Pyx_check_binary_version(void);

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name);

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);

static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);

static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static void __pyx_f_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_initialize_local_mesh(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_oct_count, int __pyx_v_num_oct_levels, int *__pyx_v_num_octs_per_level, __pyx_t_5numpy_int64_t __pyx_v_sfc); /* proto*/
static __pyx_t_5numpy_int64_t __pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_pos_to_sfc(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/
static void __pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_sfc_to_pos(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_sfc, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/
static __pyx_t_5numpy_int64_t __pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_count_cells(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto*/
static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius); /* proto*/
static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_cell(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds); /* proto*/
static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_point(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos); /* proto*/
static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_bbox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge); /* proto*/
static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid *__pyx_optional_args); /* proto*/

/* Module declarations from 'cython' */

/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'cpython' */

/* Module declarations from 'cpython.object' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'yt.geometry.oct_visitors' */
static __pyx_t_2yt_8geometry_12oct_visitors_oct_visitor_function *__pyx_f_2yt_8geometry_12oct_visitors_fill_file_indices_oind; /*proto*/
static __pyx_t_2yt_8geometry_12oct_visitors_oct_visitor_function *__pyx_f_2yt_8geometry_12oct_visitors_fill_file_indices_rind; /*proto*/
static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int, int, int); /*proto*/

/* Module declarations from 'yt.geometry.grid_visitors' */
static __pyx_t_5numpy_uint8_t (*__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked)(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/

/* Module declarations from 'yt.geometry.selection_routines' */
static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0;
static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0;
static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0;

/* Module declarations from 'yt.utilities.lib.fp_utils' */
static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int, int); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/

/* Module declarations from 'fp_utils' */
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/

/* Module declarations from 'libc.math' */

/* Module declarations from 'yt.geometry.oct_container' */
static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0;
static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0;
static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0;
static int *__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX = 0;
#define __pyx_v_2yt_8geometry_13oct_container_ORDER_MAX (*__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX)

/* Module declarations from 'yt.geometry.particle_deposit' */
static PyTypeObject *__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = 0;
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t); /*proto*/

/* Module declarations from 'libc.stdint' */

/* Module declarations from 'yt.frontends.artio._artio_caller' */
static PyTypeObject *__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset = 0;
static PyTypeObject *__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler = 0;
static PyTypeObject *__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer = 0;
static PyTypeObject *__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer = 0;
static PyTypeObject *__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector = 0;
static void __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(int, struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_check_artio_status *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_2yt_9frontends_5artio_13_artio_caller_read_sfc_particles(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, int, PyObject *, __pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t **); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
#define __Pyx_MODULE_NAME "yt.frontends.artio._artio_caller"
int __pyx_module_is_main_yt__frontends__artio___artio_caller = 0;

/* Implementation of 'yt.frontends.artio._artio_caller' */
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_NotImplementedError;
static char __pyx_k_3[] = "3";
static char __pyx_k_B[] = "B";
static char __pyx_k_C[] = "C";
static char __pyx_k_H[] = "H";
static char __pyx_k_I[] = "I";
static char __pyx_k_L[] = "L";
static char __pyx_k_O[] = "O";
static char __pyx_k_Q[] = "Q";
static char __pyx_k_b[] = "b";
static char __pyx_k_d[] = "d";
static char __pyx_k_f[] = "f";
static char __pyx_k_g[] = "g";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "i";
static char __pyx_k_l[] = "l";
static char __pyx_k_q[] = "q";
static char __pyx_k_s[] = "s";
static char __pyx_k_Zd[] = "Zd";
static char __pyx_k_Zf[] = "Zf";
static char __pyx_k_Zg[] = "Zg";
static char __pyx_k_np[] = "np";
static char __pyx_k_pi[] = "pi";
static char __pyx_k_PID[] = "PID";
static char __pyx_k_add[] = "add";
static char __pyx_k_get[] = "get";
static char __pyx_k_int[] = "int";
static char __pyx_k_max[] = "max";
static char __pyx_k_sum[] = "sum";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_MASS[] = "MASS";
static char __pyx_k_abox[] = "abox";
static char __pyx_k_bool[] = "bool";
static char __pyx_k_dest[] = "dest";
static char __pyx_k_dims[] = "dims";
static char __pyx_k_dobj[] = "dobj";
static char __pyx_k_init[] = "__init__";
static char __pyx_k_int8[] = "int8";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_mask[] = "mask";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_Field[] = "Field";
static char __pyx_k_cubic[] = "cubic";
static char __pyx_k_dtype[] = "dtype";
static char __pyx_k_empty[] = "empty";
static char __pyx_k_index[] = "index";
static char __pyx_k_int64[] = "int64";
static char __pyx_k_numpy[] = "numpy";
static char __pyx_k_order[] = "order";
static char __pyx_k_range[] = "range";
static char __pyx_k_super[] = "super";
static char __pyx_k_uint8[] = "uint8";
static char __pyx_k_units[] = "units";
static char __pyx_k_utf_8[] = "utf-8";
static char __pyx_k_zeros[] = "zeros";
static char __pyx_k_OmegaB[] = "OmegaB";
static char __pyx_k_OmegaL[] = "OmegaL";
static char __pyx_k_OmegaM[] = "OmegaM";
static char __pyx_k_append[] = "append";
static char __pyx_k_astype[] = "astype";
static char __pyx_k_coords[] = "coords";
static char __pyx_k_decode[] = "decode";
static char __pyx_k_f_code[] = "f_code";
static char __pyx_k_fields[] = "fields";
static char __pyx_k_handle[] = "handle";
static char __pyx_k_hubble[] = "hubble";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_levels[] = "levels";
static char __pyx_k_offset[] = "offset";
static char __pyx_k_resize[] = "resize";
static char __pyx_k_source[] = "source";
static char __pyx_k_DeltaDC[] = "DeltaDC";
static char __pyx_k_SPECIES[] = "SPECIES";
static char __pyx_k_co_name[] = "co_name";
static char __pyx_k_float32[] = "float32";
static char __pyx_k_float64[] = "float64";
static char __pyx_k_quartic[] = "quartic";
static char __pyx_k_quintic[] = "quintic";
static char __pyx_k_sfc_end[] = "sfc_end";
static char __pyx_k_unknown[] = "[unknown]";
static char __pyx_k_version[] = "version";
static char __pyx_k_f_lineno[] = "f_lineno";
static char __pyx_k_getframe[] = "_getframe";
static char __pyx_k_itemsize[] = "itemsize";
static char __pyx_k_pdeposit[] = "pdeposit";
static char __pyx_k_selector[] = "selector";
static char __pyx_k_cell_inds[] = "cell_inds";
static char __pyx_k_domain_id[] = "domain_id";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_file_inds[] = "file_inds";
static char __pyx_k_num_cells[] = "num_cells";
static char __pyx_k_positions[] = "positions";
static char __pyx_k_sfc_start[] = "sfc_start";
static char __pyx_k_time_unit[] = "time_unit";
static char __pyx_k_traceback[] = "traceback";
static char __pyx_k_POSITION_X[] = "POSITION_X";
static char __pyx_k_POSITION_Y[] = "POSITION_Y";
static char __pyx_k_POSITION_Z[] = "POSITION_Z";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_empty_like[] = "empty_like";
static char __pyx_k_get_coords[] = "get_coords";
static char __pyx_k_left_edges[] = "left_edges";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_MemoryError[] = "MemoryError";
static char __pyx_k_code_length[] = "code_length";
static char __pyx_k_dest_fields[] = "dest_fields";
static char __pyx_k_file_prefix[] = "file_prefix";
static char __pyx_k_from_caller[] = "from caller";
static char __pyx_k_in_function[] = "in function";
static char __pyx_k_oct_handler[] = "oct_handler";
static char __pyx_k_print_stack[] = "print_stack";
static char __pyx_k_right_edges[] = "right_edges";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_artio_handle[] = "artio_handle";
static char __pyx_k_base_selector[] = "base_selector";
static char __pyx_k_domain_counts[] = "domain_counts";
static char __pyx_k_field_indices[] = "field_indices";
static char __pyx_k_range_handler[] = "range_handler";
static char __pyx_k_artio_is_valid[] = "artio_is_valid";
static char __pyx_k_grid_max_level[] = "grid_max_level";
static char __pyx_k_max_range_size[] = "max_range_size";
static char __pyx_k_num_root_cells[] = "num_root_cells";
static char __pyx_k_data_structures[] = "data_structures";
static char __pyx_k_read_parameters[] = "read_parameters";
static char __pyx_k_allocate_domains[] = "allocate_domains";
static char __pyx_k_convert_to_units[] = "convert_to_units";
static char __pyx_k_domain_left_edge[] = "domain_left_edge";
static char __pyx_k_domain_dimensions[] = "domain_dimensions";
static char __pyx_k_domain_right_edge[] = "domain_right_edge";
static char __pyx_k_num_grid_variables[] = "num_grid_variables";
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static char __pyx_k_failure_with_status[] = "failure with status";
static char __pyx_k_sfc_subset_selector[] = "sfc_subset_selector";
static char __pyx_k_grid_variable_labels[] = "grid_variable_labels";
static char __pyx_k_num_particle_species[] = "num_particle_species";
static char __pyx_k_is_not_known_to_ARTIO[] = "is not known to ARTIO";
static char __pyx_k_num_primary_variables[] = "num_primary_variables";
static char __pyx_k_particle_species_mass[] = "particle_species_mass";
static char __pyx_k_num_secondary_variables[] = "num_secondary_variables";
static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static char __pyx_k_Users_goldbaum_Documents_yt_hg[] = "/Users/goldbaum/Documents/yt-hg/yt/frontends/artio/_artio_caller.pyx";
static char __pyx_k_species__02u_secondary_variable[] = "species_%02u_secondary_variable_labels";
static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_ARTIO_file_corruption_detected_i[] = "ARTIO file corruption detected: invalid type!";
static char __pyx_k_Attempted_to_read_non_existent_p[] = "Attempted to read non-existent particles in ARTIO";
static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_Invalid_species_provided_to_read[] = "Invalid species provided to read_particle_chunk";
static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static char __pyx_k_Unable_to_locate_particle_header[] = "Unable to locate particle header information in artio header: key=";
static char __pyx_k_Unable_to_locate_position_inform[] = "Unable to locate position information for particle species";
static char __pyx_k_Unable_to_locate_variable_labels[] = "Unable to locate variable labels for species";
static char __pyx_k_abox_from_auni_called_for_non_co[] = "abox_from_auni called for non-cosmological ARTIO fileset!";
static char __pyx_k_abox_from_tcode_called_for_non_c[] = "abox_from_tcode called for non-cosmological ARTIO fileset!";
static char __pyx_k_auni_from_abox_called_for_non_co[] = "auni_from_abox called for non-cosmological ARTIO fileset!";
static char __pyx_k_auni_from_tcode_array_called_for[] = "auni_from_tcode_array called for non-cosmological ARTIO fileset!";
static char __pyx_k_auni_from_tcode_called_for_non_c[] = "auni_from_tcode called for non-cosmological ARTIO fileset!";
static char __pyx_k_auni_from_tphys_called_for_non_c[] = "auni_from_tphys called for non-cosmological ARTIO fileset!";
static char __pyx_k_invalid_field_name_provided_to_r[] = "invalid field name provided to read_particle_chunk";
static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static char __pyx_k_species__02d_primary_variable_la[] = "species_%02d_primary_variable_labels";
static char __pyx_k_species__02u_primary_variable_la[] = "species_%02u_primary_variable_labels";
static char __pyx_k_tcode_from_abox_called_for_non_c[] = "tcode_from_abox called for non-cosmological ARTIO fileset!";
static char __pyx_k_tcode_from_auni_called_for_non_c[] = "tcode_from_auni called for non-cosmological ARTIO fileset!";
static char __pyx_k_tphys_from_abox_called_for_non_c[] = "tphys_from_abox called for non-cosmological ARTIO fileset!";
static char __pyx_k_tphys_from_auni_called_for_non_c[] = "tphys_from_auni called for non-cosmological ARTIO fileset!";
static char __pyx_k_yt_frontends_artio__artio_caller[] = "yt.frontends.artio._artio_caller";
static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_ARTIO_file_corruption_detected_i;
static PyObject *__pyx_kp_s_Attempted_to_read_non_existent_p;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_n_s_DeltaDC;
static PyObject *__pyx_n_s_Field;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_kp_s_Invalid_species_provided_to_read;
static PyObject *__pyx_n_s_MASS;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_OmegaB;
static PyObject *__pyx_n_s_OmegaL;
static PyObject *__pyx_n_s_OmegaM;
static PyObject *__pyx_n_s_PID;
static PyObject *__pyx_n_s_POSITION_X;
static PyObject *__pyx_n_s_POSITION_Y;
static PyObject *__pyx_n_s_POSITION_Z;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SPECIES;
static PyObject *__pyx_kp_s_Unable_to_locate_particle_header;
static PyObject *__pyx_kp_s_Unable_to_locate_position_inform;
static PyObject *__pyx_kp_s_Unable_to_locate_variable_labels;
static PyObject *__pyx_kp_s_Users_goldbaum_Documents_yt_hg;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_abox;
static PyObject *__pyx_kp_s_abox_from_auni_called_for_non_co;
static PyObject *__pyx_kp_s_abox_from_tcode_called_for_non_c;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_allocate_domains;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_artio_handle;
static PyObject *__pyx_n_s_artio_is_valid;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_kp_s_auni_from_abox_called_for_non_co;
static PyObject *__pyx_kp_s_auni_from_tcode_array_called_for;
static PyObject *__pyx_kp_s_auni_from_tcode_called_for_non_c;
static PyObject *__pyx_kp_s_auni_from_tphys_called_for_non_c;
static PyObject *__pyx_n_s_base_selector;
static PyObject *__pyx_n_s_bool;
static PyObject *__pyx_n_s_cell_inds;
static PyObject *__pyx_n_s_co_name;
static PyObject *__pyx_n_s_code_length;
static PyObject *__pyx_n_s_convert_to_units;
static PyObject *__pyx_n_s_coords;
static PyObject *__pyx_n_s_cubic;
static PyObject *__pyx_n_s_data_structures;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_dest;
static PyObject *__pyx_n_s_dest_fields;
static PyObject *__pyx_n_s_dims;
static PyObject *__pyx_n_s_dobj;
static PyObject *__pyx_n_s_domain_counts;
static PyObject *__pyx_n_s_domain_dimensions;
static PyObject *__pyx_n_s_domain_id;
static PyObject *__pyx_n_s_domain_left_edge;
static PyObject *__pyx_n_s_domain_right_edge;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_empty_like;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_f_code;
static PyObject *__pyx_n_s_f_lineno;
static PyObject *__pyx_kp_s_failure_with_status;
static PyObject *__pyx_n_s_field_indices;
static PyObject *__pyx_n_s_fields;
static PyObject *__pyx_n_s_file_inds;
static PyObject *__pyx_n_s_file_prefix;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_kp_s_from_caller;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_coords;
static PyObject *__pyx_n_s_getframe;
static PyObject *__pyx_n_s_grid_max_level;
static PyObject *__pyx_n_s_grid_variable_labels;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_hubble;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_kp_s_in_function;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_kp_s_invalid_field_name_provided_to_r;
static PyObject *__pyx_kp_s_is_not_known_to_ARTIO;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_n_s_left_edges;
static PyObject *__pyx_n_s_levels;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_max_range_size;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_num_cells;
static PyObject *__pyx_n_s_num_grid_variables;
static PyObject *__pyx_n_s_num_particle_species;
static PyObject *__pyx_n_s_num_primary_variables;
static PyObject *__pyx_n_s_num_root_cells;
static PyObject *__pyx_n_s_num_secondary_variables;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_oct_handler;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_order;
static PyObject *__pyx_n_s_particle_species_mass;
static PyObject *__pyx_n_s_pdeposit;
static PyObject *__pyx_n_s_pi;
static PyObject *__pyx_n_s_positions;
static PyObject *__pyx_n_s_print_stack;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_quartic;
static PyObject *__pyx_n_s_quintic;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_range_handler;
static PyObject *__pyx_n_s_read_parameters;
static PyObject *__pyx_n_s_resize;
static PyObject *__pyx_n_s_right_edges;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_n_s_selector;
static PyObject *__pyx_n_s_sfc_end;
static PyObject *__pyx_n_s_sfc_start;
static PyObject *__pyx_n_s_sfc_subset_selector;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_kp_s_species__02d_primary_variable_la;
static PyObject *__pyx_kp_s_species__02u_primary_variable_la;
static PyObject *__pyx_kp_s_species__02u_secondary_variable;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_kp_s_tcode_from_abox_called_for_non_c;
static PyObject *__pyx_kp_s_tcode_from_auni_called_for_non_c;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_time_unit;
static PyObject *__pyx_kp_s_tphys_from_abox_called_for_non_c;
static PyObject *__pyx_kp_s_tphys_from_auni_called_for_non_c;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_s_units;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_kp_s_utf_8;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_yt_frontends_artio__artio_caller;
static PyObject *__pyx_n_s_zeros;
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, char *__pyx_v_file_prefix); /* proto */
static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_4read_parameters(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_6abox_from_auni(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8tcode_from_auni(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10tphys_from_auni(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_12auni_from_abox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_v); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_14auni_from_tcode(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_v); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_16auni_from_tcode_array(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyArrayObject *__pyx_v_tcode); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18auni_from_tphys(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_v); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_20abox_from_tcode(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_abox); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_22tcode_from_abox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_abox); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_24tphys_from_abox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_abox); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_26tphys_from_tcode(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_tcode); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_28tphys_from_tcode_array(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyArrayObject *__pyx_v_tcode); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_30read_particle_chunk(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int64_t __pyx_v_sfc_start, int64_t __pyx_v_sfc_end, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_32read_grid_chunk(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int64_t __pyx_v_sfc_start, int64_t __pyx_v_sfc_end, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_34root_sfc_ranges_all(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, int __pyx_v_max_range_size); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_36root_sfc_ranges(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_max_range_size); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_artio_is_valid(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_file_prefix); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_artio_handle, PyObject *__pyx_v_sfc_start, PyObject *__pyx_v_sfc_end); /* proto */
static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_4construct_mesh(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_6free_mesh(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_2get_coords(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_handle, __pyx_t_5numpy_int64_t __pyx_v_s); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_2fill_sfc(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyArrayObject *__pyx_v_domain_counts, PyObject *__pyx_v_field_indices, PyObject *__pyx_v_dest_fields); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_4fill_sfc_particles(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler); /* proto */
static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_4icoords(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_6fcoords(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_8fwidth(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10ires(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12selector_fill(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, CYTHON_UNUSED int __pyx_v_domain_id); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_14mask(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_16fill_sfc_particles(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_18fill_sfc(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyObject *__pyx_v_field_indices); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_20deposit(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_pdeposit, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_positions, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, PyObject *__pyx_v_dobj); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_2select_grids(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_4_hash_vals(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__29;
static PyObject *__pyx_slice__31;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;

/* "yt/frontends/artio/_artio_caller.pyx":152
 *     void artio_sfc_coords( artio_fileset_handle *handle, int64_t index, int coords[3] ) nogil
 * 
 * cdef void check_artio_status(int status, char *fname="[unknown]"):             # <<<<<<<<<<<<<<
 *     if status != ARTIO_SUCCESS:
 *         import traceback
 */

static void __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(int __pyx_v_status, struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_check_artio_status *__pyx_optional_args) {
  char *__pyx_v_fname = ((char *)__pyx_k_unknown);
  PyObject *__pyx_v_traceback = NULL;
  PyObject *__pyx_v_callername = NULL;
  PyObject *__pyx_v_nline = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_artio_status", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fname = __pyx_optional_args->fname;
    }
  }

  /* "yt/frontends/artio/_artio_caller.pyx":153
 * 
 * cdef void check_artio_status(int status, char *fname="[unknown]"):
 *     if status != ARTIO_SUCCESS:             # <<<<<<<<<<<<<<
 *         import traceback
 *         traceback.print_stack()
 */
  __pyx_t_1 = ((__pyx_v_status != ARTIO_SUCCESS) != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":154
 * cdef void check_artio_status(int status, char *fname="[unknown]"):
 *     if status != ARTIO_SUCCESS:
 *         import traceback             # <<<<<<<<<<<<<<
 *         traceback.print_stack()
 *         callername = sys._getframe().f_code.co_name
 */
    __pyx_t_2 = __Pyx_Import(__pyx_n_s_traceback, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_traceback = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":155
 *     if status != ARTIO_SUCCESS:
 *         import traceback
 *         traceback.print_stack()             # <<<<<<<<<<<<<<
 *         callername = sys._getframe().f_code.co_name
 *         nline = sys._getframe().f_lineno
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_traceback, __pyx_n_s_print_stack); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":156
 *         import traceback
 *         traceback.print_stack()
 *         callername = sys._getframe().f_code.co_name             # <<<<<<<<<<<<<<
 *         nline = sys._getframe().f_lineno
 *         raise RuntimeError('failure with status', status, 'in function',fname,'from caller', callername, nline)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getframe); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_callername = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":157
 *         traceback.print_stack()
 *         callername = sys._getframe().f_code.co_name
 *         nline = sys._getframe().f_lineno             # <<<<<<<<<<<<<<
 *         raise RuntimeError('failure with status', status, 'in function',fname,'from caller', callername, nline)
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getframe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_lineno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nline = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":158
 *         callername = sys._getframe().f_code.co_name
 *         nline = sys._getframe().f_lineno
 *         raise RuntimeError('failure with status', status, 'in function',fname,'from caller', callername, nline)             # <<<<<<<<<<<<<<
 * 
 * cdef class artio_fileset :
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_kp_s_failure_with_status);
    __Pyx_GIVEREF(__pyx_kp_s_failure_with_status);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_failure_with_status);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_in_function);
    __Pyx_GIVEREF(__pyx_kp_s_in_function);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_s_in_function);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_s_from_caller);
    __Pyx_GIVEREF(__pyx_kp_s_from_caller);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_s_from_caller);
    __Pyx_INCREF(__pyx_v_callername);
    __Pyx_GIVEREF(__pyx_v_callername);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_callername);
    __Pyx_INCREF(__pyx_v_nline);
    __Pyx_GIVEREF(__pyx_v_nline);
    PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_nline);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":153
 * 
 * cdef void check_artio_status(int status, char *fname="[unknown]"):
 *     if status != ARTIO_SUCCESS:             # <<<<<<<<<<<<<<
 *         import traceback
 *         traceback.print_stack()
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":152
 *     void artio_sfc_coords( artio_fileset_handle *handle, int64_t index, int coords[3] ) nogil
 * 
 * cdef void check_artio_status(int status, char *fname="[unknown]"):             # <<<<<<<<<<<<<<
 *     if status != ARTIO_SUCCESS:
 *         import traceback
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.check_artio_status", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_traceback);
  __Pyx_XDECREF(__pyx_v_callername);
  __Pyx_XDECREF(__pyx_v_nline);
  __Pyx_RefNannyFinishContext();
}

/* "yt/frontends/artio/_artio_caller.pyx":188
 *     cdef float *secondary_variables
 * 
 *     def __init__(self, char *file_prefix) :             # <<<<<<<<<<<<<<
 *         cdef int artio_type = ARTIO_OPEN_HEADER
 *         cdef int64_t num_root
 */

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  char *__pyx_v_file_prefix;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_prefix,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_prefix)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_file_prefix = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_file_prefix) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset___init__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), __pyx_v_file_prefix);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, char *__pyx_v_file_prefix) {
  int __pyx_v_artio_type;
  int64_t __pyx_v_num_root;
  int __pyx_v_status;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_ispec = NULL;
  PyObject *__pyx_v_species_labels = NULL;
  PyObject *__pyx_v_labels = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  double __pyx_t_7;
  float __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  size_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":189
 * 
 *     def __init__(self, char *file_prefix) :
 *         cdef int artio_type = ARTIO_OPEN_HEADER             # <<<<<<<<<<<<<<
 *         cdef int64_t num_root
 * 
 */
  __pyx_v_artio_type = ARTIO_OPEN_HEADER;

  /* "yt/frontends/artio/_artio_caller.pyx":192
 *         cdef int64_t num_root
 * 
 *         self.handle = artio_fileset_open( file_prefix, artio_type, artio_context_global )             # <<<<<<<<<<<<<<
 *         if not self.handle :
 *             raise RuntimeError
 */
  __pyx_v_self->handle = artio_fileset_open(__pyx_v_file_prefix, __pyx_v_artio_type, artio_context_global);

  /* "yt/frontends/artio/_artio_caller.pyx":193
 * 
 *         self.handle = artio_fileset_open( file_prefix, artio_type, artio_context_global )
 *         if not self.handle :             # <<<<<<<<<<<<<<
 *             raise RuntimeError
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_self->handle != 0)) != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":194
 *         self.handle = artio_fileset_open( file_prefix, artio_type, artio_context_global )
 *         if not self.handle :
 *             raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *         self.read_parameters()
 */
    __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":193
 * 
 *         self.handle = artio_fileset_open( file_prefix, artio_type, artio_context_global )
 *         if not self.handle :             # <<<<<<<<<<<<<<
 *             raise RuntimeError
 * 
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":196
 *             raise RuntimeError
 * 
 *         self.read_parameters()             # <<<<<<<<<<<<<<
 * 
 *         self.num_root_cells = self.parameters['num_root_cells'][0]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_parameters); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":198
 *         self.read_parameters()
 * 
 *         self.num_root_cells = self.parameters['num_root_cells'][0]             # <<<<<<<<<<<<<<
 *         self.num_grid = 1
 *         num_root = self.num_root_cells
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_num_root_cells); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->num_root_cells = __pyx_t_5;

  /* "yt/frontends/artio/_artio_caller.pyx":199
 * 
 *         self.num_root_cells = self.parameters['num_root_cells'][0]
 *         self.num_grid = 1             # <<<<<<<<<<<<<<
 *         num_root = self.num_root_cells
 *         while num_root > 1 :
 */
  __pyx_v_self->num_grid = 1;

  /* "yt/frontends/artio/_artio_caller.pyx":200
 *         self.num_root_cells = self.parameters['num_root_cells'][0]
 *         self.num_grid = 1
 *         num_root = self.num_root_cells             # <<<<<<<<<<<<<<
 *         while num_root > 1 :
 *             self.num_grid <<= 1
 */
  __pyx_t_5 = __pyx_v_self->num_root_cells;
  __pyx_v_num_root = __pyx_t_5;

  /* "yt/frontends/artio/_artio_caller.pyx":201
 *         self.num_grid = 1
 *         num_root = self.num_root_cells
 *         while num_root > 1 :             # <<<<<<<<<<<<<<
 *             self.num_grid <<= 1
 *             num_root >>= 3
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_num_root > 1) != 0);
    if (!__pyx_t_1) break;

    /* "yt/frontends/artio/_artio_caller.pyx":202
 *         num_root = self.num_root_cells
 *         while num_root > 1 :
 *             self.num_grid <<= 1             # <<<<<<<<<<<<<<
 *             num_root >>= 3
 * 
 */
    __pyx_v_self->num_grid = (__pyx_v_self->num_grid << 1);

    /* "yt/frontends/artio/_artio_caller.pyx":203
 *         while num_root > 1 :
 *             self.num_grid <<= 1
 *             num_root >>= 3             # <<<<<<<<<<<<<<
 * 
 *         self.sfc_min = 0
 */
    __pyx_v_num_root = (__pyx_v_num_root >> 3);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":205
 *             num_root >>= 3
 * 
 *         self.sfc_min = 0             # <<<<<<<<<<<<<<
 *         self.sfc_max = self.num_root_cells-1
 * 
 */
  __pyx_v_self->sfc_min = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":206
 * 
 *         self.sfc_min = 0
 *         self.sfc_max = self.num_root_cells-1             # <<<<<<<<<<<<<<
 * 
 *         # initialize cosmology module
 */
  __pyx_v_self->sfc_max = (__pyx_v_self->num_root_cells - 1);

  /* "yt/frontends/artio/_artio_caller.pyx":209
 * 
 *         # initialize cosmology module
 *         if "abox" in self.parameters:             # <<<<<<<<<<<<<<
 *             self.cosmology = cosmology_allocate()
 *             cosmology_set_OmegaM(self.cosmology, self.parameters['OmegaM'][0])
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_abox, __pyx_v_self->parameters, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "yt/frontends/artio/_artio_caller.pyx":210
 *         # initialize cosmology module
 *         if "abox" in self.parameters:
 *             self.cosmology = cosmology_allocate()             # <<<<<<<<<<<<<<
 *             cosmology_set_OmegaM(self.cosmology, self.parameters['OmegaM'][0])
 *             cosmology_set_OmegaL(self.cosmology, self.parameters['OmegaL'][0])
 */
    __pyx_v_self->cosmology = cosmology_allocate();

    /* "yt/frontends/artio/_artio_caller.pyx":211
 *         if "abox" in self.parameters:
 *             self.cosmology = cosmology_allocate()
 *             cosmology_set_OmegaM(self.cosmology, self.parameters['OmegaM'][0])             # <<<<<<<<<<<<<<
 *             cosmology_set_OmegaL(self.cosmology, self.parameters['OmegaL'][0])
 *             cosmology_set_OmegaB(self.cosmology, self.parameters['OmegaB'][0])
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_OmegaM); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    cosmology_set_OmegaM(__pyx_v_self->cosmology, __pyx_t_7);

    /* "yt/frontends/artio/_artio_caller.pyx":212
 *             self.cosmology = cosmology_allocate()
 *             cosmology_set_OmegaM(self.cosmology, self.parameters['OmegaM'][0])
 *             cosmology_set_OmegaL(self.cosmology, self.parameters['OmegaL'][0])             # <<<<<<<<<<<<<<
 *             cosmology_set_OmegaB(self.cosmology, self.parameters['OmegaB'][0])
 *             cosmology_set_h(self.cosmology, self.parameters['hubble'][0])
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_OmegaL); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    cosmology_set_OmegaL(__pyx_v_self->cosmology, __pyx_t_7);

    /* "yt/frontends/artio/_artio_caller.pyx":213
 *             cosmology_set_OmegaM(self.cosmology, self.parameters['OmegaM'][0])
 *             cosmology_set_OmegaL(self.cosmology, self.parameters['OmegaL'][0])
 *             cosmology_set_OmegaB(self.cosmology, self.parameters['OmegaB'][0])             # <<<<<<<<<<<<<<
 *             cosmology_set_h(self.cosmology, self.parameters['hubble'][0])
 *             cosmology_set_DeltaDC(self.cosmology, self.parameters['DeltaDC'][0])
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_OmegaB); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    cosmology_set_OmegaB(__pyx_v_self->cosmology, __pyx_t_7);

    /* "yt/frontends/artio/_artio_caller.pyx":214
 *             cosmology_set_OmegaL(self.cosmology, self.parameters['OmegaL'][0])
 *             cosmology_set_OmegaB(self.cosmology, self.parameters['OmegaB'][0])
 *             cosmology_set_h(self.cosmology, self.parameters['hubble'][0])             # <<<<<<<<<<<<<<
 *             cosmology_set_DeltaDC(self.cosmology, self.parameters['DeltaDC'][0])
 *             cosmology_set_fixed(self.cosmology)
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_hubble); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    cosmology_set_h(__pyx_v_self->cosmology, __pyx_t_7);

    /* "yt/frontends/artio/_artio_caller.pyx":215
 *             cosmology_set_OmegaB(self.cosmology, self.parameters['OmegaB'][0])
 *             cosmology_set_h(self.cosmology, self.parameters['hubble'][0])
 *             cosmology_set_DeltaDC(self.cosmology, self.parameters['DeltaDC'][0])             # <<<<<<<<<<<<<<
 *             cosmology_set_fixed(self.cosmology)
 *         else:
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_DeltaDC); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    cosmology_set_DeltaDC(__pyx_v_self->cosmology, __pyx_t_7);

    /* "yt/frontends/artio/_artio_caller.pyx":216
 *             cosmology_set_h(self.cosmology, self.parameters['hubble'][0])
 *             cosmology_set_DeltaDC(self.cosmology, self.parameters['DeltaDC'][0])
 *             cosmology_set_fixed(self.cosmology)             # <<<<<<<<<<<<<<
 *         else:
 *             self.cosmology = NULL
 */
    cosmology_set_fixed(__pyx_v_self->cosmology);

    /* "yt/frontends/artio/_artio_caller.pyx":209
 * 
 *         # initialize cosmology module
 *         if "abox" in self.parameters:             # <<<<<<<<<<<<<<
 *             self.cosmology = cosmology_allocate()
 *             cosmology_set_OmegaM(self.cosmology, self.parameters['OmegaM'][0])
 */
    goto __pyx_L6;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":218
 *             cosmology_set_fixed(self.cosmology)
 *         else:
 *             self.cosmology = NULL             # <<<<<<<<<<<<<<
 *             self.tcode_to_years = self.parameters['time_unit'][0]/(365.25*86400)
 * 
 */
  /*else*/ {
    __pyx_v_self->cosmology = NULL;

    /* "yt/frontends/artio/_artio_caller.pyx":219
 *         else:
 *             self.cosmology = NULL
 *             self.tcode_to_years = self.parameters['time_unit'][0]/(365.25*86400)             # <<<<<<<<<<<<<<
 * 
 *         # grid detection
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_time_unit); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyFloat_FromDouble((365.25 * 86400.0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_self->tcode_to_years = __pyx_t_8;
  }
  __pyx_L6:;

  /* "yt/frontends/artio/_artio_caller.pyx":222
 * 
 *         # grid detection
 *         self.min_level = 0             # <<<<<<<<<<<<<<
 *         self.max_level = self.parameters['grid_max_level'][0]
 *         self.num_grid_variables = self.parameters['num_grid_variables'][0]
 */
  __pyx_v_self->min_level = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":223
 *         # grid detection
 *         self.min_level = 0
 *         self.max_level = self.parameters['grid_max_level'][0]             # <<<<<<<<<<<<<<
 *         self.num_grid_variables = self.parameters['num_grid_variables'][0]
 * 
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_grid_max_level); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->max_level = __pyx_t_9;

  /* "yt/frontends/artio/_artio_caller.pyx":224
 *         self.min_level = 0
 *         self.max_level = self.parameters['grid_max_level'][0]
 *         self.num_grid_variables = self.parameters['num_grid_variables'][0]             # <<<<<<<<<<<<<<
 * 
 *         self.num_octs_per_level = <int *>malloc(self.max_level*sizeof(int))
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_num_grid_variables); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->num_grid_variables = __pyx_t_9;

  /* "yt/frontends/artio/_artio_caller.pyx":226
 *         self.num_grid_variables = self.parameters['num_grid_variables'][0]
 * 
 *         self.num_octs_per_level = <int *>malloc(self.max_level*sizeof(int))             # <<<<<<<<<<<<<<
 *         self.grid_variables = <float *>malloc(8*self.num_grid_variables*sizeof(float))
 *         if (not self.num_octs_per_level) or (not self.grid_variables) :
 */
  __pyx_v_self->num_octs_per_level = ((int *)malloc((__pyx_v_self->max_level * (sizeof(int)))));

  /* "yt/frontends/artio/_artio_caller.pyx":227
 * 
 *         self.num_octs_per_level = <int *>malloc(self.max_level*sizeof(int))
 *         self.grid_variables = <float *>malloc(8*self.num_grid_variables*sizeof(float))             # <<<<<<<<<<<<<<
 *         if (not self.num_octs_per_level) or (not self.grid_variables) :
 *             raise MemoryError
 */
  __pyx_v_self->grid_variables = ((float *)malloc(((8 * __pyx_v_self->num_grid_variables) * (sizeof(float)))));

  /* "yt/frontends/artio/_artio_caller.pyx":228
 *         self.num_octs_per_level = <int *>malloc(self.max_level*sizeof(int))
 *         self.grid_variables = <float *>malloc(8*self.num_grid_variables*sizeof(float))
 *         if (not self.num_octs_per_level) or (not self.grid_variables) :             # <<<<<<<<<<<<<<
 *             raise MemoryError
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_self->num_octs_per_level != 0)) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_6 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_1 = ((!(__pyx_v_self->grid_variables != 0)) != 0);
  __pyx_t_6 = __pyx_t_1;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_6) {

    /* "yt/frontends/artio/_artio_caller.pyx":229
 *         self.grid_variables = <float *>malloc(8*self.num_grid_variables*sizeof(float))
 *         if (not self.num_octs_per_level) or (not self.grid_variables) :
 *             raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if artio_fileset_has_grid(self.handle):
 */
    PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":228
 *         self.num_octs_per_level = <int *>malloc(self.max_level*sizeof(int))
 *         self.grid_variables = <float *>malloc(8*self.num_grid_variables*sizeof(float))
 *         if (not self.num_octs_per_level) or (not self.grid_variables) :             # <<<<<<<<<<<<<<
 *             raise MemoryError
 * 
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":231
 *             raise MemoryError
 * 
 *         if artio_fileset_has_grid(self.handle):             # <<<<<<<<<<<<<<
 *             status = artio_fileset_open_grid(self.handle)
 *             check_artio_status(status)
 */
  __pyx_t_6 = (artio_fileset_has_grid(__pyx_v_self->handle) != 0);
  if (__pyx_t_6) {

    /* "yt/frontends/artio/_artio_caller.pyx":232
 * 
 *         if artio_fileset_has_grid(self.handle):
 *             status = artio_fileset_open_grid(self.handle)             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 *             self.has_grid = 1
 */
    __pyx_v_status = artio_fileset_open_grid(__pyx_v_self->handle);

    /* "yt/frontends/artio/_artio_caller.pyx":233
 *         if artio_fileset_has_grid(self.handle):
 *             status = artio_fileset_open_grid(self.handle)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             self.has_grid = 1
 *         else:
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":234
 *             status = artio_fileset_open_grid(self.handle)
 *             check_artio_status(status)
 *             self.has_grid = 1             # <<<<<<<<<<<<<<
 *         else:
 *             self.has_grid = 0
 */
    __pyx_v_self->has_grid = 1;

    /* "yt/frontends/artio/_artio_caller.pyx":231
 *             raise MemoryError
 * 
 *         if artio_fileset_has_grid(self.handle):             # <<<<<<<<<<<<<<
 *             status = artio_fileset_open_grid(self.handle)
 *             check_artio_status(status)
 */
    goto __pyx_L10;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":236
 *             self.has_grid = 1
 *         else:
 *             self.has_grid = 0             # <<<<<<<<<<<<<<
 * 
 *         # particle detection
 */
  /*else*/ {
    __pyx_v_self->has_grid = 0;
  }
  __pyx_L10:;

  /* "yt/frontends/artio/_artio_caller.pyx":239
 * 
 *         # particle detection
 *         if ( artio_fileset_has_particles(self.handle) ):             # <<<<<<<<<<<<<<
 *             status = artio_fileset_open_particles(self.handle)
 *             check_artio_status(status)
 */
  __pyx_t_6 = (artio_fileset_has_particles(__pyx_v_self->handle) != 0);
  if (__pyx_t_6) {

    /* "yt/frontends/artio/_artio_caller.pyx":240
 *         # particle detection
 *         if ( artio_fileset_has_particles(self.handle) ):
 *             status = artio_fileset_open_particles(self.handle)             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 *             self.has_particles = 1
 */
    __pyx_v_status = artio_fileset_open_particles(__pyx_v_self->handle);

    /* "yt/frontends/artio/_artio_caller.pyx":241
 *         if ( artio_fileset_has_particles(self.handle) ):
 *             status = artio_fileset_open_particles(self.handle)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             self.has_particles = 1
 * 
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":242
 *             status = artio_fileset_open_particles(self.handle)
 *             check_artio_status(status)
 *             self.has_particles = 1             # <<<<<<<<<<<<<<
 * 
 *             for v in ["num_particle_species","num_primary_variables","num_secondary_variables"]:
 */
    __pyx_v_self->has_particles = 1;

    /* "yt/frontends/artio/_artio_caller.pyx":244
 *             self.has_particles = 1
 * 
 *             for v in ["num_particle_species","num_primary_variables","num_secondary_variables"]:             # <<<<<<<<<<<<<<
 *                 if v not in self.parameters:
 *                     raise RuntimeError("Unable to locate particle header information in artio header: key=", v)
 */
    __pyx_t_4 = __pyx_tuple_; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
    for (;;) {
      if (__pyx_t_10 >= 3) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":245
 * 
 *             for v in ["num_particle_species","num_primary_variables","num_secondary_variables"]:
 *                 if v not in self.parameters:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError("Unable to locate particle header information in artio header: key=", v)
 * 
 */
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_v, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = (__pyx_t_6 != 0);
      if (__pyx_t_1) {

        /* "yt/frontends/artio/_artio_caller.pyx":246
 *             for v in ["num_particle_species","num_primary_variables","num_secondary_variables"]:
 *                 if v not in self.parameters:
 *                     raise RuntimeError("Unable to locate particle header information in artio header: key=", v)             # <<<<<<<<<<<<<<
 * 
 *             self.num_species = self.parameters['num_particle_species'][0]
 */
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_kp_s_Unable_to_locate_particle_header);
        __Pyx_GIVEREF(__pyx_kp_s_Unable_to_locate_particle_header);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Unable_to_locate_particle_header);
        __Pyx_INCREF(__pyx_v_v);
        __Pyx_GIVEREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_v);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "yt/frontends/artio/_artio_caller.pyx":245
 * 
 *             for v in ["num_particle_species","num_primary_variables","num_secondary_variables"]:
 *                 if v not in self.parameters:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError("Unable to locate particle header information in artio header: key=", v)
 * 
 */
      }

      /* "yt/frontends/artio/_artio_caller.pyx":244
 *             self.has_particles = 1
 * 
 *             for v in ["num_particle_species","num_primary_variables","num_secondary_variables"]:             # <<<<<<<<<<<<<<
 *                 if v not in self.parameters:
 *                     raise RuntimeError("Unable to locate particle header information in artio header: key=", v)
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":248
 *                     raise RuntimeError("Unable to locate particle header information in artio header: key=", v)
 * 
 *             self.num_species = self.parameters['num_particle_species'][0]             # <<<<<<<<<<<<<<
 *             self.particle_position_index = <int *>malloc(3*sizeof(int)*self.num_species)
 *             if not self.particle_position_index :
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_num_particle_species); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_self->num_species = __pyx_t_9;

    /* "yt/frontends/artio/_artio_caller.pyx":249
 * 
 *             self.num_species = self.parameters['num_particle_species'][0]
 *             self.particle_position_index = <int *>malloc(3*sizeof(int)*self.num_species)             # <<<<<<<<<<<<<<
 *             if not self.particle_position_index :
 *                 raise MemoryError
 */
    __pyx_v_self->particle_position_index = ((int *)malloc(((3 * (sizeof(int))) * __pyx_v_self->num_species)));

    /* "yt/frontends/artio/_artio_caller.pyx":250
 *             self.num_species = self.parameters['num_particle_species'][0]
 *             self.particle_position_index = <int *>malloc(3*sizeof(int)*self.num_species)
 *             if not self.particle_position_index :             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             for ispec in range(self.num_species) :
 */
    __pyx_t_1 = ((!(__pyx_v_self->particle_position_index != 0)) != 0);
    if (__pyx_t_1) {

      /* "yt/frontends/artio/_artio_caller.pyx":251
 *             self.particle_position_index = <int *>malloc(3*sizeof(int)*self.num_species)
 *             if not self.particle_position_index :
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             for ispec in range(self.num_species) :
 *                 species_labels = "species_%02d_primary_variable_labels"% (ispec,)
 */
      PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "yt/frontends/artio/_artio_caller.pyx":250
 *             self.num_species = self.parameters['num_particle_species'][0]
 *             self.particle_position_index = <int *>malloc(3*sizeof(int)*self.num_species)
 *             if not self.particle_position_index :             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             for ispec in range(self.num_species) :
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":252
 *             if not self.particle_position_index :
 *                 raise MemoryError
 *             for ispec in range(self.num_species) :             # <<<<<<<<<<<<<<
 *                 species_labels = "species_%02d_primary_variable_labels"% (ispec,)
 *                 if species_labels not in self.parameters:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->num_species); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_11(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_ispec, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":253
 *                 raise MemoryError
 *             for ispec in range(self.num_species) :
 *                 species_labels = "species_%02d_primary_variable_labels"% (ispec,)             # <<<<<<<<<<<<<<
 *                 if species_labels not in self.parameters:
 *                     raise RuntimeError("Unable to locate variable labels for species",ispec)
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_ispec);
      __Pyx_GIVEREF(__pyx_v_ispec);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ispec);
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_species__02d_primary_variable_la, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_species_labels, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":254
 *             for ispec in range(self.num_species) :
 *                 species_labels = "species_%02d_primary_variable_labels"% (ispec,)
 *                 if species_labels not in self.parameters:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError("Unable to locate variable labels for species",ispec)
 * 
 */
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_species_labels, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = (__pyx_t_1 != 0);
      if (__pyx_t_6) {

        /* "yt/frontends/artio/_artio_caller.pyx":255
 *                 species_labels = "species_%02d_primary_variable_labels"% (ispec,)
 *                 if species_labels not in self.parameters:
 *                     raise RuntimeError("Unable to locate variable labels for species",ispec)             # <<<<<<<<<<<<<<
 * 
 *                 labels = self.parameters[species_labels]
 */
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_kp_s_Unable_to_locate_variable_labels);
        __Pyx_GIVEREF(__pyx_kp_s_Unable_to_locate_variable_labels);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Unable_to_locate_variable_labels);
        __Pyx_INCREF(__pyx_v_ispec);
        __Pyx_GIVEREF(__pyx_v_ispec);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ispec);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "yt/frontends/artio/_artio_caller.pyx":254
 *             for ispec in range(self.num_species) :
 *                 species_labels = "species_%02d_primary_variable_labels"% (ispec,)
 *                 if species_labels not in self.parameters:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError("Unable to locate variable labels for species",ispec)
 * 
 */
      }

      /* "yt/frontends/artio/_artio_caller.pyx":257
 *                     raise RuntimeError("Unable to locate variable labels for species",ispec)
 * 
 *                 labels = self.parameters[species_labels]             # <<<<<<<<<<<<<<
 *                 try :
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 */
      __pyx_t_3 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_v_species_labels); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":258
 * 
 *                 labels = self.parameters[species_labels]
 *                 try :             # <<<<<<<<<<<<<<
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {

          /* "yt/frontends/artio/_artio_caller.pyx":259
 *                 labels = self.parameters[species_labels]
 *                 try :
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')             # <<<<<<<<<<<<<<
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ispec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          (__pyx_v_self->particle_position_index[__pyx_t_15]) = __pyx_t_9;

          /* "yt/frontends/artio/_artio_caller.pyx":260
 *                 try :
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')             # <<<<<<<<<<<<<<
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')
 *                 except ValueError :
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ispec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          (__pyx_v_self->particle_position_index[__pyx_t_15]) = __pyx_t_9;

          /* "yt/frontends/artio/_artio_caller.pyx":261
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')             # <<<<<<<<<<<<<<
 *                 except ValueError :
 *                     raise RuntimeError("Unable to locate position information for particle species", ispec)
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ispec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          (__pyx_v_self->particle_position_index[__pyx_t_15]) = __pyx_t_9;

          /* "yt/frontends/artio/_artio_caller.pyx":258
 * 
 *                 labels = self.parameters[species_labels]
 *                 try :             # <<<<<<<<<<<<<<
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 */
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L26_try_end;
        __pyx_L19_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "yt/frontends/artio/_artio_caller.pyx":262
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')
 *                 except ValueError :             # <<<<<<<<<<<<<<
 *                     raise RuntimeError("Unable to locate position information for particle species", ispec)
 * 
 */
        __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
        if (__pyx_t_9) {
          __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_16);

          /* "yt/frontends/artio/_artio_caller.pyx":263
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')
 *                 except ValueError :
 *                     raise RuntimeError("Unable to locate position information for particle species", ispec)             # <<<<<<<<<<<<<<
 * 
 *             self.num_particles_per_species =  <int *>malloc(sizeof(int)*self.num_species)
 */
          __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_kp_s_Unable_to_locate_position_inform);
          __Pyx_GIVEREF(__pyx_kp_s_Unable_to_locate_position_inform);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_kp_s_Unable_to_locate_position_inform);
          __Pyx_INCREF(__pyx_v_ispec);
          __Pyx_GIVEREF(__pyx_v_ispec);
          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_ispec);
          __pyx_t_18 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_Raise(__pyx_t_18, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
        }
        goto __pyx_L21_except_error;
        __pyx_L21_except_error:;

        /* "yt/frontends/artio/_artio_caller.pyx":258
 * 
 *                 labels = self.parameters[species_labels]
 *                 try :             # <<<<<<<<<<<<<<
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 */
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L26_try_end:;
      }

      /* "yt/frontends/artio/_artio_caller.pyx":252
 *             if not self.particle_position_index :
 *                 raise MemoryError
 *             for ispec in range(self.num_species) :             # <<<<<<<<<<<<<<
 *                 species_labels = "species_%02d_primary_variable_labels"% (ispec,)
 *                 if species_labels not in self.parameters:
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":265
 *                     raise RuntimeError("Unable to locate position information for particle species", ispec)
 * 
 *             self.num_particles_per_species =  <int *>malloc(sizeof(int)*self.num_species)             # <<<<<<<<<<<<<<
 *             self.primary_variables = <double *>malloc(sizeof(double)*max(self.parameters['num_primary_variables']))
 *             self.secondary_variables = <float *>malloc(sizeof(float)*max(self.parameters['num_secondary_variables']))
 */
    __pyx_v_self->num_particles_per_species = ((int *)malloc(((sizeof(int)) * __pyx_v_self->num_species)));

    /* "yt/frontends/artio/_artio_caller.pyx":266
 * 
 *             self.num_particles_per_species =  <int *>malloc(sizeof(int)*self.num_species)
 *             self.primary_variables = <double *>malloc(sizeof(double)*max(self.parameters['num_primary_variables']))             # <<<<<<<<<<<<<<
 *             self.secondary_variables = <float *>malloc(sizeof(float)*max(self.parameters['num_secondary_variables']))
 *             if (not self.num_particles_per_species) or (not self.primary_variables) or (not self.secondary_variables) :
 */
    __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_num_primary_variables); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_16);
    __pyx_t_16 = 0;
    __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_2, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_19 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_19 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->primary_variables = ((double *)malloc(__pyx_t_19));

    /* "yt/frontends/artio/_artio_caller.pyx":267
 *             self.num_particles_per_species =  <int *>malloc(sizeof(int)*self.num_species)
 *             self.primary_variables = <double *>malloc(sizeof(double)*max(self.parameters['num_primary_variables']))
 *             self.secondary_variables = <float *>malloc(sizeof(float)*max(self.parameters['num_secondary_variables']))             # <<<<<<<<<<<<<<
 *             if (not self.num_particles_per_species) or (not self.primary_variables) or (not self.secondary_variables) :
 *                 raise MemoryError
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t((sizeof(float))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_num_secondary_variables); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_16);
    __pyx_t_16 = 0;
    __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_4, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_19 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_19 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_self->secondary_variables = ((float *)malloc(__pyx_t_19));

    /* "yt/frontends/artio/_artio_caller.pyx":268
 *             self.primary_variables = <double *>malloc(sizeof(double)*max(self.parameters['num_primary_variables']))
 *             self.secondary_variables = <float *>malloc(sizeof(float)*max(self.parameters['num_secondary_variables']))
 *             if (not self.num_particles_per_species) or (not self.primary_variables) or (not self.secondary_variables) :             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *         else:
 */
    __pyx_t_1 = ((!(__pyx_v_self->num_particles_per_species != 0)) != 0);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_6 = __pyx_t_1;
      goto __pyx_L30_bool_binop_done;
    }
    __pyx_t_1 = ((!(__pyx_v_self->primary_variables != 0)) != 0);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_6 = __pyx_t_1;
      goto __pyx_L30_bool_binop_done;
    }
    __pyx_t_1 = ((!(__pyx_v_self->secondary_variables != 0)) != 0);
    __pyx_t_6 = __pyx_t_1;
    __pyx_L30_bool_binop_done:;
    if (__pyx_t_6) {

      /* "yt/frontends/artio/_artio_caller.pyx":269
 *             self.secondary_variables = <float *>malloc(sizeof(float)*max(self.parameters['num_secondary_variables']))
 *             if (not self.num_particles_per_species) or (not self.primary_variables) or (not self.secondary_variables) :
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *         else:
 *             self.has_particles = 0
 */
      PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "yt/frontends/artio/_artio_caller.pyx":268
 *             self.primary_variables = <double *>malloc(sizeof(double)*max(self.parameters['num_primary_variables']))
 *             self.secondary_variables = <float *>malloc(sizeof(float)*max(self.parameters['num_secondary_variables']))
 *             if (not self.num_particles_per_species) or (not self.primary_variables) or (not self.secondary_variables) :             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *         else:
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":239
 * 
 *         # particle detection
 *         if ( artio_fileset_has_particles(self.handle) ):             # <<<<<<<<<<<<<<
 *             status = artio_fileset_open_particles(self.handle)
 *             check_artio_status(status)
 */
    goto __pyx_L11;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":271
 *                 raise MemoryError
 *         else:
 *             self.has_particles = 0             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self) :
 */
  /*else*/ {
    __pyx_v_self->has_particles = 0;
  }
  __pyx_L11:;

  /* "yt/frontends/artio/_artio_caller.pyx":188
 *     cdef float *secondary_variables
 * 
 *     def __init__(self, char *file_prefix) :             # <<<<<<<<<<<<<<
 *         cdef int artio_type = ARTIO_OPEN_HEADER
 *         cdef int64_t num_root
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_ispec);
  __Pyx_XDECREF(__pyx_v_species_labels);
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":273
 *             self.has_particles = 0
 * 
 *     def __dealloc__(self) :             # <<<<<<<<<<<<<<
 *         if self.num_octs_per_level : free(self.num_octs_per_level)
 *         if self.grid_variables : free(self.grid_variables)
 */

/* Python wrapper */
static void __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_2__dealloc__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":274
 * 
 *     def __dealloc__(self) :
 *         if self.num_octs_per_level : free(self.num_octs_per_level)             # <<<<<<<<<<<<<<
 *         if self.grid_variables : free(self.grid_variables)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->num_octs_per_level != 0);
  if (__pyx_t_1) {
    free(__pyx_v_self->num_octs_per_level);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":275
 *     def __dealloc__(self) :
 *         if self.num_octs_per_level : free(self.num_octs_per_level)
 *         if self.grid_variables : free(self.grid_variables)             # <<<<<<<<<<<<<<
 * 
 *         if self.particle_position_index : free(self.particle_position_index)
 */
  __pyx_t_1 = (__pyx_v_self->grid_variables != 0);
  if (__pyx_t_1) {
    free(__pyx_v_self->grid_variables);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":277
 *         if self.grid_variables : free(self.grid_variables)
 * 
 *         if self.particle_position_index : free(self.particle_position_index)             # <<<<<<<<<<<<<<
 *         if self.num_particles_per_species : free(self.num_particles_per_species)
 *         if self.primary_variables : free(self.primary_variables)
 */
  __pyx_t_1 = (__pyx_v_self->particle_position_index != 0);
  if (__pyx_t_1) {
    free(__pyx_v_self->particle_position_index);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":278
 * 
 *         if self.particle_position_index : free(self.particle_position_index)
 *         if self.num_particles_per_species : free(self.num_particles_per_species)             # <<<<<<<<<<<<<<
 *         if self.primary_variables : free(self.primary_variables)
 *         if self.secondary_variables : free(self.secondary_variables)
 */
  __pyx_t_1 = (__pyx_v_self->num_particles_per_species != 0);
  if (__pyx_t_1) {
    free(__pyx_v_self->num_particles_per_species);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":279
 *         if self.particle_position_index : free(self.particle_position_index)
 *         if self.num_particles_per_species : free(self.num_particles_per_species)
 *         if self.primary_variables : free(self.primary_variables)             # <<<<<<<<<<<<<<
 *         if self.secondary_variables : free(self.secondary_variables)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->primary_variables != 0);
  if (__pyx_t_1) {
    free(__pyx_v_self->primary_variables);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":280
 *         if self.num_particles_per_species : free(self.num_particles_per_species)
 *         if self.primary_variables : free(self.primary_variables)
 *         if self.secondary_variables : free(self.secondary_variables)             # <<<<<<<<<<<<<<
 * 
 *         if self.cosmology : cosmology_free(self.cosmology)
 */
  __pyx_t_1 = (__pyx_v_self->secondary_variables != 0);
  if (__pyx_t_1) {
    free(__pyx_v_self->secondary_variables);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":282
 *         if self.secondary_variables : free(self.secondary_variables)
 * 
 *         if self.cosmology : cosmology_free(self.cosmology)             # <<<<<<<<<<<<<<
 * 
 *         if self.handle : artio_fileset_close(self.handle)
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {
    cosmology_free(__pyx_v_self->cosmology);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":284
 *         if self.cosmology : cosmology_free(self.cosmology)
 * 
 *         if self.handle : artio_fileset_close(self.handle)             # <<<<<<<<<<<<<<
 * 
 *     def read_parameters(self) :
 */
  __pyx_t_1 = (__pyx_v_self->handle != 0);
  if (__pyx_t_1) {
    artio_fileset_close(__pyx_v_self->handle);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":273
 *             self.has_particles = 0
 * 
 *     def __dealloc__(self) :             # <<<<<<<<<<<<<<
 *         if self.num_octs_per_level : free(self.num_octs_per_level)
 *         if self.grid_variables : free(self.grid_variables)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "yt/frontends/artio/_artio_caller.pyx":286
 *         if self.handle : artio_fileset_close(self.handle)
 * 
 *     def read_parameters(self) :             # <<<<<<<<<<<<<<
 *         from sys import version
 *         cdef char key[64]
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_5read_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_5read_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_parameters (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_4read_parameters(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_4read_parameters(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_v_version = NULL;
  char __pyx_v_key[64];
  int __pyx_v_type;
  int __pyx_v_length;
  char **__pyx_v_char_values;
  int32_t *__pyx_v_int_values;
  int64_t *__pyx_v_long_values;
  float *__pyx_v_float_values;
  double *__pyx_v_double_values;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_parameter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_parameters", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":287
 * 
 *     def read_parameters(self) :
 *         from sys import version             # <<<<<<<<<<<<<<
 *         cdef char key[64]
 *         cdef int type
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_version);
  __Pyx_GIVEREF(__pyx_n_s_version);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_version = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":297
 *         cdef double *double_values
 * 
 *         self.parameters = {}             # <<<<<<<<<<<<<<
 * 
 *         while artio_parameter_iterate( self.handle, key, &type, &length ) == ARTIO_SUCCESS :
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->parameters);
  __Pyx_DECREF(__pyx_v_self->parameters);
  __pyx_v_self->parameters = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":299
 *         self.parameters = {}
 * 
 *         while artio_parameter_iterate( self.handle, key, &type, &length ) == ARTIO_SUCCESS :             # <<<<<<<<<<<<<<
 * 
 *             if type == ARTIO_TYPE_STRING :
 */
  while (1) {
    __pyx_t_3 = ((artio_parameter_iterate(__pyx_v_self->handle, __pyx_v_key, (&__pyx_v_type), (&__pyx_v_length)) == ARTIO_SUCCESS) != 0);
    if (!__pyx_t_3) break;

    /* "yt/frontends/artio/_artio_caller.pyx":301
 *         while artio_parameter_iterate( self.handle, key, &type, &length ) == ARTIO_SUCCESS :
 * 
 *             if type == ARTIO_TYPE_STRING :             # <<<<<<<<<<<<<<
 *                 char_values = <char **>malloc(length*sizeof(char *))
 *                 for i in range(length) :
 */
    __pyx_t_3 = ((__pyx_v_type == ARTIO_TYPE_STRING) != 0);
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":302
 * 
 *             if type == ARTIO_TYPE_STRING :
 *                 char_values = <char **>malloc(length*sizeof(char *))             # <<<<<<<<<<<<<<
 *                 for i in range(length) :
 *                     char_values[i] = <char *>malloc( ARTIO_MAX_STRING_LENGTH*sizeof(char) )
 */
      __pyx_v_char_values = ((char **)malloc((__pyx_v_length * (sizeof(char *)))));

      /* "yt/frontends/artio/_artio_caller.pyx":303
 *             if type == ARTIO_TYPE_STRING :
 *                 char_values = <char **>malloc(length*sizeof(char *))
 *                 for i in range(length) :             # <<<<<<<<<<<<<<
 *                     char_values[i] = <char *>malloc( ARTIO_MAX_STRING_LENGTH*sizeof(char) )
 *                 artio_parameter_get_string_array( self.handle, key, length, char_values )
 */
      __pyx_t_4 = __pyx_v_length;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "yt/frontends/artio/_artio_caller.pyx":304
 *                 char_values = <char **>malloc(length*sizeof(char *))
 *                 for i in range(length) :
 *                     char_values[i] = <char *>malloc( ARTIO_MAX_STRING_LENGTH*sizeof(char) )             # <<<<<<<<<<<<<<
 *                 artio_parameter_get_string_array( self.handle, key, length, char_values )
 *                 parameter = [ char_values[i] for i in range(length) ]
 */
        (__pyx_v_char_values[__pyx_v_i]) = ((char *)malloc((ARTIO_MAX_STRING_LENGTH * (sizeof(char)))));
      }

      /* "yt/frontends/artio/_artio_caller.pyx":305
 *                 for i in range(length) :
 *                     char_values[i] = <char *>malloc( ARTIO_MAX_STRING_LENGTH*sizeof(char) )
 *                 artio_parameter_get_string_array( self.handle, key, length, char_values )             # <<<<<<<<<<<<<<
 *                 parameter = [ char_values[i] for i in range(length) ]
 *                 for i in range(length) :
 */
      artio_parameter_get_string_array(__pyx_v_self->handle, __pyx_v_key, __pyx_v_length, __pyx_v_char_values);

      /* "yt/frontends/artio/_artio_caller.pyx":306
 *                     char_values[i] = <char *>malloc( ARTIO_MAX_STRING_LENGTH*sizeof(char) )
 *                 artio_parameter_get_string_array( self.handle, key, length, char_values )
 *                 parameter = [ char_values[i] for i in range(length) ]             # <<<<<<<<<<<<<<
 *                 for i in range(length) :
 *                     free(char_values[i])
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_v_length;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;
        __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_char_values[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_parameter, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":307
 *                 artio_parameter_get_string_array( self.handle, key, length, char_values )
 *                 parameter = [ char_values[i] for i in range(length) ]
 *                 for i in range(length) :             # <<<<<<<<<<<<<<
 *                     free(char_values[i])
 *                 free(char_values)
 */
      __pyx_t_4 = __pyx_v_length;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "yt/frontends/artio/_artio_caller.pyx":308
 *                 parameter = [ char_values[i] for i in range(length) ]
 *                 for i in range(length) :
 *                     free(char_values[i])             # <<<<<<<<<<<<<<
 *                 free(char_values)
 *                 if version[0] == '3':
 */
        free((__pyx_v_char_values[__pyx_v_i]));
      }

      /* "yt/frontends/artio/_artio_caller.pyx":309
 *                 for i in range(length) :
 *                     free(char_values[i])
 *                 free(char_values)             # <<<<<<<<<<<<<<
 *                 if version[0] == '3':
 *                     for i in range(0,len(parameter)):
 */
      free(__pyx_v_char_values);

      /* "yt/frontends/artio/_artio_caller.pyx":310
 *                     free(char_values[i])
 *                 free(char_values)
 *                 if version[0] == '3':             # <<<<<<<<<<<<<<
 *                     for i in range(0,len(parameter)):
 *                         parameter[i] = parameter[i].decode('utf-8')
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_version, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_3, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_3) {

        /* "yt/frontends/artio/_artio_caller.pyx":311
 *                 free(char_values)
 *                 if version[0] == '3':
 *                     for i in range(0,len(parameter)):             # <<<<<<<<<<<<<<
 *                         parameter[i] = parameter[i].decode('utf-8')
 *             elif type == ARTIO_TYPE_INT :
 */
        __pyx_t_5 = PyList_GET_SIZE(__pyx_v_parameter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
          __pyx_v_i = __pyx_t_6;

          /* "yt/frontends/artio/_artio_caller.pyx":312
 *                 if version[0] == '3':
 *                     for i in range(0,len(parameter)):
 *                         parameter[i] = parameter[i].decode('utf-8')             # <<<<<<<<<<<<<<
 *             elif type == ARTIO_TYPE_INT :
 *                 int_values = <int32_t *>malloc(length*sizeof(int32_t))
 */
          __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_parameter, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(__Pyx_SetItemInt(__pyx_v_parameter, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }

        /* "yt/frontends/artio/_artio_caller.pyx":310
 *                     free(char_values[i])
 *                 free(char_values)
 *                 if version[0] == '3':             # <<<<<<<<<<<<<<
 *                     for i in range(0,len(parameter)):
 *                         parameter[i] = parameter[i].decode('utf-8')
 */
      }

      /* "yt/frontends/artio/_artio_caller.pyx":301
 *         while artio_parameter_iterate( self.handle, key, &type, &length ) == ARTIO_SUCCESS :
 * 
 *             if type == ARTIO_TYPE_STRING :             # <<<<<<<<<<<<<<
 *                 char_values = <char **>malloc(length*sizeof(char *))
 *                 for i in range(length) :
 */
      goto __pyx_L5;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":313
 *                     for i in range(0,len(parameter)):
 *                         parameter[i] = parameter[i].decode('utf-8')
 *             elif type == ARTIO_TYPE_INT :             # <<<<<<<<<<<<<<
 *                 int_values = <int32_t *>malloc(length*sizeof(int32_t))
 *                 artio_parameter_get_int_array( self.handle, key, length, int_values )
 */
    __pyx_t_3 = ((__pyx_v_type == ARTIO_TYPE_INT) != 0);
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":314
 *                         parameter[i] = parameter[i].decode('utf-8')
 *             elif type == ARTIO_TYPE_INT :
 *                 int_values = <int32_t *>malloc(length*sizeof(int32_t))             # <<<<<<<<<<<<<<
 *                 artio_parameter_get_int_array( self.handle, key, length, int_values )
 *                 parameter = [ int_values[i] for i in range(length) ]
 */
      __pyx_v_int_values = ((int32_t *)malloc((__pyx_v_length * (sizeof(int32_t)))));

      /* "yt/frontends/artio/_artio_caller.pyx":315
 *             elif type == ARTIO_TYPE_INT :
 *                 int_values = <int32_t *>malloc(length*sizeof(int32_t))
 *                 artio_parameter_get_int_array( self.handle, key, length, int_values )             # <<<<<<<<<<<<<<
 *                 parameter = [ int_values[i] for i in range(length) ]
 *                 free(int_values)
 */
      artio_parameter_get_int_array(__pyx_v_self->handle, __pyx_v_key, __pyx_v_length, __pyx_v_int_values);

      /* "yt/frontends/artio/_artio_caller.pyx":316
 *                 int_values = <int32_t *>malloc(length*sizeof(int32_t))
 *                 artio_parameter_get_int_array( self.handle, key, length, int_values )
 *                 parameter = [ int_values[i] for i in range(length) ]             # <<<<<<<<<<<<<<
 *                 free(int_values)
 *             elif type == ARTIO_TYPE_LONG :
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_v_length;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;
        __pyx_t_1 = __Pyx_PyInt_From_int32_t((__pyx_v_int_values[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_parameter, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":317
 *                 artio_parameter_get_int_array( self.handle, key, length, int_values )
 *                 parameter = [ int_values[i] for i in range(length) ]
 *                 free(int_values)             # <<<<<<<<<<<<<<
 *             elif type == ARTIO_TYPE_LONG :
 *                 long_values = <int64_t *>malloc(length*sizeof(int64_t))
 */
      free(__pyx_v_int_values);

      /* "yt/frontends/artio/_artio_caller.pyx":313
 *                     for i in range(0,len(parameter)):
 *                         parameter[i] = parameter[i].decode('utf-8')
 *             elif type == ARTIO_TYPE_INT :             # <<<<<<<<<<<<<<
 *                 int_values = <int32_t *>malloc(length*sizeof(int32_t))
 *                 artio_parameter_get_int_array( self.handle, key, length, int_values )
 */
      goto __pyx_L5;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":318
 *                 parameter = [ int_values[i] for i in range(length) ]
 *                 free(int_values)
 *             elif type == ARTIO_TYPE_LONG :             # <<<<<<<<<<<<<<
 *                 long_values = <int64_t *>malloc(length*sizeof(int64_t))
 *                 artio_parameter_get_long_array( self.handle, key, length, long_values )
 */
    __pyx_t_3 = ((__pyx_v_type == ARTIO_TYPE_LONG) != 0);
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":319
 *                 free(int_values)
 *             elif type == ARTIO_TYPE_LONG :
 *                 long_values = <int64_t *>malloc(length*sizeof(int64_t))             # <<<<<<<<<<<<<<
 *                 artio_parameter_get_long_array( self.handle, key, length, long_values )
 *                 parameter = [ long_values[i] for i in range(length) ]
 */
      __pyx_v_long_values = ((int64_t *)malloc((__pyx_v_length * (sizeof(int64_t)))));

      /* "yt/frontends/artio/_artio_caller.pyx":320
 *             elif type == ARTIO_TYPE_LONG :
 *                 long_values = <int64_t *>malloc(length*sizeof(int64_t))
 *                 artio_parameter_get_long_array( self.handle, key, length, long_values )             # <<<<<<<<<<<<<<
 *                 parameter = [ long_values[i] for i in range(length) ]
 *                 free(long_values)
 */
      artio_parameter_get_long_array(__pyx_v_self->handle, __pyx_v_key, __pyx_v_length, __pyx_v_long_values);

      /* "yt/frontends/artio/_artio_caller.pyx":321
 *                 long_values = <int64_t *>malloc(length*sizeof(int64_t))
 *                 artio_parameter_get_long_array( self.handle, key, length, long_values )
 *                 parameter = [ long_values[i] for i in range(length) ]             # <<<<<<<<<<<<<<
 *                 free(long_values)
 *             elif type == ARTIO_TYPE_FLOAT :
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_v_length;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;
        __pyx_t_1 = __Pyx_PyInt_From_int64_t((__pyx_v_long_values[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_parameter, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":322
 *                 artio_parameter_get_long_array( self.handle, key, length, long_values )
 *                 parameter = [ long_values[i] for i in range(length) ]
 *                 free(long_values)             # <<<<<<<<<<<<<<
 *             elif type == ARTIO_TYPE_FLOAT :
 *                 float_values = <float *>malloc(length*sizeof(float))
 */
      free(__pyx_v_long_values);

      /* "yt/frontends/artio/_artio_caller.pyx":318
 *                 parameter = [ int_values[i] for i in range(length) ]
 *                 free(int_values)
 *             elif type == ARTIO_TYPE_LONG :             # <<<<<<<<<<<<<<
 *                 long_values = <int64_t *>malloc(length*sizeof(int64_t))
 *                 artio_parameter_get_long_array( self.handle, key, length, long_values )
 */
      goto __pyx_L5;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":323
 *                 parameter = [ long_values[i] for i in range(length) ]
 *                 free(long_values)
 *             elif type == ARTIO_TYPE_FLOAT :             # <<<<<<<<<<<<<<
 *                 float_values = <float *>malloc(length*sizeof(float))
 *                 artio_parameter_get_float_array( self.handle, key, length, float_values )
 */
    __pyx_t_3 = ((__pyx_v_type == ARTIO_TYPE_FLOAT) != 0);
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":324
 *                 free(long_values)
 *             elif type == ARTIO_TYPE_FLOAT :
 *                 float_values = <float *>malloc(length*sizeof(float))             # <<<<<<<<<<<<<<
 *                 artio_parameter_get_float_array( self.handle, key, length, float_values )
 *                 parameter = [ float_values[i] for i in range(length) ]
 */
      __pyx_v_float_values = ((float *)malloc((__pyx_v_length * (sizeof(float)))));

      /* "yt/frontends/artio/_artio_caller.pyx":325
 *             elif type == ARTIO_TYPE_FLOAT :
 *                 float_values = <float *>malloc(length*sizeof(float))
 *                 artio_parameter_get_float_array( self.handle, key, length, float_values )             # <<<<<<<<<<<<<<
 *                 parameter = [ float_values[i] for i in range(length) ]
 *                 free(float_values)
 */
      artio_parameter_get_float_array(__pyx_v_self->handle, __pyx_v_key, __pyx_v_length, __pyx_v_float_values);

      /* "yt/frontends/artio/_artio_caller.pyx":326
 *                 float_values = <float *>malloc(length*sizeof(float))
 *                 artio_parameter_get_float_array( self.handle, key, length, float_values )
 *                 parameter = [ float_values[i] for i in range(length) ]             # <<<<<<<<<<<<<<
 *                 free(float_values)
 *             elif type == ARTIO_TYPE_DOUBLE :
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_v_length;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;
        __pyx_t_1 = PyFloat_FromDouble((__pyx_v_float_values[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_parameter, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":327
 *                 artio_parameter_get_float_array( self.handle, key, length, float_values )
 *                 parameter = [ float_values[i] for i in range(length) ]
 *                 free(float_values)             # <<<<<<<<<<<<<<
 *             elif type == ARTIO_TYPE_DOUBLE :
 *                 double_values = <double *>malloc(length*sizeof(double))
 */
      free(__pyx_v_float_values);

      /* "yt/frontends/artio/_artio_caller.pyx":323
 *                 parameter = [ long_values[i] for i in range(length) ]
 *                 free(long_values)
 *             elif type == ARTIO_TYPE_FLOAT :             # <<<<<<<<<<<<<<
 *                 float_values = <float *>malloc(length*sizeof(float))
 *                 artio_parameter_get_float_array( self.handle, key, length, float_values )
 */
      goto __pyx_L5;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":328
 *                 parameter = [ float_values[i] for i in range(length) ]
 *                 free(float_values)
 *             elif type == ARTIO_TYPE_DOUBLE :             # <<<<<<<<<<<<<<
 *                 double_values = <double *>malloc(length*sizeof(double))
 *                 artio_parameter_get_double_array( self.handle, key, length, double_values )
 */
    __pyx_t_3 = ((__pyx_v_type == ARTIO_TYPE_DOUBLE) != 0);
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":329
 *                 free(float_values)
 *             elif type == ARTIO_TYPE_DOUBLE :
 *                 double_values = <double *>malloc(length*sizeof(double))             # <<<<<<<<<<<<<<
 *                 artio_parameter_get_double_array( self.handle, key, length, double_values )
 *                 parameter = [ double_values[i] for i in range(length) ]
 */
      __pyx_v_double_values = ((double *)malloc((__pyx_v_length * (sizeof(double)))));

      /* "yt/frontends/artio/_artio_caller.pyx":330
 *             elif type == ARTIO_TYPE_DOUBLE :
 *                 double_values = <double *>malloc(length*sizeof(double))
 *                 artio_parameter_get_double_array( self.handle, key, length, double_values )             # <<<<<<<<<<<<<<
 *                 parameter = [ double_values[i] for i in range(length) ]
 *                 free(double_values)
 */
      artio_parameter_get_double_array(__pyx_v_self->handle, __pyx_v_key, __pyx_v_length, __pyx_v_double_values);

      /* "yt/frontends/artio/_artio_caller.pyx":331
 *                 double_values = <double *>malloc(length*sizeof(double))
 *                 artio_parameter_get_double_array( self.handle, key, length, double_values )
 *                 parameter = [ double_values[i] for i in range(length) ]             # <<<<<<<<<<<<<<
 *                 free(double_values)
 *             else :
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_v_length;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;
        __pyx_t_1 = PyFloat_FromDouble((__pyx_v_double_values[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_parameter, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":332
 *                 artio_parameter_get_double_array( self.handle, key, length, double_values )
 *                 parameter = [ double_values[i] for i in range(length) ]
 *                 free(double_values)             # <<<<<<<<<<<<<<
 *             else :
 *                 raise RuntimeError("ARTIO file corruption detected: invalid type!")
 */
      free(__pyx_v_double_values);

      /* "yt/frontends/artio/_artio_caller.pyx":328
 *                 parameter = [ float_values[i] for i in range(length) ]
 *                 free(float_values)
 *             elif type == ARTIO_TYPE_DOUBLE :             # <<<<<<<<<<<<<<
 *                 double_values = <double *>malloc(length*sizeof(double))
 *                 artio_parameter_get_double_array( self.handle, key, length, double_values )
 */
      goto __pyx_L5;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":334
 *                 free(double_values)
 *             else :
 *                 raise RuntimeError("ARTIO file corruption detected: invalid type!")             # <<<<<<<<<<<<<<
 * 
 *             if version[0] == '3':
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L5:;

    /* "yt/frontends/artio/_artio_caller.pyx":336
 *                 raise RuntimeError("ARTIO file corruption detected: invalid type!")
 * 
 *             if version[0] == '3':             # <<<<<<<<<<<<<<
 *                 self.parameters[key.decode('utf-8')] = parameter
 *             else:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_version, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_3, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":337
 * 
 *             if version[0] == '3':
 *                 self.parameters[key.decode('utf-8')] = parameter             # <<<<<<<<<<<<<<
 *             else:
 *                 self.parameters[key] = parameter
 */
      __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_key, 0, strlen(__pyx_v_key), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyObject_SetItem(__pyx_v_self->parameters, __pyx_t_2, __pyx_v_parameter) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":336
 *                 raise RuntimeError("ARTIO file corruption detected: invalid type!")
 * 
 *             if version[0] == '3':             # <<<<<<<<<<<<<<
 *                 self.parameters[key.decode('utf-8')] = parameter
 *             else:
 */
      goto __pyx_L23;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":339
 *                 self.parameters[key.decode('utf-8')] = parameter
 *             else:
 *                 self.parameters[key] = parameter             # <<<<<<<<<<<<<<
 * 
 *     def abox_from_auni(self, np.float64_t a):
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyObject_SetItem(__pyx_v_self->parameters, __pyx_t_2, __pyx_v_parameter) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L23:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":286
 *         if self.handle : artio_fileset_close(self.handle)
 * 
 *     def read_parameters(self) :             # <<<<<<<<<<<<<<
 *         from sys import version
 *         cdef char key[64]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.read_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_version);
  __Pyx_XDECREF(__pyx_v_parameter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":341
 *                 self.parameters[key] = parameter
 * 
 *     def abox_from_auni(self, np.float64_t a):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return abox_from_auni(self.cosmology, a)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_7abox_from_auni(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_7abox_from_auni(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
  __pyx_t_5numpy_float64_t __pyx_v_a;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("abox_from_auni (wrapper)", 0);
  assert(__pyx_arg_a); {
    __pyx_v_a = __pyx_PyFloat_AsDouble(__pyx_arg_a); if (unlikely((__pyx_v_a == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.abox_from_auni", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_6abox_from_auni(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_a));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_6abox_from_auni(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abox_from_auni", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":342
 * 
 *     def abox_from_auni(self, np.float64_t a):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return abox_from_auni(self.cosmology, a)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":343
 *     def abox_from_auni(self, np.float64_t a):
 *         if self.cosmology:
 *             return abox_from_auni(self.cosmology, a)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("abox_from_auni called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(abox_from_auni(__pyx_v_self->cosmology, __pyx_v_a)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":342
 * 
 *     def abox_from_auni(self, np.float64_t a):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return abox_from_auni(self.cosmology, a)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":345
 *             return abox_from_auni(self.cosmology, a)
 *         else:
 *             raise RuntimeError("abox_from_auni called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tcode_from_auni(self, np.float64_t a):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":341
 *                 self.parameters[key] = parameter
 * 
 *     def abox_from_auni(self, np.float64_t a):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return abox_from_auni(self.cosmology, a)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.abox_from_auni", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":347
 *             raise RuntimeError("abox_from_auni called for non-cosmological ARTIO fileset!")
 * 
 *     def tcode_from_auni(self, np.float64_t a):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tcode_from_auni(self.cosmology, a)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9tcode_from_auni(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9tcode_from_auni(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
  __pyx_t_5numpy_float64_t __pyx_v_a;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tcode_from_auni (wrapper)", 0);
  assert(__pyx_arg_a); {
    __pyx_v_a = __pyx_PyFloat_AsDouble(__pyx_arg_a); if (unlikely((__pyx_v_a == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tcode_from_auni", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8tcode_from_auni(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_a));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8tcode_from_auni(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tcode_from_auni", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":348
 * 
 *     def tcode_from_auni(self, np.float64_t a):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tcode_from_auni(self.cosmology, a)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":349
 *     def tcode_from_auni(self, np.float64_t a):
 *         if self.cosmology:
 *             return tcode_from_auni(self.cosmology, a)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("tcode_from_auni called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(tcode_from_auni(__pyx_v_self->cosmology, __pyx_v_a)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":348
 * 
 *     def tcode_from_auni(self, np.float64_t a):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tcode_from_auni(self.cosmology, a)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":351
 *             return tcode_from_auni(self.cosmology, a)
 *         else:
 *             raise RuntimeError("tcode_from_auni called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tphys_from_auni(self, np.float64_t a):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":347
 *             raise RuntimeError("abox_from_auni called for non-cosmological ARTIO fileset!")
 * 
 *     def tcode_from_auni(self, np.float64_t a):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tcode_from_auni(self.cosmology, a)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tcode_from_auni", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":353
 *             raise RuntimeError("tcode_from_auni called for non-cosmological ARTIO fileset!")
 * 
 *     def tphys_from_auni(self, np.float64_t a):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tphys_from_auni(self.cosmology, a)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11tphys_from_auni(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11tphys_from_auni(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
  __pyx_t_5numpy_float64_t __pyx_v_a;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tphys_from_auni (wrapper)", 0);
  assert(__pyx_arg_a); {
    __pyx_v_a = __pyx_PyFloat_AsDouble(__pyx_arg_a); if (unlikely((__pyx_v_a == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tphys_from_auni", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10tphys_from_auni(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_a));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10tphys_from_auni(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tphys_from_auni", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":354
 * 
 *     def tphys_from_auni(self, np.float64_t a):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tphys_from_auni(self.cosmology, a)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":355
 *     def tphys_from_auni(self, np.float64_t a):
 *         if self.cosmology:
 *             return tphys_from_auni(self.cosmology, a)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("tphys_from_auni called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(tphys_from_auni(__pyx_v_self->cosmology, __pyx_v_a)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":354
 * 
 *     def tphys_from_auni(self, np.float64_t a):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tphys_from_auni(self.cosmology, a)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":357
 *             return tphys_from_auni(self.cosmology, a)
 *         else:
 *             raise RuntimeError("tphys_from_auni called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def auni_from_abox(self, np.float64_t v):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":353
 *             raise RuntimeError("tcode_from_auni called for non-cosmological ARTIO fileset!")
 * 
 *     def tphys_from_auni(self, np.float64_t a):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tphys_from_auni(self.cosmology, a)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tphys_from_auni", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":359
 *             raise RuntimeError("tphys_from_auni called for non-cosmological ARTIO fileset!")
 * 
 *     def auni_from_abox(self, np.float64_t v):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return auni_from_abox(self.cosmology, v)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13auni_from_abox(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13auni_from_abox(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) {
  __pyx_t_5numpy_float64_t __pyx_v_v;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("auni_from_abox (wrapper)", 0);
  assert(__pyx_arg_v); {
    __pyx_v_v = __pyx_PyFloat_AsDouble(__pyx_arg_v); if (unlikely((__pyx_v_v == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.auni_from_abox", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_12auni_from_abox(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_12auni_from_abox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("auni_from_abox", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":360
 * 
 *     def auni_from_abox(self, np.float64_t v):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return auni_from_abox(self.cosmology, v)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":361
 *     def auni_from_abox(self, np.float64_t v):
 *         if self.cosmology:
 *             return auni_from_abox(self.cosmology, v)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("auni_from_abox called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(auni_from_abox(__pyx_v_self->cosmology, __pyx_v_v)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":360
 * 
 *     def auni_from_abox(self, np.float64_t v):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return auni_from_abox(self.cosmology, v)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":363
 *             return auni_from_abox(self.cosmology, v)
 *         else:
 *             raise RuntimeError("auni_from_abox called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def auni_from_tcode(self, np.float64_t v):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":359
 *             raise RuntimeError("tphys_from_auni called for non-cosmological ARTIO fileset!")
 * 
 *     def auni_from_abox(self, np.float64_t v):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return auni_from_abox(self.cosmology, v)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.auni_from_abox", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":365
 *             raise RuntimeError("auni_from_abox called for non-cosmological ARTIO fileset!")
 * 
 *     def auni_from_tcode(self, np.float64_t v):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return auni_from_tcode(self.cosmology, v)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_15auni_from_tcode(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_15auni_from_tcode(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) {
  __pyx_t_5numpy_float64_t __pyx_v_v;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("auni_from_tcode (wrapper)", 0);
  assert(__pyx_arg_v); {
    __pyx_v_v = __pyx_PyFloat_AsDouble(__pyx_arg_v); if (unlikely((__pyx_v_v == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.auni_from_tcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_14auni_from_tcode(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_14auni_from_tcode(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("auni_from_tcode", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":366
 * 
 *     def auni_from_tcode(self, np.float64_t v):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return auni_from_tcode(self.cosmology, v)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":367
 *     def auni_from_tcode(self, np.float64_t v):
 *         if self.cosmology:
 *             return auni_from_tcode(self.cosmology, v)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("auni_from_tcode called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(auni_from_tcode(__pyx_v_self->cosmology, __pyx_v_v)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":366
 * 
 *     def auni_from_tcode(self, np.float64_t v):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return auni_from_tcode(self.cosmology, v)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":369
 *             return auni_from_tcode(self.cosmology, v)
 *         else:
 *             raise RuntimeError("auni_from_tcode called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     @cython.wraparound(False)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":365
 *             raise RuntimeError("auni_from_abox called for non-cosmological ARTIO fileset!")
 * 
 *     def auni_from_tcode(self, np.float64_t v):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return auni_from_tcode(self.cosmology, v)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.auni_from_tcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":373
 *     @cython.wraparound(False)
 *     @cython.boundscheck(False)
 *     def auni_from_tcode_array(self, np.ndarray[np.float64_t] tcode):             # <<<<<<<<<<<<<<
 *         cdef int i, nauni
 *         cdef np.ndarray[np.float64_t, ndim=1] auni
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_17auni_from_tcode_array(PyObject *__pyx_v_self, PyObject *__pyx_v_tcode); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_17auni_from_tcode_array(PyObject *__pyx_v_self, PyObject *__pyx_v_tcode) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("auni_from_tcode_array (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tcode), __pyx_ptype_5numpy_ndarray, 1, "tcode", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_16auni_from_tcode_array(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyArrayObject *)__pyx_v_tcode));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_16auni_from_tcode_array(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyArrayObject *__pyx_v_tcode) {
  int __pyx_v_i;
  int __pyx_v_nauni;
  PyArrayObject *__pyx_v_auni = 0;
  CosmologyParameters *__pyx_v_cosmology;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_auni;
  __Pyx_Buffer __pyx_pybuffer_auni;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_tcode;
  __Pyx_Buffer __pyx_pybuffer_tcode;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  CosmologyParameters *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("auni_from_tcode_array", 0);
  __pyx_pybuffer_auni.pybuffer.buf = NULL;
  __pyx_pybuffer_auni.refcount = 0;
  __pyx_pybuffernd_auni.data = NULL;
  __pyx_pybuffernd_auni.rcbuffer = &__pyx_pybuffer_auni;
  __pyx_pybuffer_tcode.pybuffer.buf = NULL;
  __pyx_pybuffer_tcode.refcount = 0;
  __pyx_pybuffernd_tcode.data = NULL;
  __pyx_pybuffernd_tcode.rcbuffer = &__pyx_pybuffer_tcode;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tcode.rcbuffer->pybuffer, (PyObject*)__pyx_v_tcode, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_tcode.diminfo[0].strides = __pyx_pybuffernd_tcode.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tcode.diminfo[0].shape = __pyx_pybuffernd_tcode.rcbuffer->pybuffer.shape[0];

  /* "yt/frontends/artio/_artio_caller.pyx":376
 *         cdef int i, nauni
 *         cdef np.ndarray[np.float64_t, ndim=1] auni
 *         cdef CosmologyParameters *cosmology = self.cosmology             # <<<<<<<<<<<<<<
 *         if not cosmology:
 *             raise RuntimeError("auni_from_tcode_array called for non-cosmological ARTIO fileset!")
 */
  __pyx_t_1 = __pyx_v_self->cosmology;
  __pyx_v_cosmology = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":377
 *         cdef np.ndarray[np.float64_t, ndim=1] auni
 *         cdef CosmologyParameters *cosmology = self.cosmology
 *         if not cosmology:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("auni_from_tcode_array called for non-cosmological ARTIO fileset!")
 *         auni = np.empty_like(tcode)
 */
  __pyx_t_2 = ((!(__pyx_v_cosmology != 0)) != 0);
  if (__pyx_t_2) {

    /* "yt/frontends/artio/_artio_caller.pyx":378
 *         cdef CosmologyParameters *cosmology = self.cosmology
 *         if not cosmology:
 *             raise RuntimeError("auni_from_tcode_array called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 *         auni = np.empty_like(tcode)
 *         nauni = auni.shape[0]
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":377
 *         cdef np.ndarray[np.float64_t, ndim=1] auni
 *         cdef CosmologyParameters *cosmology = self.cosmology
 *         if not cosmology:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("auni_from_tcode_array called for non-cosmological ARTIO fileset!")
 *         auni = np.empty_like(tcode)
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":379
 *         if not cosmology:
 *             raise RuntimeError("auni_from_tcode_array called for non-cosmological ARTIO fileset!")
 *         auni = np.empty_like(tcode)             # <<<<<<<<<<<<<<
 *         nauni = auni.shape[0]
 *         with nogil:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_tcode)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_tcode));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_tcode));
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_tcode));
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_auni.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_auni.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_auni.rcbuffer->pybuffer, (PyObject*)__pyx_v_auni, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_auni.diminfo[0].strides = __pyx_pybuffernd_auni.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_auni.diminfo[0].shape = __pyx_pybuffernd_auni.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_auni = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":380
 *             raise RuntimeError("auni_from_tcode_array called for non-cosmological ARTIO fileset!")
 *         auni = np.empty_like(tcode)
 *         nauni = auni.shape[0]             # <<<<<<<<<<<<<<
 *         with nogil:
 *             for i in range(nauni):
 */
  __pyx_v_nauni = (__pyx_v_auni->dimensions[0]);

  /* "yt/frontends/artio/_artio_caller.pyx":381
 *         auni = np.empty_like(tcode)
 *         nauni = auni.shape[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nauni):
 *                 auni[i] = auni_from_tcode(self.cosmology, tcode[i])
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "yt/frontends/artio/_artio_caller.pyx":382
 *         nauni = auni.shape[0]
 *         with nogil:
 *             for i in range(nauni):             # <<<<<<<<<<<<<<
 *                 auni[i] = auni_from_tcode(self.cosmology, tcode[i])
 *         return auni
 */
        __pyx_t_8 = __pyx_v_nauni;
        for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_8; __pyx_t_12+=1) {
          __pyx_v_i = __pyx_t_12;

          /* "yt/frontends/artio/_artio_caller.pyx":383
 *         with nogil:
 *             for i in range(nauni):
 *                 auni[i] = auni_from_tcode(self.cosmology, tcode[i])             # <<<<<<<<<<<<<<
 *         return auni
 * 
 */
          __pyx_t_13 = __pyx_v_i;
          __pyx_t_14 = __pyx_v_i;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_auni.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_auni.diminfo[0].strides) = auni_from_tcode(__pyx_v_self->cosmology, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tcode.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_tcode.diminfo[0].strides)));
        }
      }

      /* "yt/frontends/artio/_artio_caller.pyx":381
 *         auni = np.empty_like(tcode)
 *         nauni = auni.shape[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nauni):
 *                 auni[i] = auni_from_tcode(self.cosmology, tcode[i])
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "yt/frontends/artio/_artio_caller.pyx":384
 *             for i in range(nauni):
 *                 auni[i] = auni_from_tcode(self.cosmology, tcode[i])
 *         return auni             # <<<<<<<<<<<<<<
 * 
 *     def auni_from_tphys(self, np.float64_t v):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_auni));
  __pyx_r = ((PyObject *)__pyx_v_auni);
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":373
 *     @cython.wraparound(False)
 *     @cython.boundscheck(False)
 *     def auni_from_tcode_array(self, np.ndarray[np.float64_t] tcode):             # <<<<<<<<<<<<<<
 *         cdef int i, nauni
 *         cdef np.ndarray[np.float64_t, ndim=1] auni
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_auni.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tcode.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.auni_from_tcode_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_auni.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tcode.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_auni);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":386
 *         return auni
 * 
 *     def auni_from_tphys(self, np.float64_t v):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return auni_from_tphys(self.cosmology, v)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_19auni_from_tphys(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_19auni_from_tphys(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) {
  __pyx_t_5numpy_float64_t __pyx_v_v;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("auni_from_tphys (wrapper)", 0);
  assert(__pyx_arg_v); {
    __pyx_v_v = __pyx_PyFloat_AsDouble(__pyx_arg_v); if (unlikely((__pyx_v_v == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.auni_from_tphys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18auni_from_tphys(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18auni_from_tphys(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("auni_from_tphys", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":387
 * 
 *     def auni_from_tphys(self, np.float64_t v):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return auni_from_tphys(self.cosmology, v)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":388
 *     def auni_from_tphys(self, np.float64_t v):
 *         if self.cosmology:
 *             return auni_from_tphys(self.cosmology, v)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("auni_from_tphys called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(auni_from_tphys(__pyx_v_self->cosmology, __pyx_v_v)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":387
 * 
 *     def auni_from_tphys(self, np.float64_t v):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return auni_from_tphys(self.cosmology, v)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":390
 *             return auni_from_tphys(self.cosmology, v)
 *         else:
 *             raise RuntimeError("auni_from_tphys called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def abox_from_tcode(self, np.float64_t abox):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":386
 *         return auni
 * 
 *     def auni_from_tphys(self, np.float64_t v):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return auni_from_tphys(self.cosmology, v)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.auni_from_tphys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":392
 *             raise RuntimeError("auni_from_tphys called for non-cosmological ARTIO fileset!")
 * 
 *     def abox_from_tcode(self, np.float64_t abox):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return abox_from_tcode(self.cosmology, abox)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_21abox_from_tcode(PyObject *__pyx_v_self, PyObject *__pyx_arg_abox); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_21abox_from_tcode(PyObject *__pyx_v_self, PyObject *__pyx_arg_abox) {
  __pyx_t_5numpy_float64_t __pyx_v_abox;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("abox_from_tcode (wrapper)", 0);
  assert(__pyx_arg_abox); {
    __pyx_v_abox = __pyx_PyFloat_AsDouble(__pyx_arg_abox); if (unlikely((__pyx_v_abox == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.abox_from_tcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_20abox_from_tcode(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_abox));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_20abox_from_tcode(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_abox) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abox_from_tcode", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":393
 * 
 *     def abox_from_tcode(self, np.float64_t abox):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return abox_from_tcode(self.cosmology, abox)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":394
 *     def abox_from_tcode(self, np.float64_t abox):
 *         if self.cosmology:
 *             return abox_from_tcode(self.cosmology, abox)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("abox_from_tcode called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(abox_from_tcode(__pyx_v_self->cosmology, __pyx_v_abox)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":393
 * 
 *     def abox_from_tcode(self, np.float64_t abox):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return abox_from_tcode(self.cosmology, abox)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":396
 *             return abox_from_tcode(self.cosmology, abox)
 *         else:
 *             raise RuntimeError("abox_from_tcode called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tcode_from_abox(self, np.float64_t abox):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":392
 *             raise RuntimeError("auni_from_tphys called for non-cosmological ARTIO fileset!")
 * 
 *     def abox_from_tcode(self, np.float64_t abox):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return abox_from_tcode(self.cosmology, abox)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.abox_from_tcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":398
 *             raise RuntimeError("abox_from_tcode called for non-cosmological ARTIO fileset!")
 * 
 *     def tcode_from_abox(self, np.float64_t abox):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tcode_from_abox(self.cosmology, abox)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_23tcode_from_abox(PyObject *__pyx_v_self, PyObject *__pyx_arg_abox); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_23tcode_from_abox(PyObject *__pyx_v_self, PyObject *__pyx_arg_abox) {
  __pyx_t_5numpy_float64_t __pyx_v_abox;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tcode_from_abox (wrapper)", 0);
  assert(__pyx_arg_abox); {
    __pyx_v_abox = __pyx_PyFloat_AsDouble(__pyx_arg_abox); if (unlikely((__pyx_v_abox == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tcode_from_abox", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_22tcode_from_abox(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_abox));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_22tcode_from_abox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_abox) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tcode_from_abox", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":399
 * 
 *     def tcode_from_abox(self, np.float64_t abox):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tcode_from_abox(self.cosmology, abox)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":400
 *     def tcode_from_abox(self, np.float64_t abox):
 *         if self.cosmology:
 *             return tcode_from_abox(self.cosmology, abox)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("tcode_from_abox called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(tcode_from_abox(__pyx_v_self->cosmology, __pyx_v_abox)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":399
 * 
 *     def tcode_from_abox(self, np.float64_t abox):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tcode_from_abox(self.cosmology, abox)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":402
 *             return tcode_from_abox(self.cosmology, abox)
 *         else:
 *             raise RuntimeError("tcode_from_abox called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tphys_from_abox(self, np.float64_t abox):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":398
 *             raise RuntimeError("abox_from_tcode called for non-cosmological ARTIO fileset!")
 * 
 *     def tcode_from_abox(self, np.float64_t abox):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tcode_from_abox(self.cosmology, abox)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tcode_from_abox", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":404
 *             raise RuntimeError("tcode_from_abox called for non-cosmological ARTIO fileset!")
 * 
 *     def tphys_from_abox(self, np.float64_t abox):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tphys_from_abox(self.cosmology, abox)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_25tphys_from_abox(PyObject *__pyx_v_self, PyObject *__pyx_arg_abox); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_25tphys_from_abox(PyObject *__pyx_v_self, PyObject *__pyx_arg_abox) {
  __pyx_t_5numpy_float64_t __pyx_v_abox;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tphys_from_abox (wrapper)", 0);
  assert(__pyx_arg_abox); {
    __pyx_v_abox = __pyx_PyFloat_AsDouble(__pyx_arg_abox); if (unlikely((__pyx_v_abox == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tphys_from_abox", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_24tphys_from_abox(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_abox));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_24tphys_from_abox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_abox) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tphys_from_abox", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":405
 * 
 *     def tphys_from_abox(self, np.float64_t abox):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tphys_from_abox(self.cosmology, abox)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":406
 *     def tphys_from_abox(self, np.float64_t abox):
 *         if self.cosmology:
 *             return tphys_from_abox(self.cosmology, abox)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("tphys_from_abox called for non-cosmological ARTIO fileset!")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(tphys_from_abox(__pyx_v_self->cosmology, __pyx_v_abox)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":405
 * 
 *     def tphys_from_abox(self, np.float64_t abox):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tphys_from_abox(self.cosmology, abox)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":408
 *             return tphys_from_abox(self.cosmology, abox)
 *         else:
 *             raise RuntimeError("tphys_from_abox called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tphys_from_tcode(self, np.float64_t tcode):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/frontends/artio/_artio_caller.pyx":404
 *             raise RuntimeError("tcode_from_abox called for non-cosmological ARTIO fileset!")
 * 
 *     def tphys_from_abox(self, np.float64_t abox):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tphys_from_abox(self.cosmology, abox)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tphys_from_abox", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":410
 *             raise RuntimeError("tphys_from_abox called for non-cosmological ARTIO fileset!")
 * 
 *     def tphys_from_tcode(self, np.float64_t tcode):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tphys_from_tcode(self.cosmology, tcode)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_27tphys_from_tcode(PyObject *__pyx_v_self, PyObject *__pyx_arg_tcode); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_27tphys_from_tcode(PyObject *__pyx_v_self, PyObject *__pyx_arg_tcode) {
  __pyx_t_5numpy_float64_t __pyx_v_tcode;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tphys_from_tcode (wrapper)", 0);
  assert(__pyx_arg_tcode); {
    __pyx_v_tcode = __pyx_PyFloat_AsDouble(__pyx_arg_tcode); if (unlikely((__pyx_v_tcode == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tphys_from_tcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_26tphys_from_tcode(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_tcode));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_26tphys_from_tcode(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_tcode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tphys_from_tcode", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":411
 * 
 *     def tphys_from_tcode(self, np.float64_t tcode):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tphys_from_tcode(self.cosmology, tcode)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->cosmology != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":412
 *     def tphys_from_tcode(self, np.float64_t tcode):
 *         if self.cosmology:
 *             return tphys_from_tcode(self.cosmology, tcode)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.tcode_to_years*tcode
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(tphys_from_tcode(__pyx_v_self->cosmology, __pyx_v_tcode)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":411
 * 
 *     def tphys_from_tcode(self, np.float64_t tcode):
 *         if self.cosmology:             # <<<<<<<<<<<<<<
 *             return tphys_from_tcode(self.cosmology, tcode)
 *         else:
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":414
 *             return tphys_from_tcode(self.cosmology, tcode)
 *         else:
 *             return self.tcode_to_years*tcode             # <<<<<<<<<<<<<<
 * 
 *     @cython.wraparound(False)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->tcode_to_years * __pyx_v_tcode)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":410
 *             raise RuntimeError("tphys_from_abox called for non-cosmological ARTIO fileset!")
 * 
 *     def tphys_from_tcode(self, np.float64_t tcode):             # <<<<<<<<<<<<<<
 *         if self.cosmology:
 *             return tphys_from_tcode(self.cosmology, tcode)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tphys_from_tcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":418
 *     @cython.wraparound(False)
 *     @cython.boundscheck(False)
 *     def tphys_from_tcode_array(self, np.ndarray[np.float64_t] tcode):             # <<<<<<<<<<<<<<
 *         cdef int i, ntphys
 *         cdef np.ndarray[np.float64_t, ndim=1] tphys
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_29tphys_from_tcode_array(PyObject *__pyx_v_self, PyObject *__pyx_v_tcode); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_29tphys_from_tcode_array(PyObject *__pyx_v_self, PyObject *__pyx_v_tcode) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tphys_from_tcode_array (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tcode), __pyx_ptype_5numpy_ndarray, 1, "tcode", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_28tphys_from_tcode_array(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyArrayObject *)__pyx_v_tcode));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_28tphys_from_tcode_array(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyArrayObject *__pyx_v_tcode) {
  int __pyx_v_i;
  int __pyx_v_ntphys;
  PyArrayObject *__pyx_v_tphys = 0;
  CosmologyParameters *__pyx_v_cosmology;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_tcode;
  __Pyx_Buffer __pyx_pybuffer_tcode;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_tphys;
  __Pyx_Buffer __pyx_pybuffer_tphys;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  CosmologyParameters *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tphys_from_tcode_array", 0);
  __pyx_pybuffer_tphys.pybuffer.buf = NULL;
  __pyx_pybuffer_tphys.refcount = 0;
  __pyx_pybuffernd_tphys.data = NULL;
  __pyx_pybuffernd_tphys.rcbuffer = &__pyx_pybuffer_tphys;
  __pyx_pybuffer_tcode.pybuffer.buf = NULL;
  __pyx_pybuffer_tcode.refcount = 0;
  __pyx_pybuffernd_tcode.data = NULL;
  __pyx_pybuffernd_tcode.rcbuffer = &__pyx_pybuffer_tcode;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tcode.rcbuffer->pybuffer, (PyObject*)__pyx_v_tcode, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_tcode.diminfo[0].strides = __pyx_pybuffernd_tcode.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tcode.diminfo[0].shape = __pyx_pybuffernd_tcode.rcbuffer->pybuffer.shape[0];

  /* "yt/frontends/artio/_artio_caller.pyx":421
 *         cdef int i, ntphys
 *         cdef np.ndarray[np.float64_t, ndim=1] tphys
 *         cdef CosmologyParameters *cosmology = self.cosmology             # <<<<<<<<<<<<<<
 *         tphys = np.empty_like(tcode)
 *         ntphys = tcode.shape[0]
 */
  __pyx_t_1 = __pyx_v_self->cosmology;
  __pyx_v_cosmology = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":422
 *         cdef np.ndarray[np.float64_t, ndim=1] tphys
 *         cdef CosmologyParameters *cosmology = self.cosmology
 *         tphys = np.empty_like(tcode)             # <<<<<<<<<<<<<<
 *         ntphys = tcode.shape[0]
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_tcode)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_tcode));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_tcode));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_tcode));
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer, (PyObject*)__pyx_v_tphys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_tphys.diminfo[0].strides = __pyx_pybuffernd_tphys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tphys.diminfo[0].shape = __pyx_pybuffernd_tphys.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_tphys = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":423
 *         cdef CosmologyParameters *cosmology = self.cosmology
 *         tphys = np.empty_like(tcode)
 *         ntphys = tcode.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         if cosmology:
 */
  __pyx_v_ntphys = (__pyx_v_tcode->dimensions[0]);

  /* "yt/frontends/artio/_artio_caller.pyx":425
 *         ntphys = tcode.shape[0]
 * 
 *         if cosmology:             # <<<<<<<<<<<<<<
 *             tphys = np.empty_like(tcode)
 *             ntphys = tcode.shape[0]
 */
  __pyx_t_11 = (__pyx_v_cosmology != 0);
  if (__pyx_t_11) {

    /* "yt/frontends/artio/_artio_caller.pyx":426
 * 
 *         if cosmology:
 *             tphys = np.empty_like(tcode)             # <<<<<<<<<<<<<<
 *             ntphys = tcode.shape[0]
 *             with nogil:
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_tcode)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_tcode));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_tcode));
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_tcode));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer, (PyObject*)__pyx_v_tphys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_tphys.diminfo[0].strides = __pyx_pybuffernd_tphys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tphys.diminfo[0].shape = __pyx_pybuffernd_tphys.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_tphys, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":427
 *         if cosmology:
 *             tphys = np.empty_like(tcode)
 *             ntphys = tcode.shape[0]             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 for i in range(ntphys):
 */
    __pyx_v_ntphys = (__pyx_v_tcode->dimensions[0]);

    /* "yt/frontends/artio/_artio_caller.pyx":428
 *             tphys = np.empty_like(tcode)
 *             ntphys = tcode.shape[0]
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 for i in range(ntphys):
 *                     tphys[i] = tphys_from_tcode(cosmology, tcode[i])
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "yt/frontends/artio/_artio_caller.pyx":429
 *             ntphys = tcode.shape[0]
 *             with nogil:
 *                 for i in range(ntphys):             # <<<<<<<<<<<<<<
 *                     tphys[i] = tphys_from_tcode(cosmology, tcode[i])
 *             return tphys
 */
          __pyx_t_7 = __pyx_v_ntphys;
          for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) {
            __pyx_v_i = __pyx_t_12;

            /* "yt/frontends/artio/_artio_caller.pyx":430
 *             with nogil:
 *                 for i in range(ntphys):
 *                     tphys[i] = tphys_from_tcode(cosmology, tcode[i])             # <<<<<<<<<<<<<<
 *             return tphys
 *         else:
 */
            __pyx_t_13 = __pyx_v_i;
            __pyx_t_14 = __pyx_v_i;
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tphys.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_tphys.diminfo[0].strides) = tphys_from_tcode(__pyx_v_cosmology, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tcode.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_tcode.diminfo[0].strides)));
          }
        }

        /* "yt/frontends/artio/_artio_caller.pyx":428
 *             tphys = np.empty_like(tcode)
 *             ntphys = tcode.shape[0]
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 for i in range(ntphys):
 *                     tphys[i] = tphys_from_tcode(cosmology, tcode[i])
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "yt/frontends/artio/_artio_caller.pyx":431
 *                 for i in range(ntphys):
 *                     tphys[i] = tphys_from_tcode(cosmology, tcode[i])
 *             return tphys             # <<<<<<<<<<<<<<
 *         else:
 *             return tcode*self.tcode_to_years
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_tphys));
    __pyx_r = ((PyObject *)__pyx_v_tphys);
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":425
 *         ntphys = tcode.shape[0]
 * 
 *         if cosmology:             # <<<<<<<<<<<<<<
 *             tphys = np.empty_like(tcode)
 *             ntphys = tcode.shape[0]
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":433
 *             return tphys
 *         else:
 *             return tcode*self.tcode_to_years             # <<<<<<<<<<<<<<
 * 
 * #    @cython.boundscheck(False)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->tcode_to_years); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyNumber_Multiply(((PyObject *)__pyx_v_tcode), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":418
 *     @cython.wraparound(False)
 *     @cython.boundscheck(False)
 *     def tphys_from_tcode_array(self, np.ndarray[np.float64_t] tcode):             # <<<<<<<<<<<<<<
 *         cdef int i, ntphys
 *         cdef np.ndarray[np.float64_t, ndim=1] tphys
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tcode.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.tphys_from_tcode_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tcode.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tphys.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tphys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":438
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def read_particle_chunk(self, SelectorObject selector, int64_t sfc_start, int64_t sfc_end, fields) :             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef int status
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_31read_particle_chunk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_31read_particle_chunk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  int64_t __pyx_v_sfc_start;
  int64_t __pyx_v_sfc_end;
  PyObject *__pyx_v_fields = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_particle_chunk (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_sfc_start,&__pyx_n_s_sfc_end,&__pyx_n_s_fields,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_start)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_particle_chunk", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_end)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_particle_chunk", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_particle_chunk", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_particle_chunk") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    __pyx_v_sfc_start = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_sfc_start == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_sfc_end = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_sfc_end == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fields = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_particle_chunk", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.read_particle_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_30read_particle_chunk(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), __pyx_v_selector, __pyx_v_sfc_start, __pyx_v_sfc_end, __pyx_v_fields);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_30read_particle_chunk(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int64_t __pyx_v_sfc_start, int64_t __pyx_v_sfc_end, PyObject *__pyx_v_fields) {
  int __pyx_v_i;
  int __pyx_v_status;
  int __pyx_v_subspecies;
  int64_t __pyx_v_pid;
  CYTHON_UNUSED int __pyx_v_num_fields;
  __pyx_t_5numpy_float64_t __pyx_v_pos[3];
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_accessed_species = NULL;
  PyObject *__pyx_v_selected_mass = NULL;
  PyObject *__pyx_v_selected_pid = NULL;
  PyObject *__pyx_v_selected_species = NULL;
  PyObject *__pyx_v_selected_primary = NULL;
  PyObject *__pyx_v_selected_secondary = NULL;
  PyObject *__pyx_v_species = NULL;
  PyObject *__pyx_v_field = NULL;
  int64_t __pyx_v_sfc;
  PyObject *__pyx_v_ispec = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_particle = NULL;
  PyObject *__pyx_v_count = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int64_t __pyx_t_16;
  int64_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  Py_ssize_t __pyx_t_20;
  PyObject *(*__pyx_t_21)(PyObject *);
  PyObject *__pyx_t_22 = NULL;
  Py_ssize_t __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_particle_chunk", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":444
 *         cdef int64_t pid
 * 
 *         cdef int num_fields = len(fields)             # <<<<<<<<<<<<<<
 *         cdef np.float64_t pos[3]
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_num_fields = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":449
 *         # since RuntimeErrors are not fatal, ensure no artio_particles* functions
 *         # called if fileset lacks particles
 *         if not self.has_particles: return             # <<<<<<<<<<<<<<
 * 
 *         data = {}
 */
  __pyx_t_2 = ((!(__pyx_v_self->has_particles != 0)) != 0);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":451
 *         if not self.has_particles: return
 * 
 *         data = {}             # <<<<<<<<<<<<<<
 *         accessed_species = np.zeros( self.num_species, dtype="int")
 *         selected_mass = [ None for i in range(self.num_species)]
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_data = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":452
 * 
 *         data = {}
 *         accessed_species = np.zeros( self.num_species, dtype="int")             # <<<<<<<<<<<<<<
 *         selected_mass = [ None for i in range(self.num_species)]
 *         selected_pid = [ None for i in range(self.num_species)]
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->num_species); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_accessed_species = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":453
 *         data = {}
 *         accessed_species = np.zeros( self.num_species, dtype="int")
 *         selected_mass = [ None for i in range(self.num_species)]             # <<<<<<<<<<<<<<
 *         selected_pid = [ None for i in range(self.num_species)]
 *         selected_species = [ None for i in range(self.num_species)]
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_v_self->num_species;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)Py_None))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_selected_mass = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":454
 *         accessed_species = np.zeros( self.num_species, dtype="int")
 *         selected_mass = [ None for i in range(self.num_species)]
 *         selected_pid = [ None for i in range(self.num_species)]             # <<<<<<<<<<<<<<
 *         selected_species = [ None for i in range(self.num_species)]
 *         selected_primary = [ [] for i in range(self.num_species)]
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_v_self->num_species;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)Py_None))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_selected_pid = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":455
 *         selected_mass = [ None for i in range(self.num_species)]
 *         selected_pid = [ None for i in range(self.num_species)]
 *         selected_species = [ None for i in range(self.num_species)]             # <<<<<<<<<<<<<<
 *         selected_primary = [ [] for i in range(self.num_species)]
 *         selected_secondary = [ [] for i in range(self.num_species)]
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_v_self->num_species;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)Py_None))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_selected_species = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":456
 *         selected_pid = [ None for i in range(self.num_species)]
 *         selected_species = [ None for i in range(self.num_species)]
 *         selected_primary = [ [] for i in range(self.num_species)]             # <<<<<<<<<<<<<<
 *         selected_secondary = [ [] for i in range(self.num_species)]
 * 
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_v_self->num_species;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_selected_primary = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":457
 *         selected_species = [ None for i in range(self.num_species)]
 *         selected_primary = [ [] for i in range(self.num_species)]
 *         selected_secondary = [ [] for i in range(self.num_species)]             # <<<<<<<<<<<<<<
 * 
 *         for species,field in fields :
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_v_self->num_species;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_selected_secondary = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":459
 *         selected_secondary = [ [] for i in range(self.num_species)]
 * 
 *         for species,field in fields :             # <<<<<<<<<<<<<<
 *             if species < 0 or species > self.num_species :
 *                 raise RuntimeError("Invalid species provided to read_particle_chunk")
 */
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_6 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L16_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L16_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L17_unpacking_done;
      __pyx_L16_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L17_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_species, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":460
 * 
 *         for species,field in fields :
 *             if species < 0 or species > self.num_species :             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Invalid species provided to read_particle_chunk")
 *             accessed_species[species] = 1
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_species, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_12) {
    } else {
      __pyx_t_2 = __pyx_t_12;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->num_species); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_species, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_12;
    __pyx_L19_bool_binop_done:;
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":461
 *         for species,field in fields :
 *             if species < 0 or species > self.num_species :
 *                 raise RuntimeError("Invalid species provided to read_particle_chunk")             # <<<<<<<<<<<<<<
 *             accessed_species[species] = 1
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "yt/frontends/artio/_artio_caller.pyx":460
 * 
 *         for species,field in fields :
 *             if species < 0 or species > self.num_species :             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Invalid species provided to read_particle_chunk")
 *             accessed_species[species] = 1
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":462
 *             if species < 0 or species > self.num_species :
 *                 raise RuntimeError("Invalid species provided to read_particle_chunk")
 *             accessed_species[species] = 1             # <<<<<<<<<<<<<<
 * 
 *             if self.parameters["num_primary_variables"][species] > 0 and \
 */
    if (unlikely(PyObject_SetItem(__pyx_v_accessed_species, __pyx_v_species, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":464
 *             accessed_species[species] = 1
 * 
 *             if self.parameters["num_primary_variables"][species] > 0 and \             # <<<<<<<<<<<<<<
 *                     field in self.parameters["species_%02u_primary_variable_labels"%(species,)] :
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_num_primary_variables); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_GetItem(__pyx_t_4, __pyx_v_species); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_12) {
    } else {
      __pyx_t_2 = __pyx_t_12;
      goto __pyx_L22_bool_binop_done;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":465
 * 
 *             if self.parameters["num_primary_variables"][species] > 0 and \
 *                     field in self.parameters["species_%02u_primary_variable_labels"%(species,)] :             # <<<<<<<<<<<<<<
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_species);
    __Pyx_GIVEREF(__pyx_v_species);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_species);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_species__02u_primary_variable_la, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = (__pyx_t_12 != 0);
    __pyx_t_2 = __pyx_t_13;
    __pyx_L22_bool_binop_done:;

    /* "yt/frontends/artio/_artio_caller.pyx":464
 *             accessed_species[species] = 1
 * 
 *             if self.parameters["num_primary_variables"][species] > 0 and \             # <<<<<<<<<<<<<<
 *                     field in self.parameters["species_%02u_primary_variable_labels"%(species,)] :
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 */
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":466
 *             if self.parameters["num_primary_variables"][species] > 0 and \
 *                     field in self.parameters["species_%02u_primary_variable_labels"%(species,)] :
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))             # <<<<<<<<<<<<<<
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_selected_primary, __pyx_v_species); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_species);
      __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_species__02u_primary_variable_la, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_t_10); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_field); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_field);
        __Pyx_GIVEREF(__pyx_v_field);
        PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_field);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_field);
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_10);
      __pyx_t_3 = 0;
      __pyx_t_10 = 0;
      __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_14); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":467
 *                     field in self.parameters["species_%02u_primary_variable_labels"%(species,)] :
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")             # <<<<<<<<<<<<<<
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 */
      __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__18, __pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_14, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":464
 *             accessed_species[species] = 1
 * 
 *             if self.parameters["num_primary_variables"][species] > 0 and \             # <<<<<<<<<<<<<<
 *                     field in self.parameters["species_%02u_primary_variable_labels"%(species,)] :
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 */
      goto __pyx_L21;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":468
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \             # <<<<<<<<<<<<<<
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 */
    __pyx_t_10 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_num_secondary_variables); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_v_species); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_RichCompare(__pyx_t_14, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_13) {
    } else {
      __pyx_t_2 = __pyx_t_13;
      goto __pyx_L24_bool_binop_done;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":469
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :             # <<<<<<<<<<<<<<
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 */
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_species);
    __Pyx_GIVEREF(__pyx_v_species);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_species);
    __pyx_t_14 = __Pyx_PyString_Format(__pyx_kp_s_species__02u_secondary_variable, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_t_14); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_t_10, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_12 = (__pyx_t_13 != 0);
    __pyx_t_2 = __pyx_t_12;
    __pyx_L24_bool_binop_done:;

    /* "yt/frontends/artio/_artio_caller.pyx":468
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \             # <<<<<<<<<<<<<<
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 */
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":470
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))             # <<<<<<<<<<<<<<
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "MASS" :
 */
      __pyx_t_10 = PyObject_GetItem(__pyx_v_selected_secondary, __pyx_v_species); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_species);
      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_species__02u_secondary_variable, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_field); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_field);
        __Pyx_GIVEREF(__pyx_v_field);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_field);
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_field);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
      __pyx_t_14 = 0;
      __pyx_t_3 = 0;
      __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_10, __pyx_t_5); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":471
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")             # <<<<<<<<<<<<<<
 *             elif field == "MASS" :
 *                 selected_mass[species] = (species,field)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__19, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":468
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \             # <<<<<<<<<<<<<<
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 */
      goto __pyx_L21;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":472
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "MASS" :             # <<<<<<<<<<<<<<
 *                 selected_mass[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_MASS, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":473
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "MASS" :
 *                 selected_mass[species] = (species,field)             # <<<<<<<<<<<<<<
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "PID" :
 */
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_field);
      if (unlikely(PyObject_SetItem(__pyx_v_selected_mass, __pyx_v_species, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":474
 *             elif field == "MASS" :
 *                 selected_mass[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="float64")             # <<<<<<<<<<<<<<
 *             elif field == "PID" :
 *                 selected_pid[species] = (species,field)
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__20, __pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_3, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":472
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "MASS" :             # <<<<<<<<<<<<<<
 *                 selected_mass[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 */
      goto __pyx_L21;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":475
 *                 selected_mass[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "PID" :             # <<<<<<<<<<<<<<
 *                 selected_pid[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int64")
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_PID, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":476
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "PID" :
 *                 selected_pid[species] = (species,field)             # <<<<<<<<<<<<<<
 *                 data[(species,field)] = np.empty(0,dtype="int64")
 *             elif field == "SPECIES" :
 */
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_field);
      if (unlikely(PyObject_SetItem(__pyx_v_selected_pid, __pyx_v_species, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":477
 *             elif field == "PID" :
 *                 selected_pid[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int64")             # <<<<<<<<<<<<<<
 *             elif field == "SPECIES" :
 *                 selected_species[species] = (species,field)
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_10, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":475
 *                 selected_mass[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="float64")
 *             elif field == "PID" :             # <<<<<<<<<<<<<<
 *                 selected_pid[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int64")
 */
      goto __pyx_L21;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":478
 *                 selected_pid[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int64")
 *             elif field == "SPECIES" :             # <<<<<<<<<<<<<<
 *                 selected_species[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int8")
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_SPECIES, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":479
 *                 data[(species,field)] = np.empty(0,dtype="int64")
 *             elif field == "SPECIES" :
 *                 selected_species[species] = (species,field)             # <<<<<<<<<<<<<<
 *                 data[(species,field)] = np.empty(0,dtype="int8")
 *             else :
 */
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_field);
      if (unlikely(PyObject_SetItem(__pyx_v_selected_species, __pyx_v_species, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":480
 *             elif field == "SPECIES" :
 *                 selected_species[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int8")             # <<<<<<<<<<<<<<
 *             else :
 *                 raise RuntimeError("invalid field name provided to read_particle_chunk")
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_int8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__22, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":478
 *                 selected_pid[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int64")
 *             elif field == "SPECIES" :             # <<<<<<<<<<<<<<
 *                 selected_species[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int8")
 */
      goto __pyx_L21;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":482
 *                 data[(species,field)] = np.empty(0,dtype="int8")
 *             else :
 *                 raise RuntimeError("invalid field name provided to read_particle_chunk")             # <<<<<<<<<<<<<<
 * 
 *         # cache the range
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L21:;

    /* "yt/frontends/artio/_artio_caller.pyx":459
 *         selected_secondary = [ [] for i in range(self.num_species)]
 * 
 *         for species,field in fields :             # <<<<<<<<<<<<<<
 *             if species < 0 or species > self.num_species :
 *                 raise RuntimeError("Invalid species provided to read_particle_chunk")
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":485
 * 
 *         # cache the range
 *         status = artio_particle_cache_sfc_range( self.handle, self.sfc_min, self.sfc_max )             # <<<<<<<<<<<<<<
 *         check_artio_status(status)
 * 
 */
  __pyx_v_status = artio_particle_cache_sfc_range(__pyx_v_self->handle, __pyx_v_self->sfc_min, __pyx_v_self->sfc_max);

  /* "yt/frontends/artio/_artio_caller.pyx":486
 *         # cache the range
 *         status = artio_particle_cache_sfc_range( self.handle, self.sfc_min, self.sfc_max )
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *         for sfc in range( sfc_start, sfc_end+1 ) :
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":488
 *         check_artio_status(status)
 * 
 *         for sfc in range( sfc_start, sfc_end+1 ) :             # <<<<<<<<<<<<<<
 *             status = artio_particle_read_root_cell_begin( self.handle, sfc,
 *                     self.num_particles_per_species )
 */
  __pyx_t_16 = (__pyx_v_sfc_end + 1);
  for (__pyx_t_17 = __pyx_v_sfc_start; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
    __pyx_v_sfc = __pyx_t_17;

    /* "yt/frontends/artio/_artio_caller.pyx":489
 * 
 *         for sfc in range( sfc_start, sfc_end+1 ) :
 *             status = artio_particle_read_root_cell_begin( self.handle, sfc,             # <<<<<<<<<<<<<<
 *                     self.num_particles_per_species )
 *             check_artio_status(status)
 */
    __pyx_v_status = artio_particle_read_root_cell_begin(__pyx_v_self->handle, __pyx_v_sfc, __pyx_v_self->num_particles_per_species);

    /* "yt/frontends/artio/_artio_caller.pyx":491
 *             status = artio_particle_read_root_cell_begin( self.handle, sfc,
 *                     self.num_particles_per_species )
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *             for ispec in range(self.num_species) :
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":493
 *             check_artio_status(status)
 * 
 *             for ispec in range(self.num_species) :             # <<<<<<<<<<<<<<
 *                 if accessed_species[ispec] :
 *                     status = artio_particle_read_species_begin(self.handle, ispec)
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->num_species); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_ispec, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":494
 * 
 *             for ispec in range(self.num_species) :
 *                 if accessed_species[ispec] :             # <<<<<<<<<<<<<<
 *                     status = artio_particle_read_species_begin(self.handle, ispec)
 *                     check_artio_status(status)
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_accessed_species, __pyx_v_ispec); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_2) {

        /* "yt/frontends/artio/_artio_caller.pyx":495
 *             for ispec in range(self.num_species) :
 *                 if accessed_species[ispec] :
 *                     status = artio_particle_read_species_begin(self.handle, ispec)             # <<<<<<<<<<<<<<
 *                     check_artio_status(status)
 * 
 */
        __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_ispec); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_status = artio_particle_read_species_begin(__pyx_v_self->handle, __pyx_t_7);

        /* "yt/frontends/artio/_artio_caller.pyx":496
 *                 if accessed_species[ispec] :
 *                     status = artio_particle_read_species_begin(self.handle, ispec)
 *                     check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *                     for particle in range( self.num_particles_per_species[ispec] ) :
 */
        __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

        /* "yt/frontends/artio/_artio_caller.pyx":498
 *                     check_artio_status(status)
 * 
 *                     for particle in range( self.num_particles_per_species[ispec] ) :             # <<<<<<<<<<<<<<
 *                         status = artio_particle_read_particle(self.handle,
 *                                 &pid, &subspecies, self.primary_variables,
 */
        __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ispec); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->num_particles_per_species[__pyx_t_18])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
          __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_18 = 0;
          __pyx_t_19 = NULL;
        } else {
          __pyx_t_18 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_19 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          if (likely(!__pyx_t_19)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_19(__pyx_t_5);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_XDECREF_SET(__pyx_v_particle, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "yt/frontends/artio/_artio_caller.pyx":499
 * 
 *                     for particle in range( self.num_particles_per_species[ispec] ) :
 *                         status = artio_particle_read_particle(self.handle,             # <<<<<<<<<<<<<<
 *                                 &pid, &subspecies, self.primary_variables,
 *                                 self.secondary_variables)
 */
          __pyx_v_status = artio_particle_read_particle(__pyx_v_self->handle, (&__pyx_v_pid), (&__pyx_v_subspecies), __pyx_v_self->primary_variables, __pyx_v_self->secondary_variables);

          /* "yt/frontends/artio/_artio_caller.pyx":502
 *                                 &pid, &subspecies, self.primary_variables,
 *                                 self.secondary_variables)
 *                         check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *                         for i in range(3) :
 */
          __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

          /* "yt/frontends/artio/_artio_caller.pyx":504
 *                         check_artio_status(status)
 * 
 *                         for i in range(3) :             # <<<<<<<<<<<<<<
 *                             pos[i] = self.primary_variables[self.particle_position_index[3*ispec+i]]
 * 
 */
          for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) {
            __pyx_v_i = __pyx_t_7;

            /* "yt/frontends/artio/_artio_caller.pyx":505
 * 
 *                         for i in range(3) :
 *                             pos[i] = self.primary_variables[self.particle_position_index[3*ispec+i]]             # <<<<<<<<<<<<<<
 * 
 *                         if selector.select_point(pos) :
 */
            __pyx_t_6 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ispec); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_14 = PyNumber_Add(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            (__pyx_v_pos[__pyx_v_i]) = (__pyx_v_self->primary_variables[(__pyx_v_self->particle_position_index[__pyx_t_20])]);
          }

          /* "yt/frontends/artio/_artio_caller.pyx":507
 *                             pos[i] = self.primary_variables[self.particle_position_index[3*ispec+i]]
 * 
 *                         if selector.select_point(pos) :             # <<<<<<<<<<<<<<
 *                             # loop over primary variables
 *                             for i,field in selected_primary[ispec] :
 */
          __pyx_t_2 = (((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->select_point(__pyx_v_selector, __pyx_v_pos) != 0);
          if (__pyx_t_2) {

            /* "yt/frontends/artio/_artio_caller.pyx":509
 *                         if selector.select_point(pos) :
 *                             # loop over primary variables
 *                             for i,field in selected_primary[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)
 */
            __pyx_t_14 = PyObject_GetItem(__pyx_v_selected_primary, __pyx_v_ispec); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_14);
            if (likely(PyList_CheckExact(__pyx_t_14)) || PyTuple_CheckExact(__pyx_t_14)) {
              __pyx_t_10 = __pyx_t_14; __Pyx_INCREF(__pyx_t_10); __pyx_t_20 = 0;
              __pyx_t_21 = NULL;
            } else {
              __pyx_t_20 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_21 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            for (;;) {
              if (likely(!__pyx_t_21)) {
                if (likely(PyList_CheckExact(__pyx_t_10))) {
                  if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_10)) break;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  __pyx_t_14 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_20); __Pyx_INCREF(__pyx_t_14); __pyx_t_20++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  #else
                  __pyx_t_14 = PySequence_ITEM(__pyx_t_10, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_14);
                  #endif
                } else {
                  if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_20); __Pyx_INCREF(__pyx_t_14); __pyx_t_20++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  #else
                  __pyx_t_14 = PySequence_ITEM(__pyx_t_10, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_14);
                  #endif
                }
              } else {
                __pyx_t_14 = __pyx_t_21(__pyx_t_10);
                if (unlikely(!__pyx_t_14)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_14);
              }
              if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) {
                PyObject* sequence = __pyx_t_14;
                #if CYTHON_COMPILING_IN_CPYTHON
                Py_ssize_t size = Py_SIZE(sequence);
                #else
                Py_ssize_t size = PySequence_Size(sequence);
                #endif
                if (unlikely(size != 2)) {
                  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                #if CYTHON_COMPILING_IN_CPYTHON
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
                } else {
                  __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
                  __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
                }
                __Pyx_INCREF(__pyx_t_6);
                __Pyx_INCREF(__pyx_t_4);
                #else
                __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_4);
                #endif
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              } else {
                Py_ssize_t index = -1;
                __pyx_t_22 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_22);
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                __pyx_t_11 = Py_TYPE(__pyx_t_22)->tp_iternext;
                index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_22); if (unlikely(!__pyx_t_6)) goto __pyx_L38_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_6);
                index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_22); if (unlikely(!__pyx_t_4)) goto __pyx_L38_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_4);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_22), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __pyx_t_11 = NULL;
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                goto __pyx_L39_unpacking_done;
                __pyx_L38_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                __pyx_t_11 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __pyx_L39_unpacking_done:;
              }
              __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_v_i = __pyx_t_7;
              __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_4);
              __pyx_t_4 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":510
 *                             # loop over primary variables
 *                             for i,field in selected_primary[ispec] :
 *                                 count = len(data[field])             # <<<<<<<<<<<<<<
 *                                 data[field].resize(count+1)
 *                                 data[field][count] = self.primary_variables[i]
 */
              __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_v_field); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_23 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __pyx_t_14 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_14);
              __pyx_t_14 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":511
 *                             for i,field in selected_primary[ispec] :
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)             # <<<<<<<<<<<<<<
 *                                 data[field][count] = self.primary_variables[i]
 * 
 */
              __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_v_field); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_count, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_22 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
                __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_6);
                if (likely(__pyx_t_22)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                  __Pyx_INCREF(__pyx_t_22);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_6, function);
                }
              }
              if (!__pyx_t_22) {
                __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else {
                __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_24);
                __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_22); __pyx_t_22 = NULL;
                __Pyx_GIVEREF(__pyx_t_4);
                PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
                __pyx_t_4 = 0;
                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_24, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              }
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":512
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)
 *                                 data[field][count] = self.primary_variables[i]             # <<<<<<<<<<<<<<
 * 
 *                             # loop over secondary variables
 */
              __pyx_t_14 = PyFloat_FromDouble((__pyx_v_self->primary_variables[__pyx_v_i])); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_v_field); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_6);
              if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_count, __pyx_t_14) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":509
 *                         if selector.select_point(pos) :
 *                             # loop over primary variables
 *                             for i,field in selected_primary[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)
 */
            }
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

            /* "yt/frontends/artio/_artio_caller.pyx":515
 * 
 *                             # loop over secondary variables
 *                             for i,field in selected_secondary[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)
 */
            __pyx_t_10 = PyObject_GetItem(__pyx_v_selected_secondary, __pyx_v_ispec); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_10);
            if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
              __pyx_t_14 = __pyx_t_10; __Pyx_INCREF(__pyx_t_14); __pyx_t_20 = 0;
              __pyx_t_21 = NULL;
            } else {
              __pyx_t_20 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_21 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            for (;;) {
              if (likely(!__pyx_t_21)) {
                if (likely(PyList_CheckExact(__pyx_t_14))) {
                  if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_14)) break;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  __pyx_t_10 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_20); __Pyx_INCREF(__pyx_t_10); __pyx_t_20++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  #else
                  __pyx_t_10 = PySequence_ITEM(__pyx_t_14, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_10);
                  #endif
                } else {
                  if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_20); __Pyx_INCREF(__pyx_t_10); __pyx_t_20++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  #else
                  __pyx_t_10 = PySequence_ITEM(__pyx_t_14, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_10);
                  #endif
                }
              } else {
                __pyx_t_10 = __pyx_t_21(__pyx_t_14);
                if (unlikely(!__pyx_t_10)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_10);
              }
              if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
                PyObject* sequence = __pyx_t_10;
                #if CYTHON_COMPILING_IN_CPYTHON
                Py_ssize_t size = Py_SIZE(sequence);
                #else
                Py_ssize_t size = PySequence_Size(sequence);
                #endif
                if (unlikely(size != 2)) {
                  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                #if CYTHON_COMPILING_IN_CPYTHON
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_24 = PyTuple_GET_ITEM(sequence, 1); 
                } else {
                  __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
                  __pyx_t_24 = PyList_GET_ITEM(sequence, 1); 
                }
                __Pyx_INCREF(__pyx_t_6);
                __Pyx_INCREF(__pyx_t_24);
                #else
                __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_24 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_24);
                #endif
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              } else {
                Py_ssize_t index = -1;
                __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
                index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L42_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_6);
                index = 1; __pyx_t_24 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_24)) goto __pyx_L42_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_24);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __pyx_t_11 = NULL;
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                goto __pyx_L43_unpacking_done;
                __pyx_L42_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_11 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __pyx_L43_unpacking_done:;
              }
              __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_v_i = __pyx_t_7;
              __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_24);
              __pyx_t_24 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":516
 *                             # loop over secondary variables
 *                             for i,field in selected_secondary[ispec] :
 *                                 count = len(data[field])             # <<<<<<<<<<<<<<
 *                                 data[field].resize(count+1)
 *                                 data[field][count] = self.secondary_variables[i]
 */
              __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_v_field); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_10);
              __pyx_t_10 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":517
 *                             for i,field in selected_secondary[ispec] :
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)             # <<<<<<<<<<<<<<
 *                                 data[field][count] = self.secondary_variables[i]
 * 
 */
              __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_v_field); if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_24);
              __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              __pyx_t_24 = __Pyx_PyInt_AddObjC(__pyx_v_count, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_24);
              __pyx_t_4 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_6, function);
                }
              }
              if (!__pyx_t_4) {
                __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_24); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                __Pyx_GOTREF(__pyx_t_10);
              } else {
                __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_22);
                __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_4); __pyx_t_4 = NULL;
                __Pyx_GIVEREF(__pyx_t_24);
                PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_24);
                __pyx_t_24 = 0;
                __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_22, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
              }
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":518
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)
 *                                 data[field][count] = self.secondary_variables[i]             # <<<<<<<<<<<<<<
 * 
 *                             # add particle id
 */
              __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->secondary_variables[__pyx_v_i])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_v_field); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_6);
              if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_count, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":515
 * 
 *                             # loop over secondary variables
 *                             for i,field in selected_secondary[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[field])
 *                                 data[field].resize(count+1)
 */
            }
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "yt/frontends/artio/_artio_caller.pyx":521
 * 
 *                             # add particle id
 *                             if selected_pid[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[selected_pid[ispec]])
 *                                 data[selected_pid[ispec]].resize(count+1)
 */
            __pyx_t_14 = PyObject_GetItem(__pyx_v_selected_pid, __pyx_v_ispec); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_2) {

              /* "yt/frontends/artio/_artio_caller.pyx":522
 *                             # add particle id
 *                             if selected_pid[ispec] :
 *                                 count = len(data[selected_pid[ispec]])             # <<<<<<<<<<<<<<
 *                                 data[selected_pid[ispec]].resize(count+1)
 *                                 data[selected_pid[ispec]][count] = pid
 */
              __pyx_t_14 = PyObject_GetItem(__pyx_v_selected_pid, __pyx_v_ispec); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_14); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __pyx_t_20 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_20); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_10);
              __pyx_t_10 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":523
 *                             if selected_pid[ispec] :
 *                                 count = len(data[selected_pid[ispec]])
 *                                 data[selected_pid[ispec]].resize(count+1)             # <<<<<<<<<<<<<<
 *                                 data[selected_pid[ispec]][count] = pid
 * 
 */
              __pyx_t_14 = PyObject_GetItem(__pyx_v_selected_pid, __pyx_v_ispec); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_14); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_resize); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_count, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_22 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
                __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_14);
                if (likely(__pyx_t_22)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                  __Pyx_INCREF(__pyx_t_22);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_14, function);
                }
              }
              if (!__pyx_t_22) {
                __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_GOTREF(__pyx_t_10);
              } else {
                __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_24);
                __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_22); __pyx_t_22 = NULL;
                __Pyx_GIVEREF(__pyx_t_6);
                PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_6);
                __pyx_t_6 = 0;
                __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_24, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              }
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":524
 *                                 count = len(data[selected_pid[ispec]])
 *                                 data[selected_pid[ispec]].resize(count+1)
 *                                 data[selected_pid[ispec]][count] = pid             # <<<<<<<<<<<<<<
 * 
 *                             # add mass if requested
 */
              __pyx_t_10 = __Pyx_PyInt_From_int64_t(__pyx_v_pid); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_14 = PyObject_GetItem(__pyx_v_selected_pid, __pyx_v_ispec); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_14); if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_24);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (unlikely(PyObject_SetItem(__pyx_t_24, __pyx_v_count, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":521
 * 
 *                             # add particle id
 *                             if selected_pid[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[selected_pid[ispec]])
 *                                 data[selected_pid[ispec]].resize(count+1)
 */
            }

            /* "yt/frontends/artio/_artio_caller.pyx":527
 * 
 *                             # add mass if requested
 *                             if selected_mass[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[selected_mass[ispec]])
 *                                 data[selected_mass[ispec]].resize(count+1)
 */
            __pyx_t_10 = PyObject_GetItem(__pyx_v_selected_mass, __pyx_v_ispec); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (__pyx_t_2) {

              /* "yt/frontends/artio/_artio_caller.pyx":528
 *                             # add mass if requested
 *                             if selected_mass[ispec] :
 *                                 count = len(data[selected_mass[ispec]])             # <<<<<<<<<<<<<<
 *                                 data[selected_mass[ispec]].resize(count+1)
 *                                 data[selected_mass[ispec]][count] = self.parameters["particle_species_mass"][ispec]
 */
              __pyx_t_10 = PyObject_GetItem(__pyx_v_selected_mass, __pyx_v_ispec); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_10); if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_24);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_20 = PyObject_Length(__pyx_t_24); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              __pyx_t_24 = PyInt_FromSsize_t(__pyx_t_20); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_24);
              __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_24);
              __pyx_t_24 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":529
 *                             if selected_mass[ispec] :
 *                                 count = len(data[selected_mass[ispec]])
 *                                 data[selected_mass[ispec]].resize(count+1)             # <<<<<<<<<<<<<<
 *                                 data[selected_mass[ispec]][count] = self.parameters["particle_species_mass"][ispec]
 * 
 */
              __pyx_t_10 = PyObject_GetItem(__pyx_v_selected_mass, __pyx_v_ispec); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_10); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_resize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_v_count, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_6 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
                __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
                if (likely(__pyx_t_6)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                  __Pyx_INCREF(__pyx_t_6);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_10, function);
                }
              }
              if (!__pyx_t_6) {
                __pyx_t_24 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_14); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_GOTREF(__pyx_t_24);
              } else {
                __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_22);
                __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_6); __pyx_t_6 = NULL;
                __Pyx_GIVEREF(__pyx_t_14);
                PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_14);
                __pyx_t_14 = 0;
                __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_22, NULL); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_24);
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
              }
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":530
 *                                 count = len(data[selected_mass[ispec]])
 *                                 data[selected_mass[ispec]].resize(count+1)
 *                                 data[selected_mass[ispec]][count] = self.parameters["particle_species_mass"][ispec]             # <<<<<<<<<<<<<<
 * 
 *                     status = artio_particle_read_species_end( self.handle )
 */
              __pyx_t_24 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_particle_species_mass); if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_24);
              __pyx_t_10 = PyObject_GetItem(__pyx_t_24, __pyx_v_ispec); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              __pyx_t_24 = PyObject_GetItem(__pyx_v_selected_mass, __pyx_v_ispec); if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_24);
              __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_24); if (unlikely(__pyx_t_22 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
              __Pyx_GOTREF(__pyx_t_22);
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              if (unlikely(PyObject_SetItem(__pyx_t_22, __pyx_v_count, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":527
 * 
 *                             # add mass if requested
 *                             if selected_mass[ispec] :             # <<<<<<<<<<<<<<
 *                                 count = len(data[selected_mass[ispec]])
 *                                 data[selected_mass[ispec]].resize(count+1)
 */
            }

            /* "yt/frontends/artio/_artio_caller.pyx":507
 *                             pos[i] = self.primary_variables[self.particle_position_index[3*ispec+i]]
 * 
 *                         if selector.select_point(pos) :             # <<<<<<<<<<<<<<
 *                             # loop over primary variables
 *                             for i,field in selected_primary[ispec] :
 */
          }

          /* "yt/frontends/artio/_artio_caller.pyx":498
 *                     check_artio_status(status)
 * 
 *                     for particle in range( self.num_particles_per_species[ispec] ) :             # <<<<<<<<<<<<<<
 *                         status = artio_particle_read_particle(self.handle,
 *                                 &pid, &subspecies, self.primary_variables,
 */
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "yt/frontends/artio/_artio_caller.pyx":532
 *                                 data[selected_mass[ispec]][count] = self.parameters["particle_species_mass"][ispec]
 * 
 *                     status = artio_particle_read_species_end( self.handle )             # <<<<<<<<<<<<<<
 *                     check_artio_status(status)
 * 
 */
        __pyx_v_status = artio_particle_read_species_end(__pyx_v_self->handle);

        /* "yt/frontends/artio/_artio_caller.pyx":533
 * 
 *                     status = artio_particle_read_species_end( self.handle )
 *                     check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *             status = artio_particle_read_root_cell_end( self.handle )
 */
        __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

        /* "yt/frontends/artio/_artio_caller.pyx":494
 * 
 *             for ispec in range(self.num_species) :
 *                 if accessed_species[ispec] :             # <<<<<<<<<<<<<<
 *                     status = artio_particle_read_species_begin(self.handle, ispec)
 *                     check_artio_status(status)
 */
      }

      /* "yt/frontends/artio/_artio_caller.pyx":493
 *             check_artio_status(status)
 * 
 *             for ispec in range(self.num_species) :             # <<<<<<<<<<<<<<
 *                 if accessed_species[ispec] :
 *                     status = artio_particle_read_species_begin(self.handle, ispec)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":535
 *                     check_artio_status(status)
 * 
 *             status = artio_particle_read_root_cell_end( self.handle )             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 * 
 */
    __pyx_v_status = artio_particle_read_root_cell_end(__pyx_v_self->handle);

    /* "yt/frontends/artio/_artio_caller.pyx":536
 * 
 *             status = artio_particle_read_root_cell_end( self.handle )
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *         return data
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":538
 *             check_artio_status(status)
 * 
 *         return data             # <<<<<<<<<<<<<<
 * 
 *     #@cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_data);
  __pyx_r = __pyx_v_data;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":438
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def read_particle_chunk(self, SelectorObject selector, int64_t sfc_start, int64_t sfc_end, fields) :             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef int status
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.read_particle_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_accessed_species);
  __Pyx_XDECREF(__pyx_v_selected_mass);
  __Pyx_XDECREF(__pyx_v_selected_pid);
  __Pyx_XDECREF(__pyx_v_selected_species);
  __Pyx_XDECREF(__pyx_v_selected_primary);
  __Pyx_XDECREF(__pyx_v_selected_secondary);
  __Pyx_XDECREF(__pyx_v_species);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_ispec);
  __Pyx_XDECREF(__pyx_v_particle);
  __Pyx_XDECREF(__pyx_v_count);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":543
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def read_grid_chunk(self, SelectorObject selector, int64_t sfc_start, int64_t sfc_end, fields ):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef int level
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_33read_grid_chunk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_33read_grid_chunk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  int64_t __pyx_v_sfc_start;
  int64_t __pyx_v_sfc_end;
  PyObject *__pyx_v_fields = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_grid_chunk (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_sfc_start,&__pyx_n_s_sfc_end,&__pyx_n_s_fields,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_start)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_grid_chunk", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_end)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_grid_chunk", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_grid_chunk", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_grid_chunk") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    __pyx_v_sfc_start = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_sfc_start == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_sfc_end = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_sfc_end == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fields = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_grid_chunk", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.read_grid_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_32read_grid_chunk(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), __pyx_v_selector, __pyx_v_sfc_start, __pyx_v_sfc_end, __pyx_v_fields);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_32read_grid_chunk(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int64_t __pyx_v_sfc_start, int64_t __pyx_v_sfc_end, PyObject *__pyx_v_fields) {
  int __pyx_v_i;
  int __pyx_v_level;
  int __pyx_v_num_oct_levels;
  int __pyx_v_refined[8];
  int __pyx_v_status;
  int64_t __pyx_v_count;
  double __pyx_v_dpos[3];
  __pyx_t_5numpy_float64_t __pyx_v_left[3];
  __pyx_t_5numpy_float64_t __pyx_v_right[3];
  __pyx_t_5numpy_float64_t __pyx_v_dds[3];
  int *__pyx_v_field_order;
  int __pyx_v_num_fields;
  PyObject *__pyx_v_var_labels = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_fcoords = NULL;
  PyObject *__pyx_v_ires = NULL;
  PyObject *__pyx_v_data = NULL;
  int64_t __pyx_v_sfc;
  CYTHON_UNUSED int __pyx_v_oct;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int64_t __pyx_t_12;
  int64_t __pyx_t_13;
  long __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  __pyx_t_5numpy_float64_t __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_grid_chunk", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":557
 * 
 *         cdef int *field_order
 *         cdef int num_fields  = len(fields)             # <<<<<<<<<<<<<<
 *         field_order = <int*>malloc(sizeof(int)*num_fields)
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_num_fields = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":558
 *         cdef int *field_order
 *         cdef int num_fields  = len(fields)
 *         field_order = <int*>malloc(sizeof(int)*num_fields)             # <<<<<<<<<<<<<<
 * 
 *         # translate fields from ARTIO names to indices
 */
  __pyx_v_field_order = ((int *)malloc(((sizeof(int)) * __pyx_v_num_fields)));

  /* "yt/frontends/artio/_artio_caller.pyx":561
 * 
 *         # translate fields from ARTIO names to indices
 *         var_labels = self.parameters['grid_variable_labels']             # <<<<<<<<<<<<<<
 *         for i, f in enumerate(fields):
 *             if f not in var_labels:
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_v_self->parameters, __pyx_n_s_grid_variable_labels); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_var_labels = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":562
 *         # translate fields from ARTIO names to indices
 *         var_labels = self.parameters['grid_variable_labels']
 *         for i, f in enumerate(fields):             # <<<<<<<<<<<<<<
 *             if f not in var_labels:
 *                 raise RuntimeError("Field",f,"is not known to ARTIO")
 */
  __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = (__pyx_t_3 + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":563
 *         var_labels = self.parameters['grid_variable_labels']
 *         for i, f in enumerate(fields):
 *             if f not in var_labels:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Field",f,"is not known to ARTIO")
 *             field_order[i] = var_labels.index(f)
 */
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_f, __pyx_v_var_labels, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {

      /* "yt/frontends/artio/_artio_caller.pyx":564
 *         for i, f in enumerate(fields):
 *             if f not in var_labels:
 *                 raise RuntimeError("Field",f,"is not known to ARTIO")             # <<<<<<<<<<<<<<
 *             field_order[i] = var_labels.index(f)
 * 
 */
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_n_s_Field);
      __Pyx_GIVEREF(__pyx_n_s_Field);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_Field);
      __Pyx_INCREF(__pyx_v_f);
      __Pyx_GIVEREF(__pyx_v_f);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_f);
      __Pyx_INCREF(__pyx_kp_s_is_not_known_to_ARTIO);
      __Pyx_GIVEREF(__pyx_kp_s_is_not_known_to_ARTIO);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_s_is_not_known_to_ARTIO);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "yt/frontends/artio/_artio_caller.pyx":563
 *         var_labels = self.parameters['grid_variable_labels']
 *         for i, f in enumerate(fields):
 *             if f not in var_labels:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Field",f,"is not known to ARTIO")
 *             field_order[i] = var_labels.index(f)
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":565
 *             if f not in var_labels:
 *                 raise RuntimeError("Field",f,"is not known to ARTIO")
 *             field_order[i] = var_labels.index(f)             # <<<<<<<<<<<<<<
 * 
 *         status = artio_grid_cache_sfc_range( self.handle, self.sfc_min, self.sfc_max )
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_var_labels, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_f); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_f);
      __Pyx_GIVEREF(__pyx_v_f);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_f);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    (__pyx_v_field_order[__pyx_v_i]) = __pyx_t_11;

    /* "yt/frontends/artio/_artio_caller.pyx":562
 *         # translate fields from ARTIO names to indices
 *         var_labels = self.parameters['grid_variable_labels']
 *         for i, f in enumerate(fields):             # <<<<<<<<<<<<<<
 *             if f not in var_labels:
 *                 raise RuntimeError("Field",f,"is not known to ARTIO")
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":567
 *             field_order[i] = var_labels.index(f)
 * 
 *         status = artio_grid_cache_sfc_range( self.handle, self.sfc_min, self.sfc_max )             # <<<<<<<<<<<<<<
 *         check_artio_status(status)
 * 
 */
  __pyx_v_status = artio_grid_cache_sfc_range(__pyx_v_self->handle, __pyx_v_self->sfc_min, __pyx_v_self->sfc_max);

  /* "yt/frontends/artio/_artio_caller.pyx":568
 * 
 *         status = artio_grid_cache_sfc_range( self.handle, self.sfc_min, self.sfc_max )
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *         # determine max number of cells we could hit (optimize later)
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":579
 *         #fcoords = np.empty((max_cells, 3), dtype="float64")
 *         #ires = np.empty(max_cells, dtype="int64")
 *         fcoords = np.empty((0, 3), dtype="float64")             # <<<<<<<<<<<<<<
 *         ires = np.empty(0, dtype="int64")
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__25, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fcoords = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":580
 *         #ires = np.empty(max_cells, dtype="int64")
 *         fcoords = np.empty((0, 3), dtype="float64")
 *         ires = np.empty(0, dtype="int64")             # <<<<<<<<<<<<<<
 * 
 *         #data = [ np.empty(max_cells, dtype="float32") for i in range(num_fields) ]
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_ires = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":583
 * 
 *         #data = [ np.empty(max_cells, dtype="float32") for i in range(num_fields) ]
 *         data = [ np.empty(0,dtype="float64") for i in range(num_fields)]             # <<<<<<<<<<<<<<
 * 
 *         count = 0
 */
  __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __pyx_v_num_fields;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_3; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_v_data = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":585
 *         data = [ np.empty(0,dtype="float64") for i in range(num_fields)]
 * 
 *         count = 0             # <<<<<<<<<<<<<<
 *         for sfc in range( sfc_start, sfc_end+1 ) :
 *             status = artio_grid_read_root_cell_begin( self.handle, sfc,
 */
  __pyx_v_count = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":586
 * 
 *         count = 0
 *         for sfc in range( sfc_start, sfc_end+1 ) :             # <<<<<<<<<<<<<<
 *             status = artio_grid_read_root_cell_begin( self.handle, sfc,
 *                     dpos, self.grid_variables, &num_oct_levels, self.num_octs_per_level )
 */
  __pyx_t_12 = (__pyx_v_sfc_end + 1);
  for (__pyx_t_13 = __pyx_v_sfc_start; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_sfc = __pyx_t_13;

    /* "yt/frontends/artio/_artio_caller.pyx":587
 *         count = 0
 *         for sfc in range( sfc_start, sfc_end+1 ) :
 *             status = artio_grid_read_root_cell_begin( self.handle, sfc,             # <<<<<<<<<<<<<<
 *                     dpos, self.grid_variables, &num_oct_levels, self.num_octs_per_level )
 *             check_artio_status(status)
 */
    __pyx_v_status = artio_grid_read_root_cell_begin(__pyx_v_self->handle, __pyx_v_sfc, __pyx_v_dpos, __pyx_v_self->grid_variables, (&__pyx_v_num_oct_levels), __pyx_v_self->num_octs_per_level);

    /* "yt/frontends/artio/_artio_caller.pyx":589
 *             status = artio_grid_read_root_cell_begin( self.handle, sfc,
 *                     dpos, self.grid_variables, &num_oct_levels, self.num_octs_per_level )
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *             if num_oct_levels == 0 :
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":591
 *             check_artio_status(status)
 * 
 *             if num_oct_levels == 0 :             # <<<<<<<<<<<<<<
 *                 for i in range(num_fields) :
 *                     data[i].resize(count+1)
 */
    __pyx_t_7 = ((__pyx_v_num_oct_levels == 0) != 0);
    if (__pyx_t_7) {

      /* "yt/frontends/artio/_artio_caller.pyx":592
 * 
 *             if num_oct_levels == 0 :
 *                 for i in range(num_fields) :             # <<<<<<<<<<<<<<
 *                     data[i].resize(count+1)
 *                     data[i][count] = self.grid_variables[field_order[i]]
 */
      __pyx_t_3 = __pyx_v_num_fields;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_3; __pyx_t_11+=1) {
        __pyx_v_i = __pyx_t_11;

        /* "yt/frontends/artio/_artio_caller.pyx":593
 *             if num_oct_levels == 0 :
 *                 for i in range(num_fields) :
 *                     data[i].resize(count+1)             # <<<<<<<<<<<<<<
 *                     data[i][count] = self.grid_variables[field_order[i]]
 *                 fcoords.resize((count+1,3))
 */
        __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_data, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyInt_From_int64_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (!__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10);
          __pyx_t_10 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "yt/frontends/artio/_artio_caller.pyx":594
 *                 for i in range(num_fields) :
 *                     data[i].resize(count+1)
 *                     data[i][count] = self.grid_variables[field_order[i]]             # <<<<<<<<<<<<<<
 *                 fcoords.resize((count+1,3))
 *                 for i in range(3) :
 */
        __pyx_t_8 = PyFloat_FromDouble((__pyx_v_self->grid_variables[(__pyx_v_field_order[__pyx_v_i])])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_data, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_count, __pyx_t_8, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "yt/frontends/artio/_artio_caller.pyx":595
 *                     data[i].resize(count+1)
 *                     data[i][count] = self.grid_variables[field_order[i]]
 *                 fcoords.resize((count+1,3))             # <<<<<<<<<<<<<<
 *                 for i in range(3) :
 *                     fcoords[count][i] = dpos[i]
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fcoords, __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyInt_From_int64_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
      __Pyx_INCREF(__pyx_int_3);
      __Pyx_GIVEREF(__pyx_int_3);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_3);
      __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":596
 *                     data[i][count] = self.grid_variables[field_order[i]]
 *                 fcoords.resize((count+1,3))
 *                 for i in range(3) :             # <<<<<<<<<<<<<<
 *                     fcoords[count][i] = dpos[i]
 *                 ires.resize(count+1)
 */
      for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) {
        __pyx_v_i = __pyx_t_3;

        /* "yt/frontends/artio/_artio_caller.pyx":597
 *                 fcoords.resize((count+1,3))
 *                 for i in range(3) :
 *                     fcoords[count][i] = dpos[i]             # <<<<<<<<<<<<<<
 *                 ires.resize(count+1)
 *                 ires[count] = 0
 */
        __pyx_t_8 = PyFloat_FromDouble((__pyx_v_dpos[__pyx_v_i])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_fcoords, __pyx_v_count, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_i, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "yt/frontends/artio/_artio_caller.pyx":598
 *                 for i in range(3) :
 *                     fcoords[count][i] = dpos[i]
 *                 ires.resize(count+1)             # <<<<<<<<<<<<<<
 *                 ires[count] = 0
 *                 count += 1
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ires, __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyInt_From_int64_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL;
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":599
 *                     fcoords[count][i] = dpos[i]
 *                 ires.resize(count+1)
 *                 ires[count] = 0             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__Pyx_SetItemInt(__pyx_v_ires, __pyx_v_count, __pyx_int_0, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "yt/frontends/artio/_artio_caller.pyx":600
 *                 ires.resize(count+1)
 *                 ires[count] = 0
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             for level in range(1,num_oct_levels+1) :
 */
      __pyx_v_count = (__pyx_v_count + 1);

      /* "yt/frontends/artio/_artio_caller.pyx":591
 *             check_artio_status(status)
 * 
 *             if num_oct_levels == 0 :             # <<<<<<<<<<<<<<
 *                 for i in range(num_fields) :
 *                     data[i].resize(count+1)
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":602
 *                 count += 1
 * 
 *             for level in range(1,num_oct_levels+1) :             # <<<<<<<<<<<<<<
 *                 status = artio_grid_read_level_begin( self.handle, level )
 *                 check_artio_status(status)
 */
    __pyx_t_14 = (__pyx_v_num_oct_levels + 1);
    for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_14; __pyx_t_3+=1) {
      __pyx_v_level = __pyx_t_3;

      /* "yt/frontends/artio/_artio_caller.pyx":603
 * 
 *             for level in range(1,num_oct_levels+1) :
 *                 status = artio_grid_read_level_begin( self.handle, level )             # <<<<<<<<<<<<<<
 *                 check_artio_status(status)
 * 
 */
      __pyx_v_status = artio_grid_read_level_begin(__pyx_v_self->handle, __pyx_v_level);

      /* "yt/frontends/artio/_artio_caller.pyx":604
 *             for level in range(1,num_oct_levels+1) :
 *                 status = artio_grid_read_level_begin( self.handle, level )
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(3) :
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

      /* "yt/frontends/artio/_artio_caller.pyx":606
 *                 check_artio_status(status)
 * 
 *                 for i in range(3) :             # <<<<<<<<<<<<<<
 *                     dds[i] = 2.**-level
 * 
 */
      for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) {
        __pyx_v_i = __pyx_t_11;

        /* "yt/frontends/artio/_artio_caller.pyx":607
 * 
 *                 for i in range(3) :
 *                     dds[i] = 2.**-level             # <<<<<<<<<<<<<<
 * 
 *                 for oct in range(self.num_octs_per_level[level-1]) :
 */
        (__pyx_v_dds[__pyx_v_i]) = pow(2., ((double)(-__pyx_v_level)));
      }

      /* "yt/frontends/artio/_artio_caller.pyx":609
 *                     dds[i] = 2.**-level
 * 
 *                 for oct in range(self.num_octs_per_level[level-1]) :             # <<<<<<<<<<<<<<
 *                     status = artio_grid_read_oct( self.handle, dpos, self.grid_variables, refined )
 *                     check_artio_status(status)
 */
      __pyx_t_11 = (__pyx_v_self->num_octs_per_level[(__pyx_v_level - 1)]);
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_11; __pyx_t_15+=1) {
        __pyx_v_oct = __pyx_t_15;

        /* "yt/frontends/artio/_artio_caller.pyx":610
 * 
 *                 for oct in range(self.num_octs_per_level[level-1]) :
 *                     status = artio_grid_read_oct( self.handle, dpos, self.grid_variables, refined )             # <<<<<<<<<<<<<<
 *                     check_artio_status(status)
 * 
 */
        __pyx_v_status = artio_grid_read_oct(__pyx_v_self->handle, __pyx_v_dpos, __pyx_v_self->grid_variables, __pyx_v_refined);

        /* "yt/frontends/artio/_artio_caller.pyx":611
 *                 for oct in range(self.num_octs_per_level[level-1]) :
 *                     status = artio_grid_read_oct( self.handle, dpos, self.grid_variables, refined )
 *                     check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *                     for child in range(8) :
 */
        __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

        /* "yt/frontends/artio/_artio_caller.pyx":613
 *                     check_artio_status(status)
 * 
 *                     for child in range(8) :             # <<<<<<<<<<<<<<
 *                         if not refined[child] :
 *                             for i in range(3) :
 */
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
          __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
          __pyx_t_4 = NULL;
        } else {
          __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        for (;;) {
          if (likely(!__pyx_t_4)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            } else {
              if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            }
          } else {
            __pyx_t_8 = __pyx_t_4(__pyx_t_5);
            if (unlikely(!__pyx_t_8)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "yt/frontends/artio/_artio_caller.pyx":614
 * 
 *                     for child in range(8) :
 *                         if not refined[child] :             # <<<<<<<<<<<<<<
 *                             for i in range(3) :
 *                                 left[i] = (dpos[i]-dds[i]) if (child & (i<<1)) else dpos[i]
 */
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_child); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_7 = ((!((__pyx_v_refined[__pyx_t_16]) != 0)) != 0);
          if (__pyx_t_7) {

            /* "yt/frontends/artio/_artio_caller.pyx":615
 *                     for child in range(8) :
 *                         if not refined[child] :
 *                             for i in range(3) :             # <<<<<<<<<<<<<<
 *                                 left[i] = (dpos[i]-dds[i]) if (child & (i<<1)) else dpos[i]
 *                                 right[i] = left[i] + dds[i]
 */
            for (__pyx_t_17 = 0; __pyx_t_17 < 3; __pyx_t_17+=1) {
              __pyx_v_i = __pyx_t_17;

              /* "yt/frontends/artio/_artio_caller.pyx":616
 *                         if not refined[child] :
 *                             for i in range(3) :
 *                                 left[i] = (dpos[i]-dds[i]) if (child & (i<<1)) else dpos[i]             # <<<<<<<<<<<<<<
 *                                 right[i] = left[i] + dds[i]
 * 
 */
              __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_i << 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyNumber_And(__pyx_v_child, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_7) {
                __pyx_t_18 = ((__pyx_v_dpos[__pyx_v_i]) - (__pyx_v_dds[__pyx_v_i]));
              } else {
                __pyx_t_18 = (__pyx_v_dpos[__pyx_v_i]);
              }
              (__pyx_v_left[__pyx_v_i]) = __pyx_t_18;

              /* "yt/frontends/artio/_artio_caller.pyx":617
 *                             for i in range(3) :
 *                                 left[i] = (dpos[i]-dds[i]) if (child & (i<<1)) else dpos[i]
 *                                 right[i] = left[i] + dds[i]             # <<<<<<<<<<<<<<
 * 
 *                             if selector.select_bbox(left,right) :
 */
              (__pyx_v_right[__pyx_v_i]) = ((__pyx_v_left[__pyx_v_i]) + (__pyx_v_dds[__pyx_v_i]));
            }

            /* "yt/frontends/artio/_artio_caller.pyx":619
 *                                 right[i] = left[i] + dds[i]
 * 
 *                             if selector.select_bbox(left,right) :             # <<<<<<<<<<<<<<
 *                                 fcoords.resize((count+1, 3))
 *                                 for i in range(3) :
 */
            __pyx_t_7 = (((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->select_bbox(__pyx_v_selector, __pyx_v_left, __pyx_v_right) != 0);
            if (__pyx_t_7) {

              /* "yt/frontends/artio/_artio_caller.pyx":620
 * 
 *                             if selector.select_bbox(left,right) :
 *                                 fcoords.resize((count+1, 3))             # <<<<<<<<<<<<<<
 *                                 for i in range(3) :
 *                                     fcoords[count][i] = left[i]+0.5*dds[i]
 */
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_fcoords, __pyx_n_s_resize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_2 = __Pyx_PyInt_From_int64_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
              __Pyx_INCREF(__pyx_int_3);
              __Pyx_GIVEREF(__pyx_int_3);
              PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_3);
              __pyx_t_2 = 0;
              __pyx_t_2 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
                __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
                if (likely(__pyx_t_2)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
                  __Pyx_INCREF(__pyx_t_2);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_8, function);
                }
              }
              if (!__pyx_t_2) {
                __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __Pyx_GOTREF(__pyx_t_9);
              } else {
                __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2); __pyx_t_2 = NULL;
                __Pyx_GIVEREF(__pyx_t_10);
                PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_10);
                __pyx_t_10 = 0;
                __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_19, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              }
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":621
 *                             if selector.select_bbox(left,right) :
 *                                 fcoords.resize((count+1, 3))
 *                                 for i in range(3) :             # <<<<<<<<<<<<<<
 *                                     fcoords[count][i] = left[i]+0.5*dds[i]
 *                                 ires.resize(count+1)
 */
              for (__pyx_t_17 = 0; __pyx_t_17 < 3; __pyx_t_17+=1) {
                __pyx_v_i = __pyx_t_17;

                /* "yt/frontends/artio/_artio_caller.pyx":622
 *                                 fcoords.resize((count+1, 3))
 *                                 for i in range(3) :
 *                                     fcoords[count][i] = left[i]+0.5*dds[i]             # <<<<<<<<<<<<<<
 *                                 ires.resize(count+1)
 *                                 ires[count] = level
 */
                __pyx_t_9 = PyFloat_FromDouble(((__pyx_v_left[__pyx_v_i]) + (0.5 * (__pyx_v_dds[__pyx_v_i])))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_fcoords, __pyx_v_count, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
                __Pyx_GOTREF(__pyx_t_8);
                if (unlikely(__Pyx_SetItemInt(__pyx_t_8, __pyx_v_i, __pyx_t_9, int, 1, __Pyx_PyInt_From_int, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              }

              /* "yt/frontends/artio/_artio_caller.pyx":623
 *                                 for i in range(3) :
 *                                     fcoords[count][i] = left[i]+0.5*dds[i]
 *                                 ires.resize(count+1)             # <<<<<<<<<<<<<<
 *                                 ires[count] = level
 *                                 for i in range(num_fields) :
 */
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_ires, __pyx_n_s_resize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_19 = __Pyx_PyInt_From_int64_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_19);
              __pyx_t_10 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
                __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
                if (likely(__pyx_t_10)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
                  __Pyx_INCREF(__pyx_t_10);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_8, function);
                }
              }
              if (!__pyx_t_10) {
                __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_GOTREF(__pyx_t_9);
              } else {
                __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
                __Pyx_GIVEREF(__pyx_t_19);
                PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_19);
                __pyx_t_19 = 0;
                __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              }
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":624
 *                                     fcoords[count][i] = left[i]+0.5*dds[i]
 *                                 ires.resize(count+1)
 *                                 ires[count] = level             # <<<<<<<<<<<<<<
 *                                 for i in range(num_fields) :
 *                                     data[i].resize(count+1)
 */
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_level); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (unlikely(__Pyx_SetItemInt(__pyx_v_ires, __pyx_v_count, __pyx_t_9, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "yt/frontends/artio/_artio_caller.pyx":625
 *                                 ires.resize(count+1)
 *                                 ires[count] = level
 *                                 for i in range(num_fields) :             # <<<<<<<<<<<<<<
 *                                     data[i].resize(count+1)
 *                                     data[i][count] = self.grid_variables[self.num_grid_variables*child+field_order[i]]
 */
              __pyx_t_17 = __pyx_v_num_fields;
              for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_17; __pyx_t_20+=1) {
                __pyx_v_i = __pyx_t_20;

                /* "yt/frontends/artio/_artio_caller.pyx":626
 *                                 ires[count] = level
 *                                 for i in range(num_fields) :
 *                                     data[i].resize(count+1)             # <<<<<<<<<<<<<<
 *                                     data[i][count] = self.grid_variables[self.num_grid_variables*child+field_order[i]]
 *                                 count += 1
 */
                __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_data, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
                __Pyx_GOTREF(__pyx_t_8);
                __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __pyx_t_8 = __Pyx_PyInt_From_int64_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_8);
                __pyx_t_19 = NULL;
                if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
                  __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_2);
                  if (likely(__pyx_t_19)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                    __Pyx_INCREF(__pyx_t_19);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_2, function);
                  }
                }
                if (!__pyx_t_19) {
                  __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __Pyx_GOTREF(__pyx_t_9);
                } else {
                  __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_10);
                  __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_19); __pyx_t_19 = NULL;
                  __Pyx_GIVEREF(__pyx_t_8);
                  PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8);
                  __pyx_t_8 = 0;
                  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_9);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                }
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

                /* "yt/frontends/artio/_artio_caller.pyx":627
 *                                 for i in range(num_fields) :
 *                                     data[i].resize(count+1)
 *                                     data[i][count] = self.grid_variables[self.num_grid_variables*child+field_order[i]]             # <<<<<<<<<<<<<<
 *                                 count += 1
 *                 status = artio_grid_read_level_end( self.handle )
 */
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->num_grid_variables); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_2 = PyNumber_Multiply(__pyx_t_9, __pyx_v_child); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int((__pyx_v_field_order[__pyx_v_i])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->grid_variables[__pyx_t_16])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_data, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
                __Pyx_GOTREF(__pyx_t_9);
                if (unlikely(__Pyx_SetItemInt(__pyx_t_9, __pyx_v_count, __pyx_t_10, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              }

              /* "yt/frontends/artio/_artio_caller.pyx":628
 *                                     data[i].resize(count+1)
 *                                     data[i][count] = self.grid_variables[self.num_grid_variables*child+field_order[i]]
 *                                 count += 1             # <<<<<<<<<<<<<<
 *                 status = artio_grid_read_level_end( self.handle )
 *                 check_artio_status(status)
 */
              __pyx_v_count = (__pyx_v_count + 1);

              /* "yt/frontends/artio/_artio_caller.pyx":619
 *                                 right[i] = left[i] + dds[i]
 * 
 *                             if selector.select_bbox(left,right) :             # <<<<<<<<<<<<<<
 *                                 fcoords.resize((count+1, 3))
 *                                 for i in range(3) :
 */
            }

            /* "yt/frontends/artio/_artio_caller.pyx":614
 * 
 *                     for child in range(8) :
 *                         if not refined[child] :             # <<<<<<<<<<<<<<
 *                             for i in range(3) :
 *                                 left[i] = (dpos[i]-dds[i]) if (child & (i<<1)) else dpos[i]
 */
          }

          /* "yt/frontends/artio/_artio_caller.pyx":613
 *                     check_artio_status(status)
 * 
 *                     for child in range(8) :             # <<<<<<<<<<<<<<
 *                         if not refined[child] :
 *                             for i in range(3) :
 */
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }

      /* "yt/frontends/artio/_artio_caller.pyx":629
 *                                     data[i][count] = self.grid_variables[self.num_grid_variables*child+field_order[i]]
 *                                 count += 1
 *                 status = artio_grid_read_level_end( self.handle )             # <<<<<<<<<<<<<<
 *                 check_artio_status(status)
 * 
 */
      __pyx_v_status = artio_grid_read_level_end(__pyx_v_self->handle);

      /* "yt/frontends/artio/_artio_caller.pyx":630
 *                                 count += 1
 *                 status = artio_grid_read_level_end( self.handle )
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *             status = artio_grid_read_root_cell_end( self.handle )
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":632
 *                 check_artio_status(status)
 * 
 *             status = artio_grid_read_root_cell_end( self.handle )             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 * 
 */
    __pyx_v_status = artio_grid_read_root_cell_end(__pyx_v_self->handle);

    /* "yt/frontends/artio/_artio_caller.pyx":633
 * 
 *             status = artio_grid_read_root_cell_end( self.handle )
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *         free(field_order)
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":635
 *             check_artio_status(status)
 * 
 *         free(field_order)             # <<<<<<<<<<<<<<
 * 
 *         #fcoords.resize((count,3))
 */
  free(__pyx_v_field_order);

  /* "yt/frontends/artio/_artio_caller.pyx":643
 *         #    data[i].resize(count)
 * 
 *         return (fcoords, ires, data)             # <<<<<<<<<<<<<<
 * 
 *     def root_sfc_ranges_all(self, int max_range_size = 1024) :
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_fcoords);
  __Pyx_GIVEREF(__pyx_v_fcoords);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fcoords);
  __Pyx_INCREF(__pyx_v_ires);
  __Pyx_GIVEREF(__pyx_v_ires);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ires);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_data);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":543
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def read_grid_chunk(self, SelectorObject selector, int64_t sfc_start, int64_t sfc_end, fields ):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef int level
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.read_grid_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_var_labels);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fcoords);
  __Pyx_XDECREF(__pyx_v_ires);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":645
 *         return (fcoords, ires, data)
 * 
 *     def root_sfc_ranges_all(self, int max_range_size = 1024) :             # <<<<<<<<<<<<<<
 *         cdef int64_t sfc_start, sfc_end
 *         cdef artio_selection *selection
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_35root_sfc_ranges_all(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_35root_sfc_ranges_all(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_max_range_size;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("root_sfc_ranges_all (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_range_size,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_range_size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "root_sfc_ranges_all") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_max_range_size = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_max_range_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_max_range_size = ((int)1024);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("root_sfc_ranges_all", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.root_sfc_ranges_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_34root_sfc_ranges_all(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), __pyx_v_max_range_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_34root_sfc_ranges_all(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, int __pyx_v_max_range_size) {
  int64_t __pyx_v_sfc_start;
  int64_t __pyx_v_sfc_end;
  artio_selection *__pyx_v_selection;
  PyObject *__pyx_v_sfc_ranges = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("root_sfc_ranges_all", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":649
 *         cdef artio_selection *selection
 * 
 *         selection = artio_select_all( self.handle )             # <<<<<<<<<<<<<<
 *         if selection == NULL :
 *             raise RuntimeError
 */
  __pyx_v_selection = artio_select_all(__pyx_v_self->handle);

  /* "yt/frontends/artio/_artio_caller.pyx":650
 * 
 *         selection = artio_select_all( self.handle )
 *         if selection == NULL :             # <<<<<<<<<<<<<<
 *             raise RuntimeError
 *         sfc_ranges = []
 */
  __pyx_t_1 = ((__pyx_v_selection == NULL) != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":651
 *         selection = artio_select_all( self.handle )
 *         if selection == NULL :
 *             raise RuntimeError             # <<<<<<<<<<<<<<
 *         sfc_ranges = []
 *         while artio_selection_iterator(selection, max_range_size,
 */
    __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":650
 * 
 *         selection = artio_select_all( self.handle )
 *         if selection == NULL :             # <<<<<<<<<<<<<<
 *             raise RuntimeError
 *         sfc_ranges = []
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":652
 *         if selection == NULL :
 *             raise RuntimeError
 *         sfc_ranges = []             # <<<<<<<<<<<<<<
 *         while artio_selection_iterator(selection, max_range_size,
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_sfc_ranges = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":653
 *             raise RuntimeError
 *         sfc_ranges = []
 *         while artio_selection_iterator(selection, max_range_size,             # <<<<<<<<<<<<<<
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :
 *             sfc_ranges.append([sfc_start, sfc_end])
 */
  while (1) {

    /* "yt/frontends/artio/_artio_caller.pyx":654
 *         sfc_ranges = []
 *         while artio_selection_iterator(selection, max_range_size,
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :             # <<<<<<<<<<<<<<
 *             sfc_ranges.append([sfc_start, sfc_end])
 *         artio_selection_destroy(selection)
 */
    __pyx_t_1 = ((artio_selection_iterator(__pyx_v_selection, __pyx_v_max_range_size, (&__pyx_v_sfc_start), (&__pyx_v_sfc_end)) == ARTIO_SUCCESS) != 0);
    if (!__pyx_t_1) break;

    /* "yt/frontends/artio/_artio_caller.pyx":655
 *         while artio_selection_iterator(selection, max_range_size,
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :
 *             sfc_ranges.append([sfc_start, sfc_end])             # <<<<<<<<<<<<<<
 *         artio_selection_destroy(selection)
 *         return sfc_ranges
 */
    __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_sfc_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_sfc_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_sfc_ranges, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":656
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :
 *             sfc_ranges.append([sfc_start, sfc_end])
 *         artio_selection_destroy(selection)             # <<<<<<<<<<<<<<
 *         return sfc_ranges
 * 
 */
  artio_selection_destroy(__pyx_v_selection);

  /* "yt/frontends/artio/_artio_caller.pyx":657
 *             sfc_ranges.append([sfc_start, sfc_end])
 *         artio_selection_destroy(selection)
 *         return sfc_ranges             # <<<<<<<<<<<<<<
 * 
 *     def root_sfc_ranges(self, SelectorObject selector,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_sfc_ranges);
  __pyx_r = __pyx_v_sfc_ranges;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":645
 *         return (fcoords, ires, data)
 * 
 *     def root_sfc_ranges_all(self, int max_range_size = 1024) :             # <<<<<<<<<<<<<<
 *         cdef int64_t sfc_start, sfc_end
 *         cdef artio_selection *selection
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.root_sfc_ranges_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sfc_ranges);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":659
 *         return sfc_ranges
 * 
 *     def root_sfc_ranges(self, SelectorObject selector,             # <<<<<<<<<<<<<<
 *                         int max_range_size = 1024):
 *         cdef int coords[3]
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_37root_sfc_ranges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_37root_sfc_ranges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  int __pyx_v_max_range_size;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("root_sfc_ranges (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_max_range_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_range_size);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "root_sfc_ranges") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    if (values[1]) {
      __pyx_v_max_range_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_max_range_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_max_range_size = ((int)1024);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("root_sfc_ranges", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.root_sfc_ranges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_36root_sfc_ranges(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), __pyx_v_selector, __pyx_v_max_range_size);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_36root_sfc_ranges(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_max_range_size) {
  int __pyx_v_coords[3];
  int64_t __pyx_v_sfc_start;
  int64_t __pyx_v_sfc_end;
  __pyx_t_5numpy_float64_t __pyx_v_left[3];
  __pyx_t_5numpy_float64_t __pyx_v_right[3];
  artio_selection *__pyx_v_selection;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  PyObject *__pyx_v_sfc_ranges = NULL;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  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;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("root_sfc_ranges", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":669
 *         cdef int i, j, k
 * 
 *         sfc_ranges=[]             # <<<<<<<<<<<<<<
 *         selection = artio_selection_allocate(self.handle)
 *         for i in range(self.num_grid) :
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sfc_ranges = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":670
 * 
 *         sfc_ranges=[]
 *         selection = artio_selection_allocate(self.handle)             # <<<<<<<<<<<<<<
 *         for i in range(self.num_grid) :
 *             # stupid cython
 */
  __pyx_v_selection = artio_selection_allocate(__pyx_v_self->handle);

  /* "yt/frontends/artio/_artio_caller.pyx":671
 *         sfc_ranges=[]
 *         selection = artio_selection_allocate(self.handle)
 *         for i in range(self.num_grid) :             # <<<<<<<<<<<<<<
 *             # stupid cython
 *             coords[0] = i
 */
  __pyx_t_2 = __pyx_v_self->num_grid;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "yt/frontends/artio/_artio_caller.pyx":673
 *         for i in range(self.num_grid) :
 *             # stupid cython
 *             coords[0] = i             # <<<<<<<<<<<<<<
 *             left[0] = coords[0]
 *             right[0] = left[0] + 1.0
 */
    (__pyx_v_coords[0]) = __pyx_v_i;

    /* "yt/frontends/artio/_artio_caller.pyx":674
 *             # stupid cython
 *             coords[0] = i
 *             left[0] = coords[0]             # <<<<<<<<<<<<<<
 *             right[0] = left[0] + 1.0
 *             for j in range(self.num_grid) :
 */
    (__pyx_v_left[0]) = (__pyx_v_coords[0]);

    /* "yt/frontends/artio/_artio_caller.pyx":675
 *             coords[0] = i
 *             left[0] = coords[0]
 *             right[0] = left[0] + 1.0             # <<<<<<<<<<<<<<
 *             for j in range(self.num_grid) :
 *                 coords[1] = j
 */
    (__pyx_v_right[0]) = ((__pyx_v_left[0]) + 1.0);

    /* "yt/frontends/artio/_artio_caller.pyx":676
 *             left[0] = coords[0]
 *             right[0] = left[0] + 1.0
 *             for j in range(self.num_grid) :             # <<<<<<<<<<<<<<
 *                 coords[1] = j
 *                 left[1] = coords[1]
 */
    __pyx_t_4 = __pyx_v_self->num_grid;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_j = __pyx_t_5;

      /* "yt/frontends/artio/_artio_caller.pyx":677
 *             right[0] = left[0] + 1.0
 *             for j in range(self.num_grid) :
 *                 coords[1] = j             # <<<<<<<<<<<<<<
 *                 left[1] = coords[1]
 *                 right[1] = left[1] + 1.0
 */
      (__pyx_v_coords[1]) = __pyx_v_j;

      /* "yt/frontends/artio/_artio_caller.pyx":678
 *             for j in range(self.num_grid) :
 *                 coords[1] = j
 *                 left[1] = coords[1]             # <<<<<<<<<<<<<<
 *                 right[1] = left[1] + 1.0
 *                 for k in range(self.num_grid) :
 */
      (__pyx_v_left[1]) = (__pyx_v_coords[1]);

      /* "yt/frontends/artio/_artio_caller.pyx":679
 *                 coords[1] = j
 *                 left[1] = coords[1]
 *                 right[1] = left[1] + 1.0             # <<<<<<<<<<<<<<
 *                 for k in range(self.num_grid) :
 *                     coords[2] = k
 */
      (__pyx_v_right[1]) = ((__pyx_v_left[1]) + 1.0);

      /* "yt/frontends/artio/_artio_caller.pyx":680
 *                 left[1] = coords[1]
 *                 right[1] = left[1] + 1.0
 *                 for k in range(self.num_grid) :             # <<<<<<<<<<<<<<
 *                     coords[2] = k
 *                     left[2] = coords[2]
 */
      __pyx_t_6 = __pyx_v_self->num_grid;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_k = __pyx_t_7;

        /* "yt/frontends/artio/_artio_caller.pyx":681
 *                 right[1] = left[1] + 1.0
 *                 for k in range(self.num_grid) :
 *                     coords[2] = k             # <<<<<<<<<<<<<<
 *                     left[2] = coords[2]
 *                     right[2] = left[2] + 1.0
 */
        (__pyx_v_coords[2]) = __pyx_v_k;

        /* "yt/frontends/artio/_artio_caller.pyx":682
 *                 for k in range(self.num_grid) :
 *                     coords[2] = k
 *                     left[2] = coords[2]             # <<<<<<<<<<<<<<
 *                     right[2] = left[2] + 1.0
 *                     if selector.select_bbox(left,right) :
 */
        (__pyx_v_left[2]) = (__pyx_v_coords[2]);

        /* "yt/frontends/artio/_artio_caller.pyx":683
 *                     coords[2] = k
 *                     left[2] = coords[2]
 *                     right[2] = left[2] + 1.0             # <<<<<<<<<<<<<<
 *                     if selector.select_bbox(left,right) :
 *                         status = artio_selection_add_root_cell(selection, coords)
 */
        (__pyx_v_right[2]) = ((__pyx_v_left[2]) + 1.0);

        /* "yt/frontends/artio/_artio_caller.pyx":684
 *                     left[2] = coords[2]
 *                     right[2] = left[2] + 1.0
 *                     if selector.select_bbox(left,right) :             # <<<<<<<<<<<<<<
 *                         status = artio_selection_add_root_cell(selection, coords)
 *                         check_artio_status(status)
 */
        __pyx_t_8 = (((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->select_bbox(__pyx_v_selector, __pyx_v_left, __pyx_v_right) != 0);
        if (__pyx_t_8) {

          /* "yt/frontends/artio/_artio_caller.pyx":685
 *                     right[2] = left[2] + 1.0
 *                     if selector.select_bbox(left,right) :
 *                         status = artio_selection_add_root_cell(selection, coords)             # <<<<<<<<<<<<<<
 *                         check_artio_status(status)
 * 
 */
          __pyx_v_status = artio_selection_add_root_cell(__pyx_v_selection, __pyx_v_coords);

          /* "yt/frontends/artio/_artio_caller.pyx":686
 *                     if selector.select_bbox(left,right) :
 *                         status = artio_selection_add_root_cell(selection, coords)
 *                         check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *         while artio_selection_iterator(selection, max_range_size,
 */
          __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

          /* "yt/frontends/artio/_artio_caller.pyx":684
 *                     left[2] = coords[2]
 *                     right[2] = left[2] + 1.0
 *                     if selector.select_bbox(left,right) :             # <<<<<<<<<<<<<<
 *                         status = artio_selection_add_root_cell(selection, coords)
 *                         check_artio_status(status)
 */
        }
      }
    }
  }

  /* "yt/frontends/artio/_artio_caller.pyx":688
 *                         check_artio_status(status)
 * 
 *         while artio_selection_iterator(selection, max_range_size,             # <<<<<<<<<<<<<<
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :
 *             sfc_ranges.append([sfc_start, sfc_end])
 */
  while (1) {

    /* "yt/frontends/artio/_artio_caller.pyx":689
 * 
 *         while artio_selection_iterator(selection, max_range_size,
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :             # <<<<<<<<<<<<<<
 *             sfc_ranges.append([sfc_start, sfc_end])
 * 
 */
    __pyx_t_8 = ((artio_selection_iterator(__pyx_v_selection, __pyx_v_max_range_size, (&__pyx_v_sfc_start), (&__pyx_v_sfc_end)) == ARTIO_SUCCESS) != 0);
    if (!__pyx_t_8) break;

    /* "yt/frontends/artio/_artio_caller.pyx":690
 *         while artio_selection_iterator(selection, max_range_size,
 *                 &sfc_start, &sfc_end) == ARTIO_SUCCESS :
 *             sfc_ranges.append([sfc_start, sfc_end])             # <<<<<<<<<<<<<<
 * 
 *         artio_selection_destroy(selection)
 */
    __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_sfc_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyInt_From_int64_t(__pyx_v_sfc_end); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_9);
    PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
    __pyx_t_1 = 0;
    __pyx_t_9 = 0;
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_sfc_ranges, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":692
 *             sfc_ranges.append([sfc_start, sfc_end])
 * 
 *         artio_selection_destroy(selection)             # <<<<<<<<<<<<<<
 *         return sfc_ranges
 * 
 */
  artio_selection_destroy(__pyx_v_selection);

  /* "yt/frontends/artio/_artio_caller.pyx":693
 * 
 *         artio_selection_destroy(selection)
 *         return sfc_ranges             # <<<<<<<<<<<<<<
 * 
 * ###################################################
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_sfc_ranges);
  __pyx_r = __pyx_v_sfc_ranges;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":659
 *         return sfc_ranges
 * 
 *     def root_sfc_ranges(self, SelectorObject selector,             # <<<<<<<<<<<<<<
 *                         int max_range_size = 1024):
 *         cdef int coords[3]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.root_sfc_ranges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sfc_ranges);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":161
 * 
 * cdef class artio_fileset :
 *     cdef public object parameters             # <<<<<<<<<<<<<<
 *     cdef artio_fileset_handle *handle
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->parameters);
  __pyx_r = __pyx_v_self->parameters;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->parameters);
  __Pyx_DECREF(__pyx_v_self->parameters);
  __pyx_v_self->parameters = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->parameters);
  __Pyx_DECREF(__pyx_v_self->parameters);
  __pyx_v_self->parameters = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":169
 * 
 *     # common attributes
 *     cdef public int num_grid             # <<<<<<<<<<<<<<
 *     cdef int64_t num_root_cells
 *     cdef int64_t sfc_min, sfc_max
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_grid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.num_grid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->num_grid = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.num_grid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":174
 * 
 *     # grid attributes
 *     cdef public int has_grid             # <<<<<<<<<<<<<<
 *     cdef public int min_level, max_level
 *     cdef public int num_grid_variables
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->has_grid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.has_grid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->has_grid = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.has_grid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":175
 *     # grid attributes
 *     cdef public int has_grid
 *     cdef public int min_level, max_level             # <<<<<<<<<<<<<<
 *     cdef public int num_grid_variables
 *     cdef int *num_octs_per_level
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->min_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.min_level.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->min_level = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.min_level.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->max_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.max_level.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->max_level = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.max_level.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":176
 *     cdef public int has_grid
 *     cdef public int min_level, max_level
 *     cdef public int num_grid_variables             # <<<<<<<<<<<<<<
 *     cdef int *num_octs_per_level
 *     cdef float *grid_variables
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_grid_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.num_grid_variables.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->num_grid_variables = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.num_grid_variables.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":181
 * 
 *     # particle attributes
 *     cdef public int has_particles             # <<<<<<<<<<<<<<
 *     cdef public int num_species
 *     cdef int *particle_position_index
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->has_particles); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.has_particles.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->has_particles = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.has_particles.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":182
 *     # particle attributes
 *     cdef public int has_particles
 *     cdef public int num_species             # <<<<<<<<<<<<<<
 *     cdef int *particle_position_index
 *     cdef int *num_particles_per_species
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_species); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.num_species.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->num_species = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_fileset.num_species.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":696
 * 
 * ###################################################
 * def artio_is_valid( char *file_prefix ) :             # <<<<<<<<<<<<<<
 *     cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix,
 *             ARTIO_OPEN_HEADER, artio_context_global )
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_1artio_is_valid(PyObject *__pyx_self, PyObject *__pyx_arg_file_prefix); /*proto*/
static PyMethodDef __pyx_mdef_2yt_9frontends_5artio_13_artio_caller_1artio_is_valid = {"artio_is_valid", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_1artio_is_valid, METH_O, 0};
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_1artio_is_valid(PyObject *__pyx_self, PyObject *__pyx_arg_file_prefix) {
  char *__pyx_v_file_prefix;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("artio_is_valid (wrapper)", 0);
  assert(__pyx_arg_file_prefix); {
    __pyx_v_file_prefix = __Pyx_PyObject_AsString(__pyx_arg_file_prefix); if (unlikely((!__pyx_v_file_prefix) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.artio_is_valid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_artio_is_valid(__pyx_self, ((char *)__pyx_v_file_prefix));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_artio_is_valid(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_file_prefix) {
  artio_fileset *__pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("artio_is_valid", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":697
 * ###################################################
 * def artio_is_valid( char *file_prefix ) :
 *     cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix,             # <<<<<<<<<<<<<<
 *             ARTIO_OPEN_HEADER, artio_context_global )
 *     if handle == NULL :
 */
  __pyx_v_handle = artio_fileset_open(__pyx_v_file_prefix, ARTIO_OPEN_HEADER, artio_context_global);

  /* "yt/frontends/artio/_artio_caller.pyx":699
 *     cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix,
 *             ARTIO_OPEN_HEADER, artio_context_global )
 *     if handle == NULL :             # <<<<<<<<<<<<<<
 *         return False
 *     else :
 */
  __pyx_t_1 = ((__pyx_v_handle == NULL) != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":700
 *             ARTIO_OPEN_HEADER, artio_context_global )
 *     if handle == NULL :
 *         return False             # <<<<<<<<<<<<<<
 *     else :
 *         artio_fileset_close(handle)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":699
 *     cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix,
 *             ARTIO_OPEN_HEADER, artio_context_global )
 *     if handle == NULL :             # <<<<<<<<<<<<<<
 *         return False
 *     else :
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":702
 *         return False
 *     else :
 *         artio_fileset_close(handle)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
  /*else*/ {
    artio_fileset_close(__pyx_v_handle);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":703
 *     else :
 *         artio_fileset_close(handle)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * cdef class ARTIOSFCRangeHandler:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":696
 * 
 * ###################################################
 * def artio_is_valid( char *file_prefix ) :             # <<<<<<<<<<<<<<
 *     cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix,
 *             ARTIO_OPEN_HEADER, artio_context_global )
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":723
 *     cdef np.int64_t nvars[2]
 * 
 *     def __init__(self, domain_dimensions, # cells             # <<<<<<<<<<<<<<
 *                  domain_left_edge,
 *                  domain_right_edge,
 */

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_domain_dimensions = 0;
  PyObject *__pyx_v_domain_left_edge = 0;
  PyObject *__pyx_v_domain_right_edge = 0;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_artio_handle = 0;
  PyObject *__pyx_v_sfc_start = 0;
  PyObject *__pyx_v_sfc_end = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_dimensions,&__pyx_n_s_domain_left_edge,&__pyx_n_s_domain_right_edge,&__pyx_n_s_artio_handle,&__pyx_n_s_sfc_start,&__pyx_n_s_sfc_end,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_dimensions)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_artio_handle)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_start)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sfc_end)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_domain_dimensions = values[0];
    __pyx_v_domain_left_edge = values[1];
    __pyx_v_domain_right_edge = values[2];
    __pyx_v_artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)values[3]);
    __pyx_v_sfc_start = values[4];
    __pyx_v_sfc_end = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_artio_handle), __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset, 1, "artio_handle", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler___init__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), __pyx_v_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_artio_handle, __pyx_v_sfc_start, __pyx_v_sfc_end);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_artio_handle, PyObject *__pyx_v_sfc_start, PyObject *__pyx_v_sfc_end) {
  int __pyx_v_i;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_int64_t __pyx_t_1;
  artio_fileset *__pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":730
 *         cdef int i
 *         cdef np.int64_t sfc
 *         self.sfc_start = sfc_start             # <<<<<<<<<<<<<<
 *         self.sfc_end = sfc_end
 *         self.artio_handle = artio_handle
 */
  __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_sfc_start); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->sfc_start = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":731
 *         cdef np.int64_t sfc
 *         self.sfc_start = sfc_start
 *         self.sfc_end = sfc_end             # <<<<<<<<<<<<<<
 *         self.artio_handle = artio_handle
 *         self.root_mesh_handler = None
 */
  __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_sfc_end); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->sfc_end = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":732
 *         self.sfc_start = sfc_start
 *         self.sfc_end = sfc_end
 *         self.artio_handle = artio_handle             # <<<<<<<<<<<<<<
 *         self.root_mesh_handler = None
 *         self.octree_handler = None
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_artio_handle));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_artio_handle));
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = __pyx_v_artio_handle;

  /* "yt/frontends/artio/_artio_caller.pyx":733
 *         self.sfc_end = sfc_end
 *         self.artio_handle = artio_handle
 *         self.root_mesh_handler = None             # <<<<<<<<<<<<<<
 *         self.octree_handler = None
 *         self.handle = artio_handle.handle
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->root_mesh_handler);
  __Pyx_DECREF(__pyx_v_self->root_mesh_handler);
  __pyx_v_self->root_mesh_handler = Py_None;

  /* "yt/frontends/artio/_artio_caller.pyx":734
 *         self.artio_handle = artio_handle
 *         self.root_mesh_handler = None
 *         self.octree_handler = None             # <<<<<<<<<<<<<<
 *         self.handle = artio_handle.handle
 *         self.oct_count = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->octree_handler);
  __Pyx_DECREF(__pyx_v_self->octree_handler);
  __pyx_v_self->octree_handler = Py_None;

  /* "yt/frontends/artio/_artio_caller.pyx":735
 *         self.root_mesh_handler = None
 *         self.octree_handler = None
 *         self.handle = artio_handle.handle             # <<<<<<<<<<<<<<
 *         self.oct_count = None
 *         self.root_mesh_data = NULL
 */
  __pyx_t_2 = __pyx_v_artio_handle->handle;
  __pyx_v_self->handle = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":736
 *         self.octree_handler = None
 *         self.handle = artio_handle.handle
 *         self.oct_count = None             # <<<<<<<<<<<<<<
 *         self.root_mesh_data = NULL
 *         self.pcount = NULL
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->oct_count);
  __Pyx_DECREF(__pyx_v_self->oct_count);
  __pyx_v_self->oct_count = Py_None;

  /* "yt/frontends/artio/_artio_caller.pyx":737
 *         self.handle = artio_handle.handle
 *         self.oct_count = None
 *         self.root_mesh_data = NULL             # <<<<<<<<<<<<<<
 *         self.pcount = NULL
 * 
 */
  __pyx_v_self->root_mesh_data = NULL;

  /* "yt/frontends/artio/_artio_caller.pyx":738
 *         self.oct_count = None
 *         self.root_mesh_data = NULL
 *         self.pcount = NULL             # <<<<<<<<<<<<<<
 * 
 *         if artio_handle.has_particles:
 */
  __pyx_v_self->pcount = NULL;

  /* "yt/frontends/artio/_artio_caller.pyx":740
 *         self.pcount = NULL
 * 
 *         if artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *             self.pcount = <np.int64_t **> malloc(sizeof(np.int64_t*)
 *                 * artio_handle.num_species)
 */
  __pyx_t_3 = (__pyx_v_artio_handle->has_particles != 0);
  if (__pyx_t_3) {

    /* "yt/frontends/artio/_artio_caller.pyx":741
 * 
 *         if artio_handle.has_particles:
 *             self.pcount = <np.int64_t **> malloc(sizeof(np.int64_t*)             # <<<<<<<<<<<<<<
 *                 * artio_handle.num_species)
 *             self.nvars[0] = artio_handle.num_species
 */
    __pyx_v_self->pcount = ((__pyx_t_5numpy_int64_t **)malloc(((sizeof(__pyx_t_5numpy_int64_t *)) * __pyx_v_artio_handle->num_species)));

    /* "yt/frontends/artio/_artio_caller.pyx":743
 *             self.pcount = <np.int64_t **> malloc(sizeof(np.int64_t*)
 *                 * artio_handle.num_species)
 *             self.nvars[0] = artio_handle.num_species             # <<<<<<<<<<<<<<
 *             for i in range(artio_handle.num_species):
 *                 self.pcount[i] = <np.int64_t*> malloc(sizeof(np.int64_t)
 */
    __pyx_t_4 = __pyx_v_artio_handle->num_species;
    (__pyx_v_self->nvars[0]) = __pyx_t_4;

    /* "yt/frontends/artio/_artio_caller.pyx":744
 *                 * artio_handle.num_species)
 *             self.nvars[0] = artio_handle.num_species
 *             for i in range(artio_handle.num_species):             # <<<<<<<<<<<<<<
 *                 self.pcount[i] = <np.int64_t*> malloc(sizeof(np.int64_t)
 *                     * (self.sfc_end - self.sfc_start + 1))
 */
    __pyx_t_4 = __pyx_v_artio_handle->num_species;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "yt/frontends/artio/_artio_caller.pyx":745
 *             self.nvars[0] = artio_handle.num_species
 *             for i in range(artio_handle.num_species):
 *                 self.pcount[i] = <np.int64_t*> malloc(sizeof(np.int64_t)             # <<<<<<<<<<<<<<
 *                     * (self.sfc_end - self.sfc_start + 1))
 *                 for sfc in range(self.sfc_end - self.sfc_start + 1):
 */
      (__pyx_v_self->pcount[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)malloc(((sizeof(__pyx_t_5numpy_int64_t)) * ((__pyx_v_self->sfc_end - __pyx_v_self->sfc_start) + 1))));

      /* "yt/frontends/artio/_artio_caller.pyx":747
 *                 self.pcount[i] = <np.int64_t*> malloc(sizeof(np.int64_t)
 *                     * (self.sfc_end - self.sfc_start + 1))
 *                 for sfc in range(self.sfc_end - self.sfc_start + 1):             # <<<<<<<<<<<<<<
 *                     self.pcount[i][sfc] = 0
 *         else:
 */
      __pyx_t_1 = ((__pyx_v_self->sfc_end - __pyx_v_self->sfc_start) + 1);
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) {
        __pyx_v_sfc = __pyx_t_6;

        /* "yt/frontends/artio/_artio_caller.pyx":748
 *                     * (self.sfc_end - self.sfc_start + 1))
 *                 for sfc in range(self.sfc_end - self.sfc_start + 1):
 *                     self.pcount[i][sfc] = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self.nvars[0] = 0
 */
        ((__pyx_v_self->pcount[__pyx_v_i])[__pyx_v_sfc]) = 0;
      }
    }

    /* "yt/frontends/artio/_artio_caller.pyx":740
 *         self.pcount = NULL
 * 
 *         if artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *             self.pcount = <np.int64_t **> malloc(sizeof(np.int64_t*)
 *                 * artio_handle.num_species)
 */
    goto __pyx_L3;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":750
 *                     self.pcount[i][sfc] = 0
 *         else:
 *             self.nvars[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if artio_handle.has_grid:
 */
  /*else*/ {
    (__pyx_v_self->nvars[0]) = 0;
  }
  __pyx_L3:;

  /* "yt/frontends/artio/_artio_caller.pyx":752
 *             self.nvars[0] = 0
 * 
 *         if artio_handle.has_grid:             # <<<<<<<<<<<<<<
 *             self.nvars[1] = artio_handle.num_grid_variables
 *         else:
 */
  __pyx_t_3 = (__pyx_v_artio_handle->has_grid != 0);
  if (__pyx_t_3) {

    /* "yt/frontends/artio/_artio_caller.pyx":753
 * 
 *         if artio_handle.has_grid:
 *             self.nvars[1] = artio_handle.num_grid_variables             # <<<<<<<<<<<<<<
 *         else:
 *             self.nvars[1] = 0
 */
    __pyx_t_4 = __pyx_v_artio_handle->num_grid_variables;
    (__pyx_v_self->nvars[1]) = __pyx_t_4;

    /* "yt/frontends/artio/_artio_caller.pyx":752
 *             self.nvars[0] = 0
 * 
 *         if artio_handle.has_grid:             # <<<<<<<<<<<<<<
 *             self.nvars[1] = artio_handle.num_grid_variables
 *         else:
 */
    goto __pyx_L8;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":755
 *             self.nvars[1] = artio_handle.num_grid_variables
 *         else:
 *             self.nvars[1] = 0             # <<<<<<<<<<<<<<
 * 
 *         for i in range(3):
 */
  /*else*/ {
    (__pyx_v_self->nvars[1]) = 0;
  }
  __pyx_L8:;

  /* "yt/frontends/artio/_artio_caller.pyx":757
 *             self.nvars[1] = 0
 * 
 *         for i in range(3):             # <<<<<<<<<<<<<<
 *             self.dims[i] = domain_dimensions[i]
 *             self.DLE[i] = domain_left_edge[i]
 */
  for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "yt/frontends/artio/_artio_caller.pyx":758
 * 
 *         for i in range(3):
 *             self.dims[i] = domain_dimensions[i]             # <<<<<<<<<<<<<<
 *             self.DLE[i] = domain_left_edge[i]
 *             self.DRE[i] = domain_right_edge[i]
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_domain_dimensions, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    (__pyx_v_self->dims[__pyx_v_i]) = __pyx_t_1;

    /* "yt/frontends/artio/_artio_caller.pyx":759
 *         for i in range(3):
 *             self.dims[i] = domain_dimensions[i]
 *             self.DLE[i] = domain_left_edge[i]             # <<<<<<<<<<<<<<
 *             self.DRE[i] = domain_right_edge[i]
 *             self.dds[i] = (self.DRE[i] - self.DLE[i])/self.dims[i]
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    (__pyx_v_self->DLE[__pyx_v_i]) = __pyx_t_8;

    /* "yt/frontends/artio/_artio_caller.pyx":760
 *             self.dims[i] = domain_dimensions[i]
 *             self.DLE[i] = domain_left_edge[i]
 *             self.DRE[i] = domain_right_edge[i]             # <<<<<<<<<<<<<<
 *             self.dds[i] = (self.DRE[i] - self.DLE[i])/self.dims[i]
 * 
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    (__pyx_v_self->DRE[__pyx_v_i]) = __pyx_t_8;

    /* "yt/frontends/artio/_artio_caller.pyx":761
 *             self.DLE[i] = domain_left_edge[i]
 *             self.DRE[i] = domain_right_edge[i]
 *             self.dds[i] = (self.DRE[i] - self.DLE[i])/self.dims[i]             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_8 = ((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i]));
    if (unlikely((__pyx_v_self->dims[__pyx_v_i]) == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    (__pyx_v_self->dds[__pyx_v_i]) = (__pyx_t_8 / (__pyx_v_self->dims[__pyx_v_i]));
  }

  /* "yt/frontends/artio/_artio_caller.pyx":723
 *     cdef np.int64_t nvars[2]
 * 
 *     def __init__(self, domain_dimensions, # cells             # <<<<<<<<<<<<<<
 *                  domain_left_edge,
 *                  domain_right_edge,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":763
 *             self.dds[i] = (self.DRE[i] - self.DLE[i])/self.dims[i]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         if self.artio_handle.has_particles:
 */

/* Python wrapper */
static void __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_2__dealloc__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  int __pyx_v_i;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":765
 *     def __dealloc__(self):
 *         cdef int i
 *         if self.artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *             for i in range(self.nvars[0]):
 *                 free(self.pcount[i])
 */
  __pyx_t_1 = (__pyx_v_self->artio_handle->has_particles != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":766
 *         cdef int i
 *         if self.artio_handle.has_particles:
 *             for i in range(self.nvars[0]):             # <<<<<<<<<<<<<<
 *                 free(self.pcount[i])
 *             free(self.pcount)
 */
    __pyx_t_2 = (__pyx_v_self->nvars[0]);
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "yt/frontends/artio/_artio_caller.pyx":767
 *         if self.artio_handle.has_particles:
 *             for i in range(self.nvars[0]):
 *                 free(self.pcount[i])             # <<<<<<<<<<<<<<
 *             free(self.pcount)
 *         if self.artio_handle.has_grid:
 */
      free((__pyx_v_self->pcount[__pyx_v_i]));
    }

    /* "yt/frontends/artio/_artio_caller.pyx":768
 *             for i in range(self.nvars[0]):
 *                 free(self.pcount[i])
 *             free(self.pcount)             # <<<<<<<<<<<<<<
 *         if self.artio_handle.has_grid:
 *             if self.root_mesh_data != NULL:
 */
    free(__pyx_v_self->pcount);

    /* "yt/frontends/artio/_artio_caller.pyx":765
 *     def __dealloc__(self):
 *         cdef int i
 *         if self.artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *             for i in range(self.nvars[0]):
 *                 free(self.pcount[i])
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":769
 *                 free(self.pcount[i])
 *             free(self.pcount)
 *         if self.artio_handle.has_grid:             # <<<<<<<<<<<<<<
 *             if self.root_mesh_data != NULL:
 *                 for i in range(self.nvars[1]):
 */
  __pyx_t_1 = (__pyx_v_self->artio_handle->has_grid != 0);
  if (__pyx_t_1) {

    /* "yt/frontends/artio/_artio_caller.pyx":770
 *             free(self.pcount)
 *         if self.artio_handle.has_grid:
 *             if self.root_mesh_data != NULL:             # <<<<<<<<<<<<<<
 *                 for i in range(self.nvars[1]):
 *                     free(self.root_mesh_data[i])
 */
    __pyx_t_1 = ((__pyx_v_self->root_mesh_data != NULL) != 0);
    if (__pyx_t_1) {

      /* "yt/frontends/artio/_artio_caller.pyx":771
 *         if self.artio_handle.has_grid:
 *             if self.root_mesh_data != NULL:
 *                 for i in range(self.nvars[1]):             # <<<<<<<<<<<<<<
 *                     free(self.root_mesh_data[i])
 *                 free(self.root_mesh_data)
 */
      __pyx_t_2 = (__pyx_v_self->nvars[1]);
      for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
        __pyx_v_i = __pyx_t_3;

        /* "yt/frontends/artio/_artio_caller.pyx":772
 *             if self.root_mesh_data != NULL:
 *                 for i in range(self.nvars[1]):
 *                     free(self.root_mesh_data[i])             # <<<<<<<<<<<<<<
 *                 free(self.root_mesh_data)
 * 
 */
        free((__pyx_v_self->root_mesh_data[__pyx_v_i]));
      }

      /* "yt/frontends/artio/_artio_caller.pyx":773
 *                 for i in range(self.nvars[1]):
 *                     free(self.root_mesh_data[i])
 *                 free(self.root_mesh_data)             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
      free(__pyx_v_self->root_mesh_data);

      /* "yt/frontends/artio/_artio_caller.pyx":770
 *             free(self.pcount)
 *         if self.artio_handle.has_grid:
 *             if self.root_mesh_data != NULL:             # <<<<<<<<<<<<<<
 *                 for i in range(self.nvars[1]):
 *                     free(self.root_mesh_data[i])
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":769
 *                 free(self.pcount[i])
 *             free(self.pcount)
 *         if self.artio_handle.has_grid:             # <<<<<<<<<<<<<<
 *             if self.root_mesh_data != NULL:
 *                 for i in range(self.nvars[1]):
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":763
 *             self.dds[i] = (self.DRE[i] - self.DLE[i])/self.dims[i]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         if self.artio_handle.has_particles:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "yt/frontends/artio/_artio_caller.pyx":778
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def construct_mesh(self):             # <<<<<<<<<<<<<<
 *         cdef int status, level, ngv
 *         cdef np.int64_t sfc, oc, i
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_5construct_mesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_5construct_mesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("construct_mesh (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_4construct_mesh(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_4construct_mesh(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  int __pyx_v_status;
  int __pyx_v_level;
  int __pyx_v_ngv;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_oc;
  __pyx_t_5numpy_int64_t __pyx_v_i;
  double __pyx_v_dpos[3];
  int __pyx_v_num_oct_levels;
  int __pyx_v_max_level;
  int *__pyx_v_num_octs_per_level;
  int __pyx_v_num_species;
  int *__pyx_v_num_particles_per_species;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_octree = 0;
  float *__pyx_v_grid_variables;
  PyArrayObject *__pyx_v_oct_count = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_oct_count;
  __Pyx_Buffer __pyx_pybuffer_oct_count;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  __pyx_t_5numpy_int64_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  __pyx_t_5numpy_int64_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("construct_mesh", 0);
  __pyx_pybuffer_oct_count.pybuffer.buf = NULL;
  __pyx_pybuffer_oct_count.refcount = 0;
  __pyx_pybuffernd_oct_count.data = NULL;
  __pyx_pybuffernd_oct_count.rcbuffer = &__pyx_pybuffer_oct_count;

  /* "yt/frontends/artio/_artio_caller.pyx":783
 *         cdef double dpos[3]
 *         cdef int num_oct_levels
 *         cdef int max_level = self.artio_handle.max_level             # <<<<<<<<<<<<<<
 *         cdef int *num_octs_per_level = <int *>malloc(
 *             (max_level + 1)*sizeof(int))
 */
  __pyx_t_1 = __pyx_v_self->artio_handle->max_level;
  __pyx_v_max_level = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":784
 *         cdef int num_oct_levels
 *         cdef int max_level = self.artio_handle.max_level
 *         cdef int *num_octs_per_level = <int *>malloc(             # <<<<<<<<<<<<<<
 *             (max_level + 1)*sizeof(int))
 *         cdef int num_species = self.artio_handle.num_species
 */
  __pyx_v_num_octs_per_level = ((int *)malloc(((__pyx_v_max_level + 1) * (sizeof(int)))));

  /* "yt/frontends/artio/_artio_caller.pyx":786
 *         cdef int *num_octs_per_level = <int *>malloc(
 *             (max_level + 1)*sizeof(int))
 *         cdef int num_species = self.artio_handle.num_species             # <<<<<<<<<<<<<<
 *         cdef int *num_particles_per_species
 *         cdef ARTIOOctreeContainer octree
 */
  __pyx_t_1 = __pyx_v_self->artio_handle->num_species;
  __pyx_v_num_species = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":789
 *         cdef int *num_particles_per_species
 *         cdef ARTIOOctreeContainer octree
 *         ngv = self.nvars[1]             # <<<<<<<<<<<<<<
 *         cdef float *grid_variables = <float *>malloc(
 *             ngv * sizeof(float))
 */
  __pyx_v_ngv = (__pyx_v_self->nvars[1]);

  /* "yt/frontends/artio/_artio_caller.pyx":790
 *         cdef ARTIOOctreeContainer octree
 *         ngv = self.nvars[1]
 *         cdef float *grid_variables = <float *>malloc(             # <<<<<<<<<<<<<<
 *             ngv * sizeof(float))
 *         self.octree_handler = octree = ARTIOOctreeContainer(self)
 */
  __pyx_v_grid_variables = ((float *)malloc((__pyx_v_ngv * (sizeof(float)))));

  /* "yt/frontends/artio/_artio_caller.pyx":792
 *         cdef float *grid_variables = <float *>malloc(
 *             ngv * sizeof(float))
 *         self.octree_handler = octree = ARTIOOctreeContainer(self)             # <<<<<<<<<<<<<<
 *         self.root_mesh_data = <float **>malloc(sizeof(float *) * ngv)
 *         for i in range(ngv):
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->octree_handler);
  __Pyx_DECREF(__pyx_v_self->octree_handler);
  __pyx_v_self->octree_handler = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_octree = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":793
 *             ngv * sizeof(float))
 *         self.octree_handler = octree = ARTIOOctreeContainer(self)
 *         self.root_mesh_data = <float **>malloc(sizeof(float *) * ngv)             # <<<<<<<<<<<<<<
 *         for i in range(ngv):
 *             self.root_mesh_data[i] = <float *>malloc(sizeof(float) * \
 */
  __pyx_v_self->root_mesh_data = ((float **)malloc(((sizeof(float *)) * __pyx_v_ngv)));

  /* "yt/frontends/artio/_artio_caller.pyx":794
 *         self.octree_handler = octree = ARTIOOctreeContainer(self)
 *         self.root_mesh_data = <float **>malloc(sizeof(float *) * ngv)
 *         for i in range(ngv):             # <<<<<<<<<<<<<<
 *             self.root_mesh_data[i] = <float *>malloc(sizeof(float) * \
 *                 (self.sfc_end - self.sfc_start + 1))
 */
  __pyx_t_1 = __pyx_v_ngv;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "yt/frontends/artio/_artio_caller.pyx":795
 *         self.root_mesh_data = <float **>malloc(sizeof(float *) * ngv)
 *         for i in range(ngv):
 *             self.root_mesh_data[i] = <float *>malloc(sizeof(float) * \             # <<<<<<<<<<<<<<
 *                 (self.sfc_end - self.sfc_start + 1))
 *         # We want to pre-allocate an array of root pointers.  In the future,
 */
    (__pyx_v_self->root_mesh_data[__pyx_v_i]) = ((float *)malloc(((sizeof(float)) * ((__pyx_v_self->sfc_end - __pyx_v_self->sfc_start) + 1))));
  }

  /* "yt/frontends/artio/_artio_caller.pyx":801
 *         # realloc plays havoc with our tree searching, we can't utilize an
 *         # expanding array at the present time.
 *         octree.allocate_domains([], self.sfc_end - self.sfc_start + 1)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.int64_t, ndim=1] oct_count
 *         oct_count = np.zeros(self.sfc_end - self.sfc_start + 1, dtype="int64")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_octree), __pyx_n_s_allocate_domains); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_npy_int64(((__pyx_v_self->sfc_end - __pyx_v_self->sfc_start) + 1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_7) {
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":803
 *         octree.allocate_domains([], self.sfc_end - self.sfc_start + 1)
 *         cdef np.ndarray[np.int64_t, ndim=1] oct_count
 *         oct_count = np.zeros(self.sfc_end - self.sfc_start + 1, dtype="int64")             # <<<<<<<<<<<<<<
 *         status = artio_grid_cache_sfc_range(self.handle, self.sfc_start,
 *                                             self.sfc_end)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_npy_int64(((__pyx_v_self->sfc_end - __pyx_v_self->sfc_start) + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oct_count.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oct_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oct_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_oct_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_pybuffernd_oct_count.diminfo[0].strides = __pyx_pybuffernd_oct_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oct_count.diminfo[0].shape = __pyx_pybuffernd_oct_count.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = 0;
  __pyx_v_oct_count = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":804
 *         cdef np.ndarray[np.int64_t, ndim=1] oct_count
 *         oct_count = np.zeros(self.sfc_end - self.sfc_start + 1, dtype="int64")
 *         status = artio_grid_cache_sfc_range(self.handle, self.sfc_start,             # <<<<<<<<<<<<<<
 *                                             self.sfc_end)
 *         check_artio_status(status)
 */
  __pyx_v_status = artio_grid_cache_sfc_range(__pyx_v_self->handle, __pyx_v_self->sfc_start, __pyx_v_self->sfc_end);

  /* "yt/frontends/artio/_artio_caller.pyx":806
 *         status = artio_grid_cache_sfc_range(self.handle, self.sfc_start,
 *                                             self.sfc_end)
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             status = artio_grid_read_root_cell_begin( self.handle,
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":807
 *                                             self.sfc_end)
 *         check_artio_status(status)
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *             status = artio_grid_read_root_cell_begin( self.handle,
 *                 sfc, dpos, grid_variables, &num_oct_levels,
 */
  __pyx_t_4 = (__pyx_v_self->sfc_end + 1);
  for (__pyx_t_14 = __pyx_v_self->sfc_start; __pyx_t_14 < __pyx_t_4; __pyx_t_14+=1) {
    __pyx_v_sfc = __pyx_t_14;

    /* "yt/frontends/artio/_artio_caller.pyx":808
 *         check_artio_status(status)
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             status = artio_grid_read_root_cell_begin( self.handle,             # <<<<<<<<<<<<<<
 *                 sfc, dpos, grid_variables, &num_oct_levels,
 *                 num_octs_per_level)
 */
    __pyx_v_status = artio_grid_read_root_cell_begin(__pyx_v_self->handle, __pyx_v_sfc, __pyx_v_dpos, __pyx_v_grid_variables, (&__pyx_v_num_oct_levels), __pyx_v_num_octs_per_level);

    /* "yt/frontends/artio/_artio_caller.pyx":811
 *                 sfc, dpos, grid_variables, &num_oct_levels,
 *                 num_octs_per_level)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             for i in range(ngv):
 *                 self.root_mesh_data[i][sfc - self.sfc_start] = \
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":812
 *                 num_octs_per_level)
 *             check_artio_status(status)
 *             for i in range(ngv):             # <<<<<<<<<<<<<<
 *                 self.root_mesh_data[i][sfc - self.sfc_start] = \
 *                     grid_variables[i]
 */
    __pyx_t_1 = __pyx_v_ngv;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) {
      __pyx_v_i = __pyx_t_15;

      /* "yt/frontends/artio/_artio_caller.pyx":813
 *             check_artio_status(status)
 *             for i in range(ngv):
 *                 self.root_mesh_data[i][sfc - self.sfc_start] = \             # <<<<<<<<<<<<<<
 *                     grid_variables[i]
 *             if num_oct_levels > 0:
 */
      ((__pyx_v_self->root_mesh_data[__pyx_v_i])[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) = (__pyx_v_grid_variables[__pyx_v_i]);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":815
 *                 self.root_mesh_data[i][sfc - self.sfc_start] = \
 *                     grid_variables[i]
 *             if num_oct_levels > 0:             # <<<<<<<<<<<<<<
 *                 oc = 0
 *                 for level in range(num_oct_levels):
 */
    __pyx_t_16 = ((__pyx_v_num_oct_levels > 0) != 0);
    if (__pyx_t_16) {

      /* "yt/frontends/artio/_artio_caller.pyx":816
 *                     grid_variables[i]
 *             if num_oct_levels > 0:
 *                 oc = 0             # <<<<<<<<<<<<<<
 *                 for level in range(num_oct_levels):
 *                     oc += num_octs_per_level[level]
 */
      __pyx_v_oc = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":817
 *             if num_oct_levels > 0:
 *                 oc = 0
 *                 for level in range(num_oct_levels):             # <<<<<<<<<<<<<<
 *                     oc += num_octs_per_level[level]
 *                 self.total_octs += oc
 */
      __pyx_t_1 = __pyx_v_num_oct_levels;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_1; __pyx_t_17+=1) {
        __pyx_v_level = __pyx_t_17;

        /* "yt/frontends/artio/_artio_caller.pyx":818
 *                 oc = 0
 *                 for level in range(num_oct_levels):
 *                     oc += num_octs_per_level[level]             # <<<<<<<<<<<<<<
 *                 self.total_octs += oc
 *                 oct_count[sfc - self.sfc_start] = oc
 */
        __pyx_v_oc = (__pyx_v_oc + (__pyx_v_num_octs_per_level[__pyx_v_level]));
      }

      /* "yt/frontends/artio/_artio_caller.pyx":819
 *                 for level in range(num_oct_levels):
 *                     oc += num_octs_per_level[level]
 *                 self.total_octs += oc             # <<<<<<<<<<<<<<
 *                 oct_count[sfc - self.sfc_start] = oc
 *                 octree.initialize_local_mesh(oc, num_oct_levels,
 */
      __pyx_v_self->total_octs = (__pyx_v_self->total_octs + __pyx_v_oc);

      /* "yt/frontends/artio/_artio_caller.pyx":820
 *                     oc += num_octs_per_level[level]
 *                 self.total_octs += oc
 *                 oct_count[sfc - self.sfc_start] = oc             # <<<<<<<<<<<<<<
 *                 octree.initialize_local_mesh(oc, num_oct_levels,
 *                     num_octs_per_level, sfc)
 */
      __pyx_t_15 = (__pyx_v_sfc - __pyx_v_self->sfc_start);
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_oct_count.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_oct_count.diminfo[0].strides) = __pyx_v_oc;

      /* "yt/frontends/artio/_artio_caller.pyx":821
 *                 self.total_octs += oc
 *                 oct_count[sfc - self.sfc_start] = oc
 *                 octree.initialize_local_mesh(oc, num_oct_levels,             # <<<<<<<<<<<<<<
 *                     num_octs_per_level, sfc)
 *             status = artio_grid_read_root_cell_end(self.handle)
 */
      ((struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_octree->__pyx_base.__pyx_base.__pyx_vtab)->initialize_local_mesh(__pyx_v_octree, __pyx_v_oc, __pyx_v_num_oct_levels, __pyx_v_num_octs_per_level, __pyx_v_sfc);

      /* "yt/frontends/artio/_artio_caller.pyx":815
 *                 self.root_mesh_data[i][sfc - self.sfc_start] = \
 *                     grid_variables[i]
 *             if num_oct_levels > 0:             # <<<<<<<<<<<<<<
 *                 oc = 0
 *                 for level in range(num_oct_levels):
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":823
 *                 octree.initialize_local_mesh(oc, num_oct_levels,
 *                     num_octs_per_level, sfc)
 *             status = artio_grid_read_root_cell_end(self.handle)             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 *         status = artio_grid_clear_sfc_cache(self.handle)
 */
    __pyx_v_status = artio_grid_read_root_cell_end(__pyx_v_self->handle);

    /* "yt/frontends/artio/_artio_caller.pyx":824
 *                     num_octs_per_level, sfc)
 *             status = artio_grid_read_root_cell_end(self.handle)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *         status = artio_grid_clear_sfc_cache(self.handle)
 *         check_artio_status(status)
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":825
 *             status = artio_grid_read_root_cell_end(self.handle)
 *             check_artio_status(status)
 *         status = artio_grid_clear_sfc_cache(self.handle)             # <<<<<<<<<<<<<<
 *         check_artio_status(status)
 * 
 */
  __pyx_v_status = artio_grid_clear_sfc_cache(__pyx_v_self->handle);

  /* "yt/frontends/artio/_artio_caller.pyx":826
 *             check_artio_status(status)
 *         status = artio_grid_clear_sfc_cache(self.handle)
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *         if self.artio_handle.has_particles:
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":828
 *         check_artio_status(status)
 * 
 *         if self.artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *             num_particles_per_species =  <int *>malloc(
 *                     sizeof(int)*num_species)
 */
  __pyx_t_16 = (__pyx_v_self->artio_handle->has_particles != 0);
  if (__pyx_t_16) {

    /* "yt/frontends/artio/_artio_caller.pyx":829
 * 
 *         if self.artio_handle.has_particles:
 *             num_particles_per_species =  <int *>malloc(             # <<<<<<<<<<<<<<
 *                     sizeof(int)*num_species)
 * 
 */
    __pyx_v_num_particles_per_species = ((int *)malloc(((sizeof(int)) * __pyx_v_num_species)));

    /* "yt/frontends/artio/_artio_caller.pyx":833
 * 
 *             # Now particles
 *             status = artio_particle_cache_sfc_range(self.handle, self.sfc_start,             # <<<<<<<<<<<<<<
 *                                             self.sfc_end)
 *             check_artio_status(status)
 */
    __pyx_v_status = artio_particle_cache_sfc_range(__pyx_v_self->handle, __pyx_v_self->sfc_start, __pyx_v_self->sfc_end);

    /* "yt/frontends/artio/_artio_caller.pyx":835
 *             status = artio_particle_cache_sfc_range(self.handle, self.sfc_start,
 *                                             self.sfc_end)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             for sfc in range(self.sfc_start, self.sfc_end + 1):
 *                 # Now particles
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":836
 *                                             self.sfc_end)
 *             check_artio_status(status)
 *             for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *                 # Now particles
 *                 status = artio_particle_read_root_cell_begin(self.handle,
 */
    __pyx_t_4 = (__pyx_v_self->sfc_end + 1);
    for (__pyx_t_14 = __pyx_v_self->sfc_start; __pyx_t_14 < __pyx_t_4; __pyx_t_14+=1) {
      __pyx_v_sfc = __pyx_t_14;

      /* "yt/frontends/artio/_artio_caller.pyx":838
 *             for sfc in range(self.sfc_start, self.sfc_end + 1):
 *                 # Now particles
 *                 status = artio_particle_read_root_cell_begin(self.handle,             # <<<<<<<<<<<<<<
 *                         sfc, num_particles_per_species)
 *                 check_artio_status(status)
 */
      __pyx_v_status = artio_particle_read_root_cell_begin(__pyx_v_self->handle, __pyx_v_sfc, __pyx_v_num_particles_per_species);

      /* "yt/frontends/artio/_artio_caller.pyx":840
 *                 status = artio_particle_read_root_cell_begin(self.handle,
 *                         sfc, num_particles_per_species)
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(num_species):
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

      /* "yt/frontends/artio/_artio_caller.pyx":842
 *                 check_artio_status(status)
 * 
 *                 for i in range(num_species):             # <<<<<<<<<<<<<<
 *                     self.pcount[i][sfc - self.sfc_start] = \
 *                         num_particles_per_species[i]
 */
      __pyx_t_1 = __pyx_v_num_species;
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_1; __pyx_t_18+=1) {
        __pyx_v_i = __pyx_t_18;

        /* "yt/frontends/artio/_artio_caller.pyx":843
 * 
 *                 for i in range(num_species):
 *                     self.pcount[i][sfc - self.sfc_start] = \             # <<<<<<<<<<<<<<
 *                         num_particles_per_species[i]
 * 
 */
        ((__pyx_v_self->pcount[__pyx_v_i])[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) = (__pyx_v_num_particles_per_species[__pyx_v_i]);
      }

      /* "yt/frontends/artio/_artio_caller.pyx":846
 *                         num_particles_per_species[i]
 * 
 *                 status = artio_particle_read_root_cell_end(self.handle)             # <<<<<<<<<<<<<<
 *                 check_artio_status(status)
 * 
 */
      __pyx_v_status = artio_particle_read_root_cell_end(__pyx_v_self->handle);

      /* "yt/frontends/artio/_artio_caller.pyx":847
 * 
 *                 status = artio_particle_read_root_cell_end(self.handle)
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *             status = artio_particle_clear_sfc_cache(self.handle)
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":849
 *                 check_artio_status(status)
 * 
 *             status = artio_particle_clear_sfc_cache(self.handle)             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 * 
 */
    __pyx_v_status = artio_particle_clear_sfc_cache(__pyx_v_self->handle);

    /* "yt/frontends/artio/_artio_caller.pyx":850
 * 
 *             status = artio_particle_clear_sfc_cache(self.handle)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *             free(num_particles_per_species)
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":852
 *             check_artio_status(status)
 * 
 *             free(num_particles_per_species)             # <<<<<<<<<<<<<<
 * 
 *         free(grid_variables)
 */
    free(__pyx_v_num_particles_per_species);

    /* "yt/frontends/artio/_artio_caller.pyx":828
 *         check_artio_status(status)
 * 
 *         if self.artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *             num_particles_per_species =  <int *>malloc(
 *                     sizeof(int)*num_species)
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":854
 *             free(num_particles_per_species)
 * 
 *         free(grid_variables)             # <<<<<<<<<<<<<<
 *         free(num_octs_per_level)
 *         self.oct_count = oct_count
 */
  free(__pyx_v_grid_variables);

  /* "yt/frontends/artio/_artio_caller.pyx":855
 * 
 *         free(grid_variables)
 *         free(num_octs_per_level)             # <<<<<<<<<<<<<<
 *         self.oct_count = oct_count
 *         self.doct_count = <np.int64_t *> oct_count.data
 */
  free(__pyx_v_num_octs_per_level);

  /* "yt/frontends/artio/_artio_caller.pyx":856
 *         free(grid_variables)
 *         free(num_octs_per_level)
 *         self.oct_count = oct_count             # <<<<<<<<<<<<<<
 *         self.doct_count = <np.int64_t *> oct_count.data
 *         self.root_mesh_handler = ARTIORootMeshContainer(self)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_oct_count));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_oct_count));
  __Pyx_GOTREF(__pyx_v_self->oct_count);
  __Pyx_DECREF(__pyx_v_self->oct_count);
  __pyx_v_self->oct_count = ((PyObject *)__pyx_v_oct_count);

  /* "yt/frontends/artio/_artio_caller.pyx":857
 *         free(num_octs_per_level)
 *         self.oct_count = oct_count
 *         self.doct_count = <np.int64_t *> oct_count.data             # <<<<<<<<<<<<<<
 *         self.root_mesh_handler = ARTIORootMeshContainer(self)
 * 
 */
  __pyx_v_self->doct_count = ((__pyx_t_5numpy_int64_t *)__pyx_v_oct_count->data);

  /* "yt/frontends/artio/_artio_caller.pyx":858
 *         self.oct_count = oct_count
 *         self.doct_count = <np.int64_t *> oct_count.data
 *         self.root_mesh_handler = ARTIORootMeshContainer(self)             # <<<<<<<<<<<<<<
 * 
 *     def free_mesh(self):
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->root_mesh_handler);
  __Pyx_DECREF(__pyx_v_self->root_mesh_handler);
  __pyx_v_self->root_mesh_handler = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":778
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def construct_mesh(self):             # <<<<<<<<<<<<<<
 *         cdef int status, level, ngv
 *         cdef np.int64_t sfc, oc, i
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oct_count.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.construct_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oct_count.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_octree);
  __Pyx_XDECREF((PyObject *)__pyx_v_oct_count);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":860
 *         self.root_mesh_handler = ARTIORootMeshContainer(self)
 * 
 *     def free_mesh(self):             # <<<<<<<<<<<<<<
 *         self.octree_handler = None
 *         self.root_mesh_handler = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7free_mesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7free_mesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_mesh (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_6free_mesh(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_6free_mesh(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_mesh", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":861
 * 
 *     def free_mesh(self):
 *         self.octree_handler = None             # <<<<<<<<<<<<<<
 *         self.root_mesh_handler = None
 *         self.doct_count = NULL
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->octree_handler);
  __Pyx_DECREF(__pyx_v_self->octree_handler);
  __pyx_v_self->octree_handler = Py_None;

  /* "yt/frontends/artio/_artio_caller.pyx":862
 *     def free_mesh(self):
 *         self.octree_handler = None
 *         self.root_mesh_handler = None             # <<<<<<<<<<<<<<
 *         self.doct_count = NULL
 *         self.oct_count = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->root_mesh_handler);
  __Pyx_DECREF(__pyx_v_self->root_mesh_handler);
  __pyx_v_self->root_mesh_handler = Py_None;

  /* "yt/frontends/artio/_artio_caller.pyx":863
 *         self.octree_handler = None
 *         self.root_mesh_handler = None
 *         self.doct_count = NULL             # <<<<<<<<<<<<<<
 *         self.oct_count = None
 * 
 */
  __pyx_v_self->doct_count = NULL;

  /* "yt/frontends/artio/_artio_caller.pyx":864
 *         self.root_mesh_handler = None
 *         self.doct_count = NULL
 *         self.oct_count = None             # <<<<<<<<<<<<<<
 * 
 * def get_coords(artio_fileset handle, np.int64_t s):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->oct_count);
  __Pyx_DECREF(__pyx_v_self->oct_count);
  __pyx_v_self->oct_count = Py_None;

  /* "yt/frontends/artio/_artio_caller.pyx":860
 *         self.root_mesh_handler = ARTIORootMeshContainer(self)
 * 
 *     def free_mesh(self):             # <<<<<<<<<<<<<<
 *         self.octree_handler = None
 *         self.root_mesh_handler = None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":706
 * 
 * cdef class ARTIOSFCRangeHandler:
 *     cdef public np.int64_t sfc_start             # <<<<<<<<<<<<<<
 *     cdef public np.int64_t sfc_end
 *     cdef public artio_fileset artio_handle
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->sfc_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.sfc_start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->sfc_start = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.sfc_start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":707
 * cdef class ARTIOSFCRangeHandler:
 *     cdef public np.int64_t sfc_start
 *     cdef public np.int64_t sfc_end             # <<<<<<<<<<<<<<
 *     cdef public artio_fileset artio_handle
 *     cdef public object root_mesh_handler
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->sfc_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.sfc_end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->sfc_end = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.sfc_end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":708
 *     cdef public np.int64_t sfc_start
 *     cdef public np.int64_t sfc_end
 *     cdef public artio_fileset artio_handle             # <<<<<<<<<<<<<<
 *     cdef public object root_mesh_handler
 *     cdef public object oct_count
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_r = ((PyObject *)__pyx_v_self->artio_handle);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.artio_handle.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":709
 *     cdef public np.int64_t sfc_end
 *     cdef public artio_fileset artio_handle
 *     cdef public object root_mesh_handler             # <<<<<<<<<<<<<<
 *     cdef public object oct_count
 *     cdef public object octree_handler
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->root_mesh_handler);
  __pyx_r = __pyx_v_self->root_mesh_handler;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->root_mesh_handler);
  __Pyx_DECREF(__pyx_v_self->root_mesh_handler);
  __pyx_v_self->root_mesh_handler = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->root_mesh_handler);
  __Pyx_DECREF(__pyx_v_self->root_mesh_handler);
  __pyx_v_self->root_mesh_handler = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":710
 *     cdef public artio_fileset artio_handle
 *     cdef public object root_mesh_handler
 *     cdef public object oct_count             # <<<<<<<<<<<<<<
 *     cdef public object octree_handler
 *     cdef artio_fileset_handle *handle
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->oct_count);
  __pyx_r = __pyx_v_self->oct_count;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->oct_count);
  __Pyx_DECREF(__pyx_v_self->oct_count);
  __pyx_v_self->oct_count = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->oct_count);
  __Pyx_DECREF(__pyx_v_self->oct_count);
  __pyx_v_self->oct_count = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":711
 *     cdef public object root_mesh_handler
 *     cdef public object oct_count
 *     cdef public object octree_handler             # <<<<<<<<<<<<<<
 *     cdef artio_fileset_handle *handle
 *     cdef np.float64_t DLE[3]
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->octree_handler);
  __pyx_r = __pyx_v_self->octree_handler;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->octree_handler);
  __Pyx_DECREF(__pyx_v_self->octree_handler);
  __pyx_v_self->octree_handler = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->octree_handler);
  __Pyx_DECREF(__pyx_v_self->octree_handler);
  __pyx_v_self->octree_handler = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":717
 *     cdef np.float64_t dds[3]
 *     cdef np.int64_t dims[3]
 *     cdef public np.int64_t total_octs             # <<<<<<<<<<<<<<
 *     cdef np.int64_t *doct_count
 *     cdef np.int64_t **pcount
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->total_octs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.total_octs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->total_octs = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler.total_octs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":866
 *         self.oct_count = None
 * 
 * def get_coords(artio_fileset handle, np.int64_t s):             # <<<<<<<<<<<<<<
 *     cdef int coords[3]
 *     artio_sfc_coords(handle.handle, s, coords)
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_3get_coords(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_2yt_9frontends_5artio_13_artio_caller_3get_coords = {"get_coords", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_3get_coords, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_3get_coords(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_handle = 0;
  __pyx_t_5numpy_int64_t __pyx_v_s;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_coords (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_s,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_coords", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_coords") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)values[0]);
    __pyx_v_s = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_s == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_coords", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.get_coords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_handle), __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset, 1, "handle", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_2get_coords(__pyx_self, __pyx_v_handle, __pyx_v_s);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_2get_coords(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_handle, __pyx_t_5numpy_int64_t __pyx_v_s) {
  int __pyx_v_coords[3];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_coords", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":868
 * def get_coords(artio_fileset handle, np.int64_t s):
 *     cdef int coords[3]
 *     artio_sfc_coords(handle.handle, s, coords)             # <<<<<<<<<<<<<<
 *     return (coords[0], coords[1], coords[2])
 * 
 */
  artio_sfc_coords(__pyx_v_handle->handle, __pyx_v_s, __pyx_v_coords);

  /* "yt/frontends/artio/_artio_caller.pyx":869
 *     cdef int coords[3]
 *     artio_sfc_coords(handle.handle, s, coords)
 *     return (coords[0], coords[1], coords[2])             # <<<<<<<<<<<<<<
 * 
 * cdef struct particle_var_pointers:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_coords[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_coords[1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_coords[2])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":866
 *         self.oct_count = None
 * 
 * def get_coords(artio_fileset handle, np.int64_t s):             # <<<<<<<<<<<<<<
 *     cdef int coords[3]
 *     artio_sfc_coords(handle.handle, s, coords)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.get_coords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":905
 *     cdef np.int64_t sfc_end
 * 
 *     def __init__(self, ARTIOSFCRangeHandler range_handler):             # <<<<<<<<<<<<<<
 *         self.range_handler = range_handler
 *         self.sfc_start = range_handler.sfc_start
 */

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_range_handler,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_range_handler)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_range_handler), __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, 1, "range_handler", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer___init__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self), __pyx_v_range_handler);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler) {
  PyObject *__pyx_v_dims = NULL;
  PyObject *__pyx_v_DLE = NULL;
  PyObject *__pyx_v_DRE = NULL;
  long __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":906
 * 
 *     def __init__(self, ARTIOSFCRangeHandler range_handler):
 *         self.range_handler = range_handler             # <<<<<<<<<<<<<<
 *         self.sfc_start = range_handler.sfc_start
 *         self.sfc_end = range_handler.sfc_end
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_range_handler));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_range_handler));
  __Pyx_GOTREF(__pyx_v_self->range_handler);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->range_handler));
  __pyx_v_self->range_handler = __pyx_v_range_handler;

  /* "yt/frontends/artio/_artio_caller.pyx":907
 *     def __init__(self, ARTIOSFCRangeHandler range_handler):
 *         self.range_handler = range_handler
 *         self.sfc_start = range_handler.sfc_start             # <<<<<<<<<<<<<<
 *         self.sfc_end = range_handler.sfc_end
 *         self.artio_handle = range_handler.artio_handle
 */
  __pyx_t_1 = __pyx_v_range_handler->sfc_start;
  __pyx_v_self->sfc_start = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":908
 *         self.range_handler = range_handler
 *         self.sfc_start = range_handler.sfc_start
 *         self.sfc_end = range_handler.sfc_end             # <<<<<<<<<<<<<<
 *         self.artio_handle = range_handler.artio_handle
 *         # Note the final argument is partial_coverage, which indicates whether
 */
  __pyx_t_1 = __pyx_v_range_handler->sfc_end;
  __pyx_v_self->sfc_end = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":909
 *         self.sfc_start = range_handler.sfc_start
 *         self.sfc_end = range_handler.sfc_end
 *         self.artio_handle = range_handler.artio_handle             # <<<<<<<<<<<<<<
 *         # Note the final argument is partial_coverage, which indicates whether
 *         # or not an Oct can be partially refined.
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_range_handler->artio_handle);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":912
 *         # Note the final argument is partial_coverage, which indicates whether
 *         # or not an Oct can be partially refined.
 *         dims, DLE, DRE = [], [], []             # <<<<<<<<<<<<<<
 *         for i in range(32):
 *             self.level_indices[i] = 0
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_dims = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_DLE = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_v_DRE = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":913
 *         # or not an Oct can be partially refined.
 *         dims, DLE, DRE = [], [], []
 *         for i in range(32):             # <<<<<<<<<<<<<<
 *             self.level_indices[i] = 0
 *         for i in range(3):
 */
  for (__pyx_t_5 = 0; __pyx_t_5 < 32; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "yt/frontends/artio/_artio_caller.pyx":914
 *         dims, DLE, DRE = [], [], []
 *         for i in range(32):
 *             self.level_indices[i] = 0             # <<<<<<<<<<<<<<
 *         for i in range(3):
 *             # range_handler has dims in cells, which is the same as the number
 */
    (__pyx_v_self->level_indices[__pyx_v_i]) = 0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":915
 *         for i in range(32):
 *             self.level_indices[i] = 0
 *         for i in range(3):             # <<<<<<<<<<<<<<
 *             # range_handler has dims in cells, which is the same as the number
 *             # of possible octs.  This is because we have a forest of octrees.
 */
  for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "yt/frontends/artio/_artio_caller.pyx":918
 *             # range_handler has dims in cells, which is the same as the number
 *             # of possible octs.  This is because we have a forest of octrees.
 *             dims.append(range_handler.dims[i])             # <<<<<<<<<<<<<<
 *             DLE.append(range_handler.DLE[i])
 *             DRE.append(range_handler.DRE[i])
 */
    __pyx_t_4 = __Pyx_PyInt_From_npy_int64((__pyx_v_range_handler->dims[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dims, __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":919
 *             # of possible octs.  This is because we have a forest of octrees.
 *             dims.append(range_handler.dims[i])
 *             DLE.append(range_handler.DLE[i])             # <<<<<<<<<<<<<<
 *             DRE.append(range_handler.DRE[i])
 *         super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE)
 */
    __pyx_t_4 = PyFloat_FromDouble((__pyx_v_range_handler->DLE[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_DLE, __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":920
 *             dims.append(range_handler.dims[i])
 *             DLE.append(range_handler.DLE[i])
 *             DRE.append(range_handler.DRE[i])             # <<<<<<<<<<<<<<
 *         super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE)
 *         self.artio_handle = range_handler.artio_handle
 */
    __pyx_t_4 = PyFloat_FromDouble((__pyx_v_range_handler->DRE[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_DRE, __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":921
 *             DLE.append(range_handler.DLE[i])
 *             DRE.append(range_handler.DRE[i])
 *         super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE)             # <<<<<<<<<<<<<<
 *         self.artio_handle = range_handler.artio_handle
 *         self.level_offset = 1
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_dims);
  __Pyx_GIVEREF(__pyx_v_dims);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_dims);
  __Pyx_INCREF(__pyx_v_DLE);
  __Pyx_GIVEREF(__pyx_v_DLE);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_DLE);
  __Pyx_INCREF(__pyx_v_DRE);
  __Pyx_GIVEREF(__pyx_v_DRE);
  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_DRE);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":922
 *             DRE.append(range_handler.DRE[i])
 *         super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE)
 *         self.artio_handle = range_handler.artio_handle             # <<<<<<<<<<<<<<
 *         self.level_offset = 1
 *         self.domains = NULL
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_range_handler->artio_handle);
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":923
 *         super(ARTIOOctreeContainer, self).__init__(dims, DLE, DRE)
 *         self.artio_handle = range_handler.artio_handle
 *         self.level_offset = 1             # <<<<<<<<<<<<<<
 *         self.domains = NULL
 *         self.root_nodes = NULL
 */
  __pyx_v_self->__pyx_base.__pyx_base.level_offset = 1;

  /* "yt/frontends/artio/_artio_caller.pyx":924
 *         self.artio_handle = range_handler.artio_handle
 *         self.level_offset = 1
 *         self.domains = NULL             # <<<<<<<<<<<<<<
 *         self.root_nodes = NULL
 * 
 */
  __pyx_v_self->__pyx_base.__pyx_base.domains = NULL;

  /* "yt/frontends/artio/_artio_caller.pyx":925
 *         self.level_offset = 1
 *         self.domains = NULL
 *         self.root_nodes = NULL             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_v_self->__pyx_base.root_nodes = NULL;

  /* "yt/frontends/artio/_artio_caller.pyx":905
 *     cdef np.int64_t sfc_end
 * 
 *     def __init__(self, ARTIOSFCRangeHandler range_handler):             # <<<<<<<<<<<<<<
 *         self.range_handler = range_handler
 *         self.sfc_start = range_handler.sfc_start
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dims);
  __Pyx_XDECREF(__pyx_v_DLE);
  __Pyx_XDECREF(__pyx_v_DRE);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":930
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void initialize_local_mesh(self, np.int64_t oct_count,             # <<<<<<<<<<<<<<
 *                               int num_oct_levels, int *num_octs_per_level,
 *                               np.int64_t sfc):
 */

static void __pyx_f_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_initialize_local_mesh(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_oct_count, int __pyx_v_num_oct_levels, int *__pyx_v_num_octs_per_level, __pyx_t_5numpy_int64_t __pyx_v_sfc) {
  __pyx_t_5numpy_int64_t __pyx_v_oct_ind;
  __pyx_t_5numpy_int64_t __pyx_v_ipos;
  __pyx_t_5numpy_int64_t __pyx_v_nadded;
  int __pyx_v_i;
  int __pyx_v_status;
  int __pyx_v_level;
  artio_fileset *__pyx_v_handle;
  CYTHON_UNUSED int __pyx_v_max_level;
  double __pyx_v_dpos[3];
  PyArrayObject *__pyx_v_pos = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_RefNannyDeclarations
  artio_fileset *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __pyx_t_5numpy_int64_t __pyx_t_13;
  int __pyx_t_14;
  __pyx_t_5numpy_int64_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize_local_mesh", 0);
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;

  /* "yt/frontends/artio/_artio_caller.pyx":938
 *         cdef int i, status, level, num_root, num_octs
 *         cdef int num_level_octs
 *         cdef artio_fileset_handle *handle = self.artio_handle.handle             # <<<<<<<<<<<<<<
 *         cdef int coords[3]
 *         cdef int max_level = self.artio_handle.max_level
 */
  __pyx_t_1 = __pyx_v_self->artio_handle->handle;
  __pyx_v_handle = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":940
 *         cdef artio_fileset_handle *handle = self.artio_handle.handle
 *         cdef int coords[3]
 *         cdef int max_level = self.artio_handle.max_level             # <<<<<<<<<<<<<<
 *         cdef double dpos[3]
 *         cdef np.float64_t f64pos[3]
 */
  __pyx_t_2 = __pyx_v_self->artio_handle->max_level;
  __pyx_v_max_level = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":949
 * 
 *         # We only allow one root oct.
 *         self.append_domain(oct_count)             # <<<<<<<<<<<<<<
 *         self.domains[self.num_domains - 1].con_id = sfc
 * 
 */
  ((struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.append_domain(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_oct_count);

  /* "yt/frontends/artio/_artio_caller.pyx":950
 *         # We only allow one root oct.
 *         self.append_domain(oct_count)
 *         self.domains[self.num_domains - 1].con_id = sfc             # <<<<<<<<<<<<<<
 * 
 *         oct_ind = -1
 */
  (__pyx_v_self->__pyx_base.__pyx_base.domains[(__pyx_v_self->__pyx_base.__pyx_base.num_domains - 1)])->con_id = __pyx_v_sfc;

  /* "yt/frontends/artio/_artio_caller.pyx":952
 *         self.domains[self.num_domains - 1].con_id = sfc
 * 
 *         oct_ind = -1             # <<<<<<<<<<<<<<
 *         ipos = 0
 *         for level in range(num_oct_levels):
 */
  __pyx_v_oct_ind = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":953
 * 
 *         oct_ind = -1
 *         ipos = 0             # <<<<<<<<<<<<<<
 *         for level in range(num_oct_levels):
 *             oct_ind = imax(oct_ind, num_octs_per_level[level])
 */
  __pyx_v_ipos = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":954
 *         oct_ind = -1
 *         ipos = 0
 *         for level in range(num_oct_levels):             # <<<<<<<<<<<<<<
 *             oct_ind = imax(oct_ind, num_octs_per_level[level])
 *             self.level_indices[level] = ipos
 */
  __pyx_t_2 = __pyx_v_num_oct_levels;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_level = __pyx_t_3;

    /* "yt/frontends/artio/_artio_caller.pyx":955
 *         ipos = 0
 *         for level in range(num_oct_levels):
 *             oct_ind = imax(oct_ind, num_octs_per_level[level])             # <<<<<<<<<<<<<<
 *             self.level_indices[level] = ipos
 *             ipos += num_octs_per_level[level]
 */
    __pyx_v_oct_ind = __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_v_oct_ind, (__pyx_v_num_octs_per_level[__pyx_v_level]));

    /* "yt/frontends/artio/_artio_caller.pyx":956
 *         for level in range(num_oct_levels):
 *             oct_ind = imax(oct_ind, num_octs_per_level[level])
 *             self.level_indices[level] = ipos             # <<<<<<<<<<<<<<
 *             ipos += num_octs_per_level[level]
 *         pos = np.empty((oct_ind, 3), dtype="float64")
 */
    (__pyx_v_self->level_indices[__pyx_v_level]) = __pyx_v_ipos;

    /* "yt/frontends/artio/_artio_caller.pyx":957
 *             oct_ind = imax(oct_ind, num_octs_per_level[level])
 *             self.level_indices[level] = ipos
 *             ipos += num_octs_per_level[level]             # <<<<<<<<<<<<<<
 *         pos = np.empty((oct_ind, 3), dtype="float64")
 * 
 */
    __pyx_v_ipos = (__pyx_v_ipos + (__pyx_v_num_octs_per_level[__pyx_v_level]));
  }

  /* "yt/frontends/artio/_artio_caller.pyx":958
 *             self.level_indices[level] = ipos
 *             ipos += num_octs_per_level[level]
 *         pos = np.empty((oct_ind, 3), dtype="float64")             # <<<<<<<<<<<<<<
 * 
 *         # Now we initialize
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_oct_ind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_pos = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":962
 *         # Now we initialize
 *         # Note that we also assume we have already started reading the level.
 *         ipos = 0             # <<<<<<<<<<<<<<
 *         for level in range(num_oct_levels):
 *             status = artio_grid_read_level_begin(handle, level + 1)
 */
  __pyx_v_ipos = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":963
 *         # Note that we also assume we have already started reading the level.
 *         ipos = 0
 *         for level in range(num_oct_levels):             # <<<<<<<<<<<<<<
 *             status = artio_grid_read_level_begin(handle, level + 1)
 *             check_artio_status(status)
 */
  __pyx_t_2 = __pyx_v_num_oct_levels;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_level = __pyx_t_3;

    /* "yt/frontends/artio/_artio_caller.pyx":964
 *         ipos = 0
 *         for level in range(num_oct_levels):
 *             status = artio_grid_read_level_begin(handle, level + 1)             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 *             for oct_ind in range(num_octs_per_level[level]):
 */
    __pyx_v_status = artio_grid_read_level_begin(__pyx_v_handle, (__pyx_v_level + 1));

    /* "yt/frontends/artio/_artio_caller.pyx":965
 *         for level in range(num_oct_levels):
 *             status = artio_grid_read_level_begin(handle, level + 1)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             for oct_ind in range(num_octs_per_level[level]):
 *                 status = artio_grid_read_oct(handle, dpos, NULL, NULL)
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":966
 *             status = artio_grid_read_level_begin(handle, level + 1)
 *             check_artio_status(status)
 *             for oct_ind in range(num_octs_per_level[level]):             # <<<<<<<<<<<<<<
 *                 status = artio_grid_read_oct(handle, dpos, NULL, NULL)
 *                 for i in range(3):
 */
    __pyx_t_12 = (__pyx_v_num_octs_per_level[__pyx_v_level]);
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_oct_ind = __pyx_t_13;

      /* "yt/frontends/artio/_artio_caller.pyx":967
 *             check_artio_status(status)
 *             for oct_ind in range(num_octs_per_level[level]):
 *                 status = artio_grid_read_oct(handle, dpos, NULL, NULL)             # <<<<<<<<<<<<<<
 *                 for i in range(3):
 *                     pos[oct_ind, i] = dpos[i]
 */
      __pyx_v_status = artio_grid_read_oct(__pyx_v_handle, __pyx_v_dpos, NULL, NULL);

      /* "yt/frontends/artio/_artio_caller.pyx":968
 *             for oct_ind in range(num_octs_per_level[level]):
 *                 status = artio_grid_read_oct(handle, dpos, NULL, NULL)
 *                 for i in range(3):             # <<<<<<<<<<<<<<
 *                     pos[oct_ind, i] = dpos[i]
 *                 check_artio_status(status)
 */
      for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) {
        __pyx_v_i = __pyx_t_14;

        /* "yt/frontends/artio/_artio_caller.pyx":969
 *                 status = artio_grid_read_oct(handle, dpos, NULL, NULL)
 *                 for i in range(3):
 *                     pos[oct_ind, i] = dpos[i]             # <<<<<<<<<<<<<<
 *                 check_artio_status(status)
 *             status = artio_grid_read_level_end(handle)
 */
        __pyx_t_15 = __pyx_v_oct_ind;
        __pyx_t_16 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_pos.diminfo[1].strides) = (__pyx_v_dpos[__pyx_v_i]);
      }

      /* "yt/frontends/artio/_artio_caller.pyx":970
 *                 for i in range(3):
 *                     pos[oct_ind, i] = dpos[i]
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 *             status = artio_grid_read_level_end(handle)
 *             check_artio_status(status)
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":971
 *                     pos[oct_ind, i] = dpos[i]
 *                 check_artio_status(status)
 *             status = artio_grid_read_level_end(handle)             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 *             nadded = self.add(self.num_domains, level, pos[:num_octs_per_level[level],:])
 */
    __pyx_v_status = artio_grid_read_level_end(__pyx_v_handle);

    /* "yt/frontends/artio/_artio_caller.pyx":972
 *                 check_artio_status(status)
 *             status = artio_grid_read_level_end(handle)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             nadded = self.add(self.num_domains, level, pos[:num_octs_per_level[level],:])
 *             if nadded != num_octs_per_level[level]:
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":973
 *             status = artio_grid_read_level_end(handle)
 *             check_artio_status(status)
 *             nadded = self.add(self.num_domains, level, pos[:num_octs_per_level[level],:])             # <<<<<<<<<<<<<<
 *             if nadded != num_octs_per_level[level]:
 *                 raise RuntimeError
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.num_domains); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_level); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_17 = __Pyx_PyInt_From_int((__pyx_v_num_octs_per_level[__pyx_v_level])); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_18 = PySlice_New(Py_None, __pyx_t_17, Py_None); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_18);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_GIVEREF(__pyx_t_18);
    PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18);
    __Pyx_INCREF(__pyx_slice__29);
    __Pyx_GIVEREF(__pyx_slice__29);
    PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_slice__29);
    __pyx_t_18 = 0;
    __pyx_t_18 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_17); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_18);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_17 = NULL;
    __pyx_t_19 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_17)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_17);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_19 = 1;
      }
    }
    __pyx_t_20 = PyTuple_New(3+__pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    if (__pyx_t_17) {
      __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17); __pyx_t_17 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_18);
    PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_18);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_18 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_20, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_13 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_nadded = __pyx_t_13;

    /* "yt/frontends/artio/_artio_caller.pyx":974
 *             check_artio_status(status)
 *             nadded = self.add(self.num_domains, level, pos[:num_octs_per_level[level],:])
 *             if nadded != num_octs_per_level[level]:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError
 * 
 */
    __pyx_t_21 = ((__pyx_v_nadded != (__pyx_v_num_octs_per_level[__pyx_v_level])) != 0);
    if (__pyx_t_21) {

      /* "yt/frontends/artio/_artio_caller.pyx":975
 *             nadded = self.add(self.num_domains, level, pos[:num_octs_per_level[level],:])
 *             if nadded != num_octs_per_level[level]:
 *                 raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
      __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "yt/frontends/artio/_artio_caller.pyx":974
 *             check_artio_status(status)
 *             nadded = self.add(self.num_domains, level, pos[:num_octs_per_level[level],:])
 *             if nadded != num_octs_per_level[level]:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError
 * 
 */
    }
  }

  /* "yt/frontends/artio/_artio_caller.pyx":930
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void initialize_local_mesh(self, np.int64_t oct_count,             # <<<<<<<<<<<<<<
 *                               int num_oct_levels, int *num_octs_per_level,
 *                               np.int64_t sfc):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.initialize_local_mesh", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_RefNannyFinishContext();
}

/* "yt/frontends/artio/_artio_caller.pyx":980
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fill_sfc(self,             # <<<<<<<<<<<<<<
 *              np.ndarray[np.uint8_t, ndim=1] levels,
 *              np.ndarray[np.uint8_t, ndim=1] cell_inds,
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_3fill_sfc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_3fill_sfc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_levels = 0;
  PyArrayObject *__pyx_v_cell_inds = 0;
  PyArrayObject *__pyx_v_file_inds = 0;
  PyArrayObject *__pyx_v_domain_counts = 0;
  PyObject *__pyx_v_field_indices = 0;
  PyObject *__pyx_v_dest_fields = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fill_sfc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,&__pyx_n_s_cell_inds,&__pyx_n_s_file_inds,&__pyx_n_s_domain_counts,&__pyx_n_s_field_indices,&__pyx_n_s_dest_fields,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cell_inds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_inds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_fields)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_sfc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_levels = ((PyArrayObject *)values[0]);
    __pyx_v_cell_inds = ((PyArrayObject *)values[1]);
    __pyx_v_file_inds = ((PyArrayObject *)values[2]);
    __pyx_v_domain_counts = ((PyArrayObject *)values[3]);
    __pyx_v_field_indices = values[4];
    __pyx_v_dest_fields = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.fill_sfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cell_inds), __pyx_ptype_5numpy_ndarray, 1, "cell_inds", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_inds), __pyx_ptype_5numpy_ndarray, 1, "file_inds", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain_counts), __pyx_ptype_5numpy_ndarray, 1, "domain_counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_2fill_sfc(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self), __pyx_v_levels, __pyx_v_cell_inds, __pyx_v_file_inds, __pyx_v_domain_counts, __pyx_v_field_indices, __pyx_v_dest_fields);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_2fill_sfc(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyArrayObject *__pyx_v_domain_counts, PyObject *__pyx_v_field_indices, PyObject *__pyx_v_dest_fields) {
  PyArrayObject *__pyx_v_source = 0;
  PyArrayObject *__pyx_v_dest = 0;
  int __pyx_v_status;
  int __pyx_v_i;
  int __pyx_v_num_oct_levels;
  int __pyx_v_nf;
  int __pyx_v_ngv;
  int __pyx_v_max_level;
  int __pyx_v_level;
  int __pyx_v_j;
  int __pyx_v_oct_ind;
  int __pyx_v_si;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_ipos;
  artio_fileset *__pyx_v_handle;
  double __pyx_v_dpos[3];
  int *__pyx_v_num_octs_per_level;
  float *__pyx_v_grid_variables;
  int *__pyx_v_field_ind;
  __pyx_t_5numpy_float32_t **__pyx_v_field_vals;
  PyObject *__pyx_v_source_arrays = NULL;
  __pyx_t_5numpy_int64_t __pyx_v_level_position[32];
  __pyx_t_5numpy_int64_t __pyx_v_lp;
  __pyx_t_5numpy_int64_t __pyx_v_sfc_start;
  __pyx_t_5numpy_int64_t __pyx_v_sfc_end;
  __pyx_t_5numpy_int64_t __pyx_v_offset;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_cell_inds;
  __Pyx_Buffer __pyx_pybuffer_cell_inds;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dest;
  __Pyx_Buffer __pyx_pybuffer_dest;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_counts;
  __Pyx_Buffer __pyx_pybuffer_domain_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_file_inds;
  __Pyx_Buffer __pyx_pybuffer_file_inds;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_levels;
  __Pyx_Buffer __pyx_pybuffer_levels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_source;
  __Pyx_Buffer __pyx_pybuffer_source;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  artio_fileset *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __pyx_t_5numpy_int64_t __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;
  PyArrayObject *__pyx_t_22 = NULL;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_int64_t __pyx_t_24;
  __pyx_t_5numpy_int64_t __pyx_t_25;
  __pyx_t_5numpy_int64_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  size_t __pyx_t_28;
  __pyx_t_5numpy_int64_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fill_sfc", 0);
  __pyx_pybuffer_source.pybuffer.buf = NULL;
  __pyx_pybuffer_source.refcount = 0;
  __pyx_pybuffernd_source.data = NULL;
  __pyx_pybuffernd_source.rcbuffer = &__pyx_pybuffer_source;
  __pyx_pybuffer_dest.pybuffer.buf = NULL;
  __pyx_pybuffer_dest.refcount = 0;
  __pyx_pybuffernd_dest.data = NULL;
  __pyx_pybuffernd_dest.rcbuffer = &__pyx_pybuffer_dest;
  __pyx_pybuffer_levels.pybuffer.buf = NULL;
  __pyx_pybuffer_levels.refcount = 0;
  __pyx_pybuffernd_levels.data = NULL;
  __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels;
  __pyx_pybuffer_cell_inds.pybuffer.buf = NULL;
  __pyx_pybuffer_cell_inds.refcount = 0;
  __pyx_pybuffernd_cell_inds.data = NULL;
  __pyx_pybuffernd_cell_inds.rcbuffer = &__pyx_pybuffer_cell_inds;
  __pyx_pybuffer_file_inds.pybuffer.buf = NULL;
  __pyx_pybuffer_file_inds.refcount = 0;
  __pyx_pybuffernd_file_inds.data = NULL;
  __pyx_pybuffernd_file_inds.rcbuffer = &__pyx_pybuffer_file_inds;
  __pyx_pybuffer_domain_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_domain_counts.refcount = 0;
  __pyx_pybuffernd_domain_counts.data = NULL;
  __pyx_pybuffernd_domain_counts.rcbuffer = &__pyx_pybuffer_domain_counts;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_cell_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_cell_inds.diminfo[0].strides = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cell_inds.diminfo[0].shape = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_file_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_file_inds.diminfo[0].strides = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_file_inds.diminfo[0].shape = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_domain_counts.diminfo[0].strides = __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_counts.diminfo[0].shape = __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.shape[0];

  /* "yt/frontends/artio/_artio_caller.pyx":992
 *         cdef np.int64_t sfc, ipos
 *         cdef np.float64_t val
 *         cdef artio_fileset_handle *handle = self.artio_handle.handle             # <<<<<<<<<<<<<<
 *         cdef double dpos[3]
 *         # We duplicate some of the grid_variables stuff here so that we can
 */
  __pyx_t_1 = __pyx_v_self->artio_handle->handle;
  __pyx_v_handle = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":996
 *         # We duplicate some of the grid_variables stuff here so that we can
 *         # potentially release the GIL
 *         nf = len(field_indices)             # <<<<<<<<<<<<<<
 *         ngv = self.artio_handle.num_grid_variables
 *         max_level = self.artio_handle.max_level
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_field_indices); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nf = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":997
 *         # potentially release the GIL
 *         nf = len(field_indices)
 *         ngv = self.artio_handle.num_grid_variables             # <<<<<<<<<<<<<<
 *         max_level = self.artio_handle.max_level
 *         cdef int *num_octs_per_level = <int *>malloc(
 */
  __pyx_t_3 = __pyx_v_self->artio_handle->num_grid_variables;
  __pyx_v_ngv = __pyx_t_3;

  /* "yt/frontends/artio/_artio_caller.pyx":998
 *         nf = len(field_indices)
 *         ngv = self.artio_handle.num_grid_variables
 *         max_level = self.artio_handle.max_level             # <<<<<<<<<<<<<<
 *         cdef int *num_octs_per_level = <int *>malloc(
 *             (max_level + 1)*sizeof(int))
 */
  __pyx_t_3 = __pyx_v_self->artio_handle->max_level;
  __pyx_v_max_level = __pyx_t_3;

  /* "yt/frontends/artio/_artio_caller.pyx":999
 *         ngv = self.artio_handle.num_grid_variables
 *         max_level = self.artio_handle.max_level
 *         cdef int *num_octs_per_level = <int *>malloc(             # <<<<<<<<<<<<<<
 *             (max_level + 1)*sizeof(int))
 *         cdef float *grid_variables = <float *>malloc(
 */
  __pyx_v_num_octs_per_level = ((int *)malloc(((__pyx_v_max_level + 1) * (sizeof(int)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1001
 *         cdef int *num_octs_per_level = <int *>malloc(
 *             (max_level + 1)*sizeof(int))
 *         cdef float *grid_variables = <float *>malloc(             # <<<<<<<<<<<<<<
 *             8 * ngv * sizeof(float))
 *         cdef int* field_ind = <int*> malloc(
 */
  __pyx_v_grid_variables = ((float *)malloc(((8 * __pyx_v_ngv) * (sizeof(float)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1003
 *         cdef float *grid_variables = <float *>malloc(
 *             8 * ngv * sizeof(float))
 *         cdef int* field_ind = <int*> malloc(             # <<<<<<<<<<<<<<
 *             nf * sizeof(int))
 *         cdef np.float32_t **field_vals = <np.float32_t**> malloc(
 */
  __pyx_v_field_ind = ((int *)malloc((__pyx_v_nf * (sizeof(int)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1005
 *         cdef int* field_ind = <int*> malloc(
 *             nf * sizeof(int))
 *         cdef np.float32_t **field_vals = <np.float32_t**> malloc(             # <<<<<<<<<<<<<<
 *             nf * sizeof(np.float32_t*))
 *         source_arrays = []
 */
  __pyx_v_field_vals = ((__pyx_t_5numpy_float32_t **)malloc((__pyx_v_nf * (sizeof(__pyx_t_5numpy_float32_t *)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1007
 *         cdef np.float32_t **field_vals = <np.float32_t**> malloc(
 *             nf * sizeof(np.float32_t*))
 *         source_arrays = []             # <<<<<<<<<<<<<<
 *         ipos = -1
 *         for i in range(self.num_domains):
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_source_arrays = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1008
 *             nf * sizeof(np.float32_t*))
 *         source_arrays = []
 *         ipos = -1             # <<<<<<<<<<<<<<
 *         for i in range(self.num_domains):
 *             ipos = imax(ipos, self.domains[i].n)
 */
  __pyx_v_ipos = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1009
 *         source_arrays = []
 *         ipos = -1
 *         for i in range(self.num_domains):             # <<<<<<<<<<<<<<
 *             ipos = imax(ipos, self.domains[i].n)
 *         for i in range(nf):
 */
  __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.num_domains;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "yt/frontends/artio/_artio_caller.pyx":1010
 *         ipos = -1
 *         for i in range(self.num_domains):
 *             ipos = imax(ipos, self.domains[i].n)             # <<<<<<<<<<<<<<
 *         for i in range(nf):
 *             field_ind[i] = field_indices[i]
 */
    __pyx_v_ipos = __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_v_ipos, (__pyx_v_self->__pyx_base.__pyx_base.domains[__pyx_v_i])->n);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1011
 *         for i in range(self.num_domains):
 *             ipos = imax(ipos, self.domains[i].n)
 *         for i in range(nf):             # <<<<<<<<<<<<<<
 *             field_ind[i] = field_indices[i]
 *             # Note that we subtract one, because we're not using the root mesh.
 */
  __pyx_t_3 = __pyx_v_nf;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "yt/frontends/artio/_artio_caller.pyx":1012
 *             ipos = imax(ipos, self.domains[i].n)
 *         for i in range(nf):
 *             field_ind[i] = field_indices[i]             # <<<<<<<<<<<<<<
 *             # Note that we subtract one, because we're not using the root mesh.
 *             source = np.zeros((ipos, 8), dtype="float32")
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_field_indices, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_field_ind[__pyx_v_i]) = __pyx_t_6;

    /* "yt/frontends/artio/_artio_caller.pyx":1014
 *             field_ind[i] = field_indices[i]
 *             # Note that we subtract one, because we're not using the root mesh.
 *             source = np.zeros((ipos, 8), dtype="float32")             # <<<<<<<<<<<<<<
 *             source_arrays.append(source)
 *             field_vals[i] = <np.float32_t*> source.data
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_ipos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_8);
    __Pyx_GIVEREF(__pyx_int_8);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_8);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_float32) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_9);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)__pyx_v_source, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_source.diminfo[0].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_source.diminfo[0].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_source.diminfo[1].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_source.diminfo[1].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_source, ((PyArrayObject *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1015
 *             # Note that we subtract one, because we're not using the root mesh.
 *             source = np.zeros((ipos, 8), dtype="float32")
 *             source_arrays.append(source)             # <<<<<<<<<<<<<<
 *             field_vals[i] = <np.float32_t*> source.data
 *         cdef np.int64_t level_position[32]
 */
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_source_arrays, ((PyObject *)__pyx_v_source)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":1016
 *             source = np.zeros((ipos, 8), dtype="float32")
 *             source_arrays.append(source)
 *             field_vals[i] = <np.float32_t*> source.data             # <<<<<<<<<<<<<<
 *         cdef np.int64_t level_position[32]
 *         cdef np.int64_t lp
 */
    (__pyx_v_field_vals[__pyx_v_i]) = ((__pyx_t_5numpy_float32_t *)__pyx_v_source->data);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1030
 *         # The cons should be in order
 *         cdef np.int64_t sfc_start, sfc_end
 *         sfc_start = self.domains[0].con_id             # <<<<<<<<<<<<<<
 *         sfc_end = self.domains[self.num_domains - 1].con_id
 *         status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end)
 */
  __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains[0])->con_id;
  __pyx_v_sfc_start = __pyx_t_15;

  /* "yt/frontends/artio/_artio_caller.pyx":1031
 *         cdef np.int64_t sfc_start, sfc_end
 *         sfc_start = self.domains[0].con_id
 *         sfc_end = self.domains[self.num_domains - 1].con_id             # <<<<<<<<<<<<<<
 *         status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end)
 *         check_artio_status(status)
 */
  __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains[(__pyx_v_self->__pyx_base.__pyx_base.num_domains - 1)])->con_id;
  __pyx_v_sfc_end = __pyx_t_15;

  /* "yt/frontends/artio/_artio_caller.pyx":1032
 *         sfc_start = self.domains[0].con_id
 *         sfc_end = self.domains[self.num_domains - 1].con_id
 *         status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end)             # <<<<<<<<<<<<<<
 *         check_artio_status(status)
 *         cdef np.int64_t offset = 0
 */
  __pyx_v_status = artio_grid_cache_sfc_range(__pyx_v_handle, __pyx_v_sfc_start, __pyx_v_sfc_end);

  /* "yt/frontends/artio/_artio_caller.pyx":1033
 *         sfc_end = self.domains[self.num_domains - 1].con_id
 *         status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end)
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 *         cdef np.int64_t offset = 0
 *         for si in range(self.num_domains):
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":1034
 *         status = artio_grid_cache_sfc_range(handle, sfc_start, sfc_end)
 *         check_artio_status(status)
 *         cdef np.int64_t offset = 0             # <<<<<<<<<<<<<<
 *         for si in range(self.num_domains):
 *             sfc = self.domains[si].con_id
 */
  __pyx_v_offset = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1035
 *         check_artio_status(status)
 *         cdef np.int64_t offset = 0
 *         for si in range(self.num_domains):             # <<<<<<<<<<<<<<
 *             sfc = self.domains[si].con_id
 *             status = artio_grid_read_root_cell_begin( handle, sfc,
 */
  __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.num_domains;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_si = __pyx_t_5;

    /* "yt/frontends/artio/_artio_caller.pyx":1036
 *         cdef np.int64_t offset = 0
 *         for si in range(self.num_domains):
 *             sfc = self.domains[si].con_id             # <<<<<<<<<<<<<<
 *             status = artio_grid_read_root_cell_begin( handle, sfc,
 *                     dpos, NULL, &num_oct_levels, num_octs_per_level)
 */
    __pyx_t_15 = (__pyx_v_self->__pyx_base.__pyx_base.domains[__pyx_v_si])->con_id;
    __pyx_v_sfc = __pyx_t_15;

    /* "yt/frontends/artio/_artio_caller.pyx":1037
 *         for si in range(self.num_domains):
 *             sfc = self.domains[si].con_id
 *             status = artio_grid_read_root_cell_begin( handle, sfc,             # <<<<<<<<<<<<<<
 *                     dpos, NULL, &num_oct_levels, num_octs_per_level)
 *             check_artio_status(status)
 */
    __pyx_v_status = artio_grid_read_root_cell_begin(__pyx_v_handle, __pyx_v_sfc, __pyx_v_dpos, NULL, (&__pyx_v_num_oct_levels), __pyx_v_num_octs_per_level);

    /* "yt/frontends/artio/_artio_caller.pyx":1039
 *             status = artio_grid_read_root_cell_begin( handle, sfc,
 *                     dpos, NULL, &num_oct_levels, num_octs_per_level)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             lp = 0
 *             for level in range(num_oct_levels):
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":1040
 *                     dpos, NULL, &num_oct_levels, num_octs_per_level)
 *             check_artio_status(status)
 *             lp = 0             # <<<<<<<<<<<<<<
 *             for level in range(num_oct_levels):
 *                 status = artio_grid_read_level_begin(handle, level + 1)
 */
    __pyx_v_lp = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1041
 *             check_artio_status(status)
 *             lp = 0
 *             for level in range(num_oct_levels):             # <<<<<<<<<<<<<<
 *                 status = artio_grid_read_level_begin(handle, level + 1)
 *                 check_artio_status(status)
 */
    __pyx_t_6 = __pyx_v_num_oct_levels;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_6; __pyx_t_16+=1) {
      __pyx_v_level = __pyx_t_16;

      /* "yt/frontends/artio/_artio_caller.pyx":1042
 *             lp = 0
 *             for level in range(num_oct_levels):
 *                 status = artio_grid_read_level_begin(handle, level + 1)             # <<<<<<<<<<<<<<
 *                 check_artio_status(status)
 *                 level_position[level] = lp
 */
      __pyx_v_status = artio_grid_read_level_begin(__pyx_v_handle, (__pyx_v_level + 1));

      /* "yt/frontends/artio/_artio_caller.pyx":1043
 *             for level in range(num_oct_levels):
 *                 status = artio_grid_read_level_begin(handle, level + 1)
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 *                 level_position[level] = lp
 *                 for oct_ind in range(num_octs_per_level[level]):
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

      /* "yt/frontends/artio/_artio_caller.pyx":1044
 *                 status = artio_grid_read_level_begin(handle, level + 1)
 *                 check_artio_status(status)
 *                 level_position[level] = lp             # <<<<<<<<<<<<<<
 *                 for oct_ind in range(num_octs_per_level[level]):
 *                     status = artio_grid_read_oct(handle, dpos, grid_variables, NULL)
 */
      (__pyx_v_level_position[__pyx_v_level]) = __pyx_v_lp;

      /* "yt/frontends/artio/_artio_caller.pyx":1045
 *                 check_artio_status(status)
 *                 level_position[level] = lp
 *                 for oct_ind in range(num_octs_per_level[level]):             # <<<<<<<<<<<<<<
 *                     status = artio_grid_read_oct(handle, dpos, grid_variables, NULL)
 *                     check_artio_status(status)
 */
      __pyx_t_17 = (__pyx_v_num_octs_per_level[__pyx_v_level]);
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
        __pyx_v_oct_ind = __pyx_t_18;

        /* "yt/frontends/artio/_artio_caller.pyx":1046
 *                 level_position[level] = lp
 *                 for oct_ind in range(num_octs_per_level[level]):
 *                     status = artio_grid_read_oct(handle, dpos, grid_variables, NULL)             # <<<<<<<<<<<<<<
 *                     check_artio_status(status)
 *                     for j in range(8):
 */
        __pyx_v_status = artio_grid_read_oct(__pyx_v_handle, __pyx_v_dpos, __pyx_v_grid_variables, NULL);

        /* "yt/frontends/artio/_artio_caller.pyx":1047
 *                 for oct_ind in range(num_octs_per_level[level]):
 *                     status = artio_grid_read_oct(handle, dpos, grid_variables, NULL)
 *                     check_artio_status(status)             # <<<<<<<<<<<<<<
 *                     for j in range(8):
 *                         for i in range(nf):
 */
        __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

        /* "yt/frontends/artio/_artio_caller.pyx":1048
 *                     status = artio_grid_read_oct(handle, dpos, grid_variables, NULL)
 *                     check_artio_status(status)
 *                     for j in range(8):             # <<<<<<<<<<<<<<
 *                         for i in range(nf):
 *                             field_vals[i][(oct_ind + lp)*8+j] = \
 */
        for (__pyx_t_19 = 0; __pyx_t_19 < 8; __pyx_t_19+=1) {
          __pyx_v_j = __pyx_t_19;

          /* "yt/frontends/artio/_artio_caller.pyx":1049
 *                     check_artio_status(status)
 *                     for j in range(8):
 *                         for i in range(nf):             # <<<<<<<<<<<<<<
 *                             field_vals[i][(oct_ind + lp)*8+j] = \
 *                                 grid_variables[ngv*j+field_ind[i]]
 */
          __pyx_t_20 = __pyx_v_nf;
          for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
            __pyx_v_i = __pyx_t_21;

            /* "yt/frontends/artio/_artio_caller.pyx":1050
 *                     for j in range(8):
 *                         for i in range(nf):
 *                             field_vals[i][(oct_ind + lp)*8+j] = \             # <<<<<<<<<<<<<<
 *                                 grid_variables[ngv*j+field_ind[i]]
 *                 status = artio_grid_read_level_end(handle)
 */
            ((__pyx_v_field_vals[__pyx_v_i])[(((__pyx_v_oct_ind + __pyx_v_lp) * 8) + __pyx_v_j)]) = (__pyx_v_grid_variables[((__pyx_v_ngv * __pyx_v_j) + (__pyx_v_field_ind[__pyx_v_i]))]);
          }
        }
      }

      /* "yt/frontends/artio/_artio_caller.pyx":1052
 *                             field_vals[i][(oct_ind + lp)*8+j] = \
 *                                 grid_variables[ngv*j+field_ind[i]]
 *                 status = artio_grid_read_level_end(handle)             # <<<<<<<<<<<<<<
 *                 check_artio_status(status)
 *                 lp += num_octs_per_level[level]
 */
      __pyx_v_status = artio_grid_read_level_end(__pyx_v_handle);

      /* "yt/frontends/artio/_artio_caller.pyx":1053
 *                                 grid_variables[ngv*j+field_ind[i]]
 *                 status = artio_grid_read_level_end(handle)
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 *                 lp += num_octs_per_level[level]
 *             status = artio_grid_read_root_cell_end(handle)
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

      /* "yt/frontends/artio/_artio_caller.pyx":1054
 *                 status = artio_grid_read_level_end(handle)
 *                 check_artio_status(status)
 *                 lp += num_octs_per_level[level]             # <<<<<<<<<<<<<<
 *             status = artio_grid_read_root_cell_end(handle)
 *             check_artio_status(status)
 */
      __pyx_v_lp = (__pyx_v_lp + (__pyx_v_num_octs_per_level[__pyx_v_level]));
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1055
 *                 check_artio_status(status)
 *                 lp += num_octs_per_level[level]
 *             status = artio_grid_read_root_cell_end(handle)             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 *             # Now we have all our sources.
 */
    __pyx_v_status = artio_grid_read_root_cell_end(__pyx_v_handle);

    /* "yt/frontends/artio/_artio_caller.pyx":1056
 *                 lp += num_octs_per_level[level]
 *             status = artio_grid_read_root_cell_end(handle)
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             # Now we have all our sources.
 *             for j in range(nf):
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":1058
 *             check_artio_status(status)
 *             # Now we have all our sources.
 *             for j in range(nf):             # <<<<<<<<<<<<<<
 *                 dest = dest_fields[j]
 *                 source = source_arrays[j]
 */
    __pyx_t_6 = __pyx_v_nf;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_6; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "yt/frontends/artio/_artio_caller.pyx":1059
 *             # Now we have all our sources.
 *             for j in range(nf):
 *                 dest = dest_fields[j]             # <<<<<<<<<<<<<<
 *                 source = source_arrays[j]
 *                 for i in range(domain_counts[si]):
 */
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dest_fields, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_22 = ((PyArrayObject *)__pyx_t_9);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
        __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_v_dest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
          }
        }
        __pyx_pybuffernd_dest.diminfo[0].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dest.diminfo[0].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_22 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1060
 *             for j in range(nf):
 *                 dest = dest_fields[j]
 *                 source = source_arrays[j]             # <<<<<<<<<<<<<<
 *                 for i in range(domain_counts[si]):
 *                     level = levels[i + offset]
 */
      if (!(likely(((PyList_GET_ITEM(__pyx_v_source_arrays, __pyx_v_j)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_source_arrays, __pyx_v_j), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = PyList_GET_ITEM(__pyx_v_source_arrays, __pyx_v_j);
      __Pyx_INCREF(__pyx_t_9);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
        __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)__pyx_v_source, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
          }
        }
        __pyx_pybuffernd_source.diminfo[0].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_source.diminfo[0].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_source.diminfo[1].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_source.diminfo[1].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_XDECREF_SET(__pyx_v_source, ((PyArrayObject *)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1061
 *                 dest = dest_fields[j]
 *                 source = source_arrays[j]
 *                 for i in range(domain_counts[si]):             # <<<<<<<<<<<<<<
 *                     level = levels[i + offset]
 *                     oct_ind = file_inds[i + offset] + level_position[level]
 */
      __pyx_t_23 = __pyx_v_si;
      __pyx_t_15 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_domain_counts.diminfo[0].strides));
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_15; __pyx_t_17+=1) {
        __pyx_v_i = __pyx_t_17;

        /* "yt/frontends/artio/_artio_caller.pyx":1062
 *                 source = source_arrays[j]
 *                 for i in range(domain_counts[si]):
 *                     level = levels[i + offset]             # <<<<<<<<<<<<<<
 *                     oct_ind = file_inds[i + offset] + level_position[level]
 *                     dest[i + offset] = source[oct_ind, cell_inds[i + offset]]
 */
        __pyx_t_24 = (__pyx_v_i + __pyx_v_offset);
        __pyx_v_level = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_levels.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_levels.diminfo[0].strides));

        /* "yt/frontends/artio/_artio_caller.pyx":1063
 *                 for i in range(domain_counts[si]):
 *                     level = levels[i + offset]
 *                     oct_ind = file_inds[i + offset] + level_position[level]             # <<<<<<<<<<<<<<
 *                     dest[i + offset] = source[oct_ind, cell_inds[i + offset]]
 *             # Now, we offset by the actual number filled here.
 */
        __pyx_t_25 = (__pyx_v_i + __pyx_v_offset);
        __pyx_v_oct_ind = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_file_inds.diminfo[0].strides)) + (__pyx_v_level_position[__pyx_v_level]));

        /* "yt/frontends/artio/_artio_caller.pyx":1064
 *                     level = levels[i + offset]
 *                     oct_ind = file_inds[i + offset] + level_position[level]
 *                     dest[i + offset] = source[oct_ind, cell_inds[i + offset]]             # <<<<<<<<<<<<<<
 *             # Now, we offset by the actual number filled here.
 *             offset += domain_counts[si]
 */
        __pyx_t_26 = (__pyx_v_i + __pyx_v_offset);
        __pyx_t_27 = __pyx_v_oct_ind;
        __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_cell_inds.diminfo[0].strides));
        __pyx_t_29 = (__pyx_v_i + __pyx_v_offset);
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dest.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dest.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_source.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_source.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_source.diminfo[1].strides));
      }
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1066
 *                     dest[i + offset] = source[oct_ind, cell_inds[i + offset]]
 *             # Now, we offset by the actual number filled here.
 *             offset += domain_counts[si]             # <<<<<<<<<<<<<<
 *         status = artio_grid_clear_sfc_cache(handle)
 *         check_artio_status(status)
 */
    __pyx_t_30 = __pyx_v_si;
    __pyx_v_offset = (__pyx_v_offset + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_domain_counts.diminfo[0].strides)));
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1067
 *             # Now, we offset by the actual number filled here.
 *             offset += domain_counts[si]
 *         status = artio_grid_clear_sfc_cache(handle)             # <<<<<<<<<<<<<<
 *         check_artio_status(status)
 *         free(field_ind)
 */
  __pyx_v_status = artio_grid_clear_sfc_cache(__pyx_v_handle);

  /* "yt/frontends/artio/_artio_caller.pyx":1068
 *             offset += domain_counts[si]
 *         status = artio_grid_clear_sfc_cache(handle)
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 *         free(field_ind)
 *         free(field_vals)
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":1069
 *         status = artio_grid_clear_sfc_cache(handle)
 *         check_artio_status(status)
 *         free(field_ind)             # <<<<<<<<<<<<<<
 *         free(field_vals)
 *         free(grid_variables)
 */
  free(__pyx_v_field_ind);

  /* "yt/frontends/artio/_artio_caller.pyx":1070
 *         check_artio_status(status)
 *         free(field_ind)
 *         free(field_vals)             # <<<<<<<<<<<<<<
 *         free(grid_variables)
 *         free(num_octs_per_level)
 */
  free(__pyx_v_field_vals);

  /* "yt/frontends/artio/_artio_caller.pyx":1071
 *         free(field_ind)
 *         free(field_vals)
 *         free(grid_variables)             # <<<<<<<<<<<<<<
 *         free(num_octs_per_level)
 * 
 */
  free(__pyx_v_grid_variables);

  /* "yt/frontends/artio/_artio_caller.pyx":1072
 *         free(field_vals)
 *         free(grid_variables)
 *         free(num_octs_per_level)             # <<<<<<<<<<<<<<
 * 
 *     def fill_sfc_particles(self, fields):
 */
  free(__pyx_v_num_octs_per_level);

  /* "yt/frontends/artio/_artio_caller.pyx":980
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fill_sfc(self,             # <<<<<<<<<<<<<<
 *              np.ndarray[np.uint8_t, ndim=1] levels,
 *              np.ndarray[np.uint8_t, ndim=1] cell_inds,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.fill_sfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_source);
  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
  __Pyx_XDECREF(__pyx_v_source_arrays);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1074
 *         free(num_octs_per_level)
 * 
 *     def fill_sfc_particles(self, fields):             # <<<<<<<<<<<<<<
 *         # This handles not getting particles for refined sfc values.
 *         rv = read_sfc_particles(self.artio_handle, self.sfc_start,
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_5fill_sfc_particles(PyObject *__pyx_v_self, PyObject *__pyx_v_fields); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_5fill_sfc_particles(PyObject *__pyx_v_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fill_sfc_particles (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_4fill_sfc_particles(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_fields));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_4fill_sfc_particles(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fill_sfc_particles", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":1076
 *     def fill_sfc_particles(self, fields):
 *         # This handles not getting particles for refined sfc values.
 *         rv = read_sfc_particles(self.artio_handle, self.sfc_start,             # <<<<<<<<<<<<<<
 *                                 self.sfc_end, 0, fields,
 *                                 self.range_handler.doct_count,
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->artio_handle);
  __Pyx_INCREF(__pyx_t_1);

  /* "yt/frontends/artio/_artio_caller.pyx":1079
 *                                 self.sfc_end, 0, fields,
 *                                 self.range_handler.doct_count,
 *                                 self.range_handler.pcount)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_t_2 = __pyx_f_2yt_9frontends_5artio_13_artio_caller_read_sfc_particles(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_1), __pyx_v_self->sfc_start, __pyx_v_self->sfc_end, 0, __pyx_v_fields, __pyx_v_self->range_handler->doct_count, __pyx_v_self->range_handler->pcount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1080
 *                                 self.range_handler.doct_count,
 *                                 self.range_handler.pcount)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1074
 *         free(num_octs_per_level)
 * 
 *     def fill_sfc_particles(self, fields):             # <<<<<<<<<<<<<<
 *         # This handles not getting particles for refined sfc values.
 *         rv = read_sfc_particles(self.artio_handle, self.sfc_start,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.fill_sfc_particles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":899
 *     # this, we will avoid creating it as long as possible.
 * 
 *     cdef public artio_fileset artio_handle             # <<<<<<<<<<<<<<
 *     cdef ARTIOSFCRangeHandler range_handler
 *     cdef np.int64_t level_indices[32]
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_r = ((PyObject *)__pyx_v_self->artio_handle);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIOOctreeContainer.artio_handle.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1085
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef read_sfc_particles(artio_fileset artio_handle,             # <<<<<<<<<<<<<<
 *                         np.int64_t sfc_start, np.int64_t sfc_end,
 *                         int read_unrefined, fields,
 */

static PyObject *__pyx_f_2yt_9frontends_5artio_13_artio_caller_read_sfc_particles(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *__pyx_v_artio_handle, __pyx_t_5numpy_int64_t __pyx_v_sfc_start, __pyx_t_5numpy_int64_t __pyx_v_sfc_end, int __pyx_v_read_unrefined, PyObject *__pyx_v_fields, __pyx_t_5numpy_int64_t *__pyx_v_doct_count, __pyx_t_5numpy_int64_t **__pyx_v_pcount) {
  int __pyx_v_status;
  int __pyx_v_ispec;
  int __pyx_v_subspecies;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_particle;
  __pyx_t_5numpy_int64_t __pyx_v_pid;
  __pyx_t_5numpy_int64_t __pyx_v_ind;
  __pyx_t_5numpy_int64_t __pyx_v_vind;
  int __pyx_v_num_species;
  artio_fileset *__pyx_v_handle;
  int *__pyx_v_num_particles_per_species;
  int *__pyx_v_accessed_species;
  int *__pyx_v_total_particles;
  struct __pyx_t_2yt_9frontends_5artio_13_artio_caller_particle_var_pointers *__pyx_v_vpoints;
  double *__pyx_v_primary_variables;
  float *__pyx_v_secondary_variables;
  __pyx_t_5numpy_int64_t __pyx_v_tp;
  int __pyx_v_max_level;
  int *__pyx_v_num_octs_per_level;
  PyArrayObject *__pyx_v_npi8arr = 0;
  PyArrayObject *__pyx_v_npi64arr = 0;
  PyArrayObject *__pyx_v_npf64arr = 0;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_npri_vars = NULL;
  PyObject *__pyx_v_nsec_vars = NULL;
  struct __pyx_t_2yt_9frontends_5artio_13_artio_caller_particle_var_pointers *__pyx_v_vp;
  __pyx_t_5numpy_int64_t __pyx_v_c;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_species = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_v_pri_vars = NULL;
  PyObject *__pyx_v_sec_vars = NULL;
  int __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_npf64arr;
  __Pyx_Buffer __pyx_pybuffer_npf64arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_npi64arr;
  __Pyx_Buffer __pyx_pybuffer_npi64arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_npi8arr;
  __Pyx_Buffer __pyx_pybuffer_npi8arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  artio_fileset *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int64_t __pyx_t_9;
  __pyx_t_5numpy_int64_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  Py_ssize_t __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyArrayObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyArrayObject *__pyx_t_25 = NULL;
  int __pyx_t_26;
  PyArrayObject *__pyx_t_27 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_28;
  __pyx_t_5numpy_int64_t __pyx_t_29;
  int __pyx_t_30;
  int __pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_sfc_particles", 0);
  __pyx_pybuffer_npi8arr.pybuffer.buf = NULL;
  __pyx_pybuffer_npi8arr.refcount = 0;
  __pyx_pybuffernd_npi8arr.data = NULL;
  __pyx_pybuffernd_npi8arr.rcbuffer = &__pyx_pybuffer_npi8arr;
  __pyx_pybuffer_npi64arr.pybuffer.buf = NULL;
  __pyx_pybuffer_npi64arr.refcount = 0;
  __pyx_pybuffernd_npi64arr.data = NULL;
  __pyx_pybuffernd_npi64arr.rcbuffer = &__pyx_pybuffer_npi64arr;
  __pyx_pybuffer_npf64arr.pybuffer.buf = NULL;
  __pyx_pybuffer_npf64arr.refcount = 0;
  __pyx_pybuffernd_npf64arr.data = NULL;
  __pyx_pybuffernd_npf64arr.rcbuffer = &__pyx_pybuffer_npf64arr;

  /* "yt/frontends/artio/_artio_caller.pyx":1092
 *     cdef int status, ispec, subspecies
 *     cdef np.int64_t sfc, particle, pid, ind, vind
 *     cdef int num_species = artio_handle.num_species             # <<<<<<<<<<<<<<
 *     cdef artio_fileset_handle *handle = artio_handle.handle
 *     cdef int num_oct_levels
 */
  __pyx_t_1 = __pyx_v_artio_handle->num_species;
  __pyx_v_num_species = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1093
 *     cdef np.int64_t sfc, particle, pid, ind, vind
 *     cdef int num_species = artio_handle.num_species
 *     cdef artio_fileset_handle *handle = artio_handle.handle             # <<<<<<<<<<<<<<
 *     cdef int num_oct_levels
 *     cdef int *num_particles_per_species =  <int *>malloc(
 */
  __pyx_t_2 = __pyx_v_artio_handle->handle;
  __pyx_v_handle = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":1095
 *     cdef artio_fileset_handle *handle = artio_handle.handle
 *     cdef int num_oct_levels
 *     cdef int *num_particles_per_species =  <int *>malloc(             # <<<<<<<<<<<<<<
 *         sizeof(int)*num_species)
 *     cdef int *accessed_species =  <int *>malloc(
 */
  __pyx_v_num_particles_per_species = ((int *)malloc(((sizeof(int)) * __pyx_v_num_species)));

  /* "yt/frontends/artio/_artio_caller.pyx":1097
 *     cdef int *num_particles_per_species =  <int *>malloc(
 *         sizeof(int)*num_species)
 *     cdef int *accessed_species =  <int *>malloc(             # <<<<<<<<<<<<<<
 *         sizeof(int)*num_species)
 *     cdef int *total_particles = <int *>malloc(
 */
  __pyx_v_accessed_species = ((int *)malloc(((sizeof(int)) * __pyx_v_num_species)));

  /* "yt/frontends/artio/_artio_caller.pyx":1099
 *     cdef int *accessed_species =  <int *>malloc(
 *         sizeof(int)*num_species)
 *     cdef int *total_particles = <int *>malloc(             # <<<<<<<<<<<<<<
 *         sizeof(int)*num_species)
 *     cdef particle_var_pointers *vpoints = <particle_var_pointers *> malloc(
 */
  __pyx_v_total_particles = ((int *)malloc(((sizeof(int)) * __pyx_v_num_species)));

  /* "yt/frontends/artio/_artio_caller.pyx":1101
 *     cdef int *total_particles = <int *>malloc(
 *         sizeof(int)*num_species)
 *     cdef particle_var_pointers *vpoints = <particle_var_pointers *> malloc(             # <<<<<<<<<<<<<<
 *         sizeof(particle_var_pointers)*num_species)
 *     cdef double *primary_variables
 */
  __pyx_v_vpoints = ((struct __pyx_t_2yt_9frontends_5artio_13_artio_caller_particle_var_pointers *)malloc(((sizeof(struct __pyx_t_2yt_9frontends_5artio_13_artio_caller_particle_var_pointers)) * __pyx_v_num_species)));

  /* "yt/frontends/artio/_artio_caller.pyx":1107
 *     cdef float *secondary_variables
 *     cdef np.int64_t tp
 *     cdef int max_level = artio_handle.max_level             # <<<<<<<<<<<<<<
 *     cdef int *num_octs_per_level = <int *>malloc(
 *         (max_level + 1)*sizeof(int))
 */
  __pyx_t_1 = __pyx_v_artio_handle->max_level;
  __pyx_v_max_level = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1108
 *     cdef np.int64_t tp
 *     cdef int max_level = artio_handle.max_level
 *     cdef int *num_octs_per_level = <int *>malloc(             # <<<<<<<<<<<<<<
 *         (max_level + 1)*sizeof(int))
 * 
 */
  __pyx_v_num_octs_per_level = ((int *)malloc(((__pyx_v_max_level + 1) * (sizeof(int)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1115
 *     cdef np.ndarray[np.float64_t, ndim=1] npf64arr
 * 
 *     if not artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *         raise RuntimeError("Attempted to read non-existent particles in ARTIO")
 *         return
 */
  __pyx_t_3 = ((!(__pyx_v_artio_handle->has_particles != 0)) != 0);
  if (__pyx_t_3) {

    /* "yt/frontends/artio/_artio_caller.pyx":1116
 * 
 *     if not artio_handle.has_particles:
 *         raise RuntimeError("Attempted to read non-existent particles in ARTIO")             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "yt/frontends/artio/_artio_caller.pyx":1115
 *     cdef np.ndarray[np.float64_t, ndim=1] npf64arr
 * 
 *     if not artio_handle.has_particles:             # <<<<<<<<<<<<<<
 *         raise RuntimeError("Attempted to read non-existent particles in ARTIO")
 *         return
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1120
 * 
 *     # Now we set up our field pointers
 *     params = artio_handle.parameters             # <<<<<<<<<<<<<<
 * 
 *     npri_vars = params["num_primary_variables"]
 */
  __pyx_t_4 = __pyx_v_artio_handle->parameters;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_params = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1122
 *     params = artio_handle.parameters
 * 
 *     npri_vars = params["num_primary_variables"]             # <<<<<<<<<<<<<<
 *     nsec_vars = params["num_secondary_variables"]
 *     primary_variables = <double *>malloc(sizeof(double) * max(npri_vars))
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_v_params, __pyx_n_s_num_primary_variables); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_npri_vars = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1123
 * 
 *     npri_vars = params["num_primary_variables"]
 *     nsec_vars = params["num_secondary_variables"]             # <<<<<<<<<<<<<<
 *     primary_variables = <double *>malloc(sizeof(double) * max(npri_vars))
 *     secondary_variables = <float *>malloc(sizeof(float) * max(nsec_vars))
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_v_params, __pyx_n_s_num_secondary_variables); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_nsec_vars = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1124
 *     npri_vars = params["num_primary_variables"]
 *     nsec_vars = params["num_secondary_variables"]
 *     primary_variables = <double *>malloc(sizeof(double) * max(npri_vars))             # <<<<<<<<<<<<<<
 *     secondary_variables = <float *>malloc(sizeof(float) * max(nsec_vars))
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_npri_vars);
  __Pyx_GIVEREF(__pyx_v_npri_vars);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_npri_vars);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_primary_variables = ((double *)malloc(__pyx_t_7));

  /* "yt/frontends/artio/_artio_caller.pyx":1125
 *     nsec_vars = params["num_secondary_variables"]
 *     primary_variables = <double *>malloc(sizeof(double) * max(npri_vars))
 *     secondary_variables = <float *>malloc(sizeof(float) * max(nsec_vars))             # <<<<<<<<<<<<<<
 * 
 *     cdef particle_var_pointers *vp
 */
  __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(float))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_nsec_vars);
  __Pyx_GIVEREF(__pyx_v_nsec_vars);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_nsec_vars);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_secondary_variables = ((float *)malloc(__pyx_t_7));

  /* "yt/frontends/artio/_artio_caller.pyx":1129
 *     cdef particle_var_pointers *vp
 * 
 *     for ispec in range(num_species):             # <<<<<<<<<<<<<<
 *         total_particles[ispec] = 0
 *         accessed_species[ispec] = 0
 */
  __pyx_t_1 = __pyx_v_num_species;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_ispec = __pyx_t_8;

    /* "yt/frontends/artio/_artio_caller.pyx":1130
 * 
 *     for ispec in range(num_species):
 *         total_particles[ispec] = 0             # <<<<<<<<<<<<<<
 *         accessed_species[ispec] = 0
 *         # Initialize our vpoints array
 */
    (__pyx_v_total_particles[__pyx_v_ispec]) = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1131
 *     for ispec in range(num_species):
 *         total_particles[ispec] = 0
 *         accessed_species[ispec] = 0             # <<<<<<<<<<<<<<
 *         # Initialize our vpoints array
 *         vpoints[ispec].count = 0
 */
    (__pyx_v_accessed_species[__pyx_v_ispec]) = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1133
 *         accessed_species[ispec] = 0
 *         # Initialize our vpoints array
 *         vpoints[ispec].count = 0             # <<<<<<<<<<<<<<
 *         vpoints[ispec].n_mass = 0
 *         vpoints[ispec].n_pid = 0
 */
    (__pyx_v_vpoints[__pyx_v_ispec]).count = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1134
 *         # Initialize our vpoints array
 *         vpoints[ispec].count = 0
 *         vpoints[ispec].n_mass = 0             # <<<<<<<<<<<<<<
 *         vpoints[ispec].n_pid = 0
 *         vpoints[ispec].n_species = 0
 */
    (__pyx_v_vpoints[__pyx_v_ispec]).n_mass = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1135
 *         vpoints[ispec].count = 0
 *         vpoints[ispec].n_mass = 0
 *         vpoints[ispec].n_pid = 0             # <<<<<<<<<<<<<<
 *         vpoints[ispec].n_species = 0
 *         vpoints[ispec].n_p = 0
 */
    (__pyx_v_vpoints[__pyx_v_ispec]).n_pid = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1136
 *         vpoints[ispec].n_mass = 0
 *         vpoints[ispec].n_pid = 0
 *         vpoints[ispec].n_species = 0             # <<<<<<<<<<<<<<
 *         vpoints[ispec].n_p = 0
 *         vpoints[ispec].n_s = 0
 */
    (__pyx_v_vpoints[__pyx_v_ispec]).n_species = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1137
 *         vpoints[ispec].n_pid = 0
 *         vpoints[ispec].n_species = 0
 *         vpoints[ispec].n_p = 0             # <<<<<<<<<<<<<<
 *         vpoints[ispec].n_s = 0
 * 
 */
    (__pyx_v_vpoints[__pyx_v_ispec]).n_p = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1138
 *         vpoints[ispec].n_species = 0
 *         vpoints[ispec].n_p = 0
 *         vpoints[ispec].n_s = 0             # <<<<<<<<<<<<<<
 * 
 *     # Pass through once.  We want every single particle.
 */
    (__pyx_v_vpoints[__pyx_v_ispec]).n_s = 0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1141
 * 
 *     # Pass through once.  We want every single particle.
 *     tp = 0             # <<<<<<<<<<<<<<
 *     cdef np.int64_t c
 *     for sfc in range(sfc_start, sfc_end + 1):
 */
  __pyx_v_tp = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1143
 *     tp = 0
 *     cdef np.int64_t c
 *     for sfc in range(sfc_start, sfc_end + 1):             # <<<<<<<<<<<<<<
 *         c = doct_count[sfc - sfc_start]
 *         if read_unrefined == 1 and c > 0: continue
 */
  __pyx_t_9 = (__pyx_v_sfc_end + 1);
  for (__pyx_t_10 = __pyx_v_sfc_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_sfc = __pyx_t_10;

    /* "yt/frontends/artio/_artio_caller.pyx":1144
 *     cdef np.int64_t c
 *     for sfc in range(sfc_start, sfc_end + 1):
 *         c = doct_count[sfc - sfc_start]             # <<<<<<<<<<<<<<
 *         if read_unrefined == 1 and c > 0: continue
 *         if read_unrefined == 0 and c == 0: continue
 */
    __pyx_v_c = (__pyx_v_doct_count[(__pyx_v_sfc - __pyx_v_sfc_start)]);

    /* "yt/frontends/artio/_artio_caller.pyx":1145
 *     for sfc in range(sfc_start, sfc_end + 1):
 *         c = doct_count[sfc - sfc_start]
 *         if read_unrefined == 1 and c > 0: continue             # <<<<<<<<<<<<<<
 *         if read_unrefined == 0 and c == 0: continue
 * 
 */
    __pyx_t_11 = ((__pyx_v_read_unrefined == 1) != 0);
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_11 = ((__pyx_v_c > 0) != 0);
    __pyx_t_3 = __pyx_t_11;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_3) {
      goto __pyx_L6_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1146
 *         c = doct_count[sfc - sfc_start]
 *         if read_unrefined == 1 and c > 0: continue
 *         if read_unrefined == 0 and c == 0: continue             # <<<<<<<<<<<<<<
 * 
 *         for ispec in range(num_species):
 */
    __pyx_t_11 = ((__pyx_v_read_unrefined == 0) != 0);
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_11 = ((__pyx_v_c == 0) != 0);
    __pyx_t_3 = __pyx_t_11;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_3) {
      goto __pyx_L6_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1148
 *         if read_unrefined == 0 and c == 0: continue
 * 
 *         for ispec in range(num_species):             # <<<<<<<<<<<<<<
 *             total_particles[ispec] += pcount[ispec][sfc - sfc_start]
 * 
 */
    __pyx_t_1 = __pyx_v_num_species;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
      __pyx_v_ispec = __pyx_t_8;

      /* "yt/frontends/artio/_artio_caller.pyx":1149
 * 
 *         for ispec in range(num_species):
 *             total_particles[ispec] += pcount[ispec][sfc - sfc_start]             # <<<<<<<<<<<<<<
 * 
 *     # Now we allocate our final fields, which will be filled
 */
      __pyx_t_12 = __pyx_v_ispec;
      (__pyx_v_total_particles[__pyx_t_12]) = ((__pyx_v_total_particles[__pyx_t_12]) + ((__pyx_v_pcount[__pyx_v_ispec])[(__pyx_v_sfc - __pyx_v_sfc_start)]));
    }
    __pyx_L6_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1155
 *     #    print "In SFC %s to %s reading %s of species %s" % (
 *     #        sfc_start, sfc_end + 1, total_particles[ispec], ispec)
 *     data = {}             # <<<<<<<<<<<<<<
 *     for species, field in sorted(fields):
 *         accessed_species[species] = 1
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_data = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1156
 *     #        sfc_start, sfc_end + 1, total_particles[ispec], ispec)
 *     data = {}
 *     for species, field in sorted(fields):             # <<<<<<<<<<<<<<
 *         accessed_species[species] = 1
 *         pri_vars = params.get(
 */
  __pyx_t_4 = PySequence_List(__pyx_v_fields); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_13 = PyList_Sort(__pyx_t_6); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(__pyx_t_6 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_15);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_5)) goto __pyx_L18_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L18_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_15);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_17 = NULL;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L19_unpacking_done;
      __pyx_L18_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_17 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L19_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_species, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_15);
    __pyx_t_15 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1157
 *     data = {}
 *     for species, field in sorted(fields):
 *         accessed_species[species] = 1             # <<<<<<<<<<<<<<
 *         pri_vars = params.get(
 *             "species_%02u_primary_variable_labels" % (species,), [])
 */
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_species); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_accessed_species[__pyx_t_18]) = 1;

    /* "yt/frontends/artio/_artio_caller.pyx":1158
 *     for species, field in sorted(fields):
 *         accessed_species[species] = 1
 *         pri_vars = params.get(             # <<<<<<<<<<<<<<
 *             "species_%02u_primary_variable_labels" % (species,), [])
 *         sec_vars = params.get(
 */
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_params, __pyx_n_s_get); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);

    /* "yt/frontends/artio/_artio_caller.pyx":1159
 *         accessed_species[species] = 1
 *         pri_vars = params.get(
 *             "species_%02u_primary_variable_labels" % (species,), [])             # <<<<<<<<<<<<<<
 *         sec_vars = params.get(
 *             "species_%02u_secondary_variable_labels" % (species,), [])
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_species);
    __Pyx_GIVEREF(__pyx_v_species);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_species);
    __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_species__02u_primary_variable_la, __pyx_t_5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_19 = NULL;
    __pyx_t_18 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_15);
      if (likely(__pyx_t_19)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_19);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_15, function);
        __pyx_t_18 = 1;
      }
    }
    __pyx_t_20 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    if (__pyx_t_19) {
      __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_18, __pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_18, __pyx_t_5);
    __pyx_t_16 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_20, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF_SET(__pyx_v_pri_vars, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1160
 *         pri_vars = params.get(
 *             "species_%02u_primary_variable_labels" % (species,), [])
 *         sec_vars = params.get(             # <<<<<<<<<<<<<<
 *             "species_%02u_secondary_variable_labels" % (species,), [])
 *         tp = total_particles[species]
 */
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_params, __pyx_n_s_get); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);

    /* "yt/frontends/artio/_artio_caller.pyx":1161
 *             "species_%02u_primary_variable_labels" % (species,), [])
 *         sec_vars = params.get(
 *             "species_%02u_secondary_variable_labels" % (species,), [])             # <<<<<<<<<<<<<<
 *         tp = total_particles[species]
 *         vp = &vpoints[species]
 */
    __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_INCREF(__pyx_v_species);
    __Pyx_GIVEREF(__pyx_v_species);
    PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_species);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_species__02u_secondary_variable, __pyx_t_20); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyList_New(0); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_16 = NULL;
    __pyx_t_18 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
      if (likely(__pyx_t_16)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_15, function);
        __pyx_t_18 = 1;
      }
    }
    __pyx_t_19 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    if (__pyx_t_16) {
      __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_16); __pyx_t_16 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_20);
    PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_20);
    __pyx_t_5 = 0;
    __pyx_t_20 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sec_vars, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1162
 *         sec_vars = params.get(
 *             "species_%02u_secondary_variable_labels" % (species,), [])
 *         tp = total_particles[species]             # <<<<<<<<<<<<<<
 *         vp = &vpoints[species]
 *         if field == "PID":
 */
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_species); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_tp = (__pyx_v_total_particles[__pyx_t_18]);

    /* "yt/frontends/artio/_artio_caller.pyx":1163
 *             "species_%02u_secondary_variable_labels" % (species,), [])
 *         tp = total_particles[species]
 *         vp = &vpoints[species]             # <<<<<<<<<<<<<<
 *         if field == "PID":
 *             vp.n_pid = 1
 */
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_species); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_vp = (&(__pyx_v_vpoints[__pyx_t_18]));

    /* "yt/frontends/artio/_artio_caller.pyx":1164
 *         tp = total_particles[species]
 *         vp = &vpoints[species]
 *         if field == "PID":             # <<<<<<<<<<<<<<
 *             vp.n_pid = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int64")
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_PID, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":1165
 *         vp = &vpoints[species]
 *         if field == "PID":
 *             vp.n_pid = 1             # <<<<<<<<<<<<<<
 *             data[(species, field)] = np.zeros(tp, dtype="int64")
 *             npi64arr = data[(species, field)]
 */
      __pyx_v_vp->n_pid = 1;

      /* "yt/frontends/artio/_artio_caller.pyx":1166
 *         if field == "PID":
 *             vp.n_pid = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int64")             # <<<<<<<<<<<<<<
 *             npi64arr = data[(species, field)]
 *             vp.pid = <np.int64_t*> npi64arr.data
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_tp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_6, __pyx_t_20) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1167
 *             vp.n_pid = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int64")
 *             npi64arr = data[(species, field)]             # <<<<<<<<<<<<<<
 *             vp.pid = <np.int64_t*> npi64arr.data
 *         elif field == "SPECIES":
 */
      __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_field);
      __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_20); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_21 = ((PyArrayObject *)__pyx_t_6);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npi64arr.rcbuffer->pybuffer);
        __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npi64arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_1 < 0)) {
          PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npi64arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_npi64arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
          }
        }
        __pyx_pybuffernd_npi64arr.diminfo[0].strides = __pyx_pybuffernd_npi64arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_npi64arr.diminfo[0].shape = __pyx_pybuffernd_npi64arr.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_21 = 0;
      __Pyx_XDECREF_SET(__pyx_v_npi64arr, ((PyArrayObject *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1168
 *             data[(species, field)] = np.zeros(tp, dtype="int64")
 *             npi64arr = data[(species, field)]
 *             vp.pid = <np.int64_t*> npi64arr.data             # <<<<<<<<<<<<<<
 *         elif field == "SPECIES":
 *             vp.n_species = 1
 */
      __pyx_v_vp->pid = ((__pyx_t_5numpy_int64_t *)__pyx_v_npi64arr->data);

      /* "yt/frontends/artio/_artio_caller.pyx":1164
 *         tp = total_particles[species]
 *         vp = &vpoints[species]
 *         if field == "PID":             # <<<<<<<<<<<<<<
 *             vp.n_pid = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int64")
 */
      goto __pyx_L20;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1169
 *             npi64arr = data[(species, field)]
 *             vp.pid = <np.int64_t*> npi64arr.data
 *         elif field == "SPECIES":             # <<<<<<<<<<<<<<
 *             vp.n_species = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int8")
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_SPECIES, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":1170
 *             vp.pid = <np.int64_t*> npi64arr.data
 *         elif field == "SPECIES":
 *             vp.n_species = 1             # <<<<<<<<<<<<<<
 *             data[(species, field)] = np.zeros(tp, dtype="int8")
 *             npi8arr = data[(species, field)]
 */
      __pyx_v_vp->n_species = 1;

      /* "yt/frontends/artio/_artio_caller.pyx":1171
 *         elif field == "SPECIES":
 *             vp.n_species = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int8")             # <<<<<<<<<<<<<<
 *             npi8arr = data[(species, field)]
 *             # We fill this *now*
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_tp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_int8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_6, __pyx_t_15) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1172
 *             vp.n_species = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int8")
 *             npi8arr = data[(species, field)]             # <<<<<<<<<<<<<<
 *             # We fill this *now*
 *             npi8arr += species
 */
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_field);
      __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_15); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_25 = ((PyArrayObject *)__pyx_t_6);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer);
        __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_1 < 0)) {
          PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_npi8arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
          }
        }
        __pyx_pybuffernd_npi8arr.diminfo[0].strides = __pyx_pybuffernd_npi8arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_npi8arr.diminfo[0].shape = __pyx_pybuffernd_npi8arr.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_25 = 0;
      __Pyx_XDECREF_SET(__pyx_v_npi8arr, ((PyArrayObject *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1174
 *             npi8arr = data[(species, field)]
 *             # We fill this *now*
 *             npi8arr += species             # <<<<<<<<<<<<<<
 *             vp.species = <np.int8_t*> npi8arr.data
 *         elif npri_vars[species] > 0 and field in pri_vars :
 */
      __pyx_t_6 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_npi8arr), __pyx_v_species); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_25 = ((PyArrayObject *)__pyx_t_6);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer);
        __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_1 < 0)) {
          PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_npi8arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
          }
        }
        __pyx_pybuffernd_npi8arr.diminfo[0].strides = __pyx_pybuffernd_npi8arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_npi8arr.diminfo[0].shape = __pyx_pybuffernd_npi8arr.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_25 = 0;
      __Pyx_DECREF_SET(__pyx_v_npi8arr, ((PyArrayObject *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1175
 *             # We fill this *now*
 *             npi8arr += species
 *             vp.species = <np.int8_t*> npi8arr.data             # <<<<<<<<<<<<<<
 *         elif npri_vars[species] > 0 and field in pri_vars :
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 */
      __pyx_v_vp->species = ((__pyx_t_5numpy_int8_t *)__pyx_v_npi8arr->data);

      /* "yt/frontends/artio/_artio_caller.pyx":1169
 *             npi64arr = data[(species, field)]
 *             vp.pid = <np.int64_t*> npi64arr.data
 *         elif field == "SPECIES":             # <<<<<<<<<<<<<<
 *             vp.n_species = 1
 *             data[(species, field)] = np.zeros(tp, dtype="int8")
 */
      goto __pyx_L20;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1176
 *             npi8arr += species
 *             vp.species = <np.int8_t*> npi8arr.data
 *         elif npri_vars[species] > 0 and field in pri_vars :             # <<<<<<<<<<<<<<
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_npri_vars, __pyx_v_species); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_15 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L21_bool_binop_done;
    }
    __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_v_pri_vars, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_26 = (__pyx_t_11 != 0);
    __pyx_t_3 = __pyx_t_26;
    __pyx_L21_bool_binop_done:;
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":1177
 *             vp.species = <np.int8_t*> npi8arr.data
 *         elif npri_vars[species] > 0 and field in pri_vars :
 *             data[(species, field)] = np.zeros(tp, dtype="float64")             # <<<<<<<<<<<<<<
 *             npf64arr = data[(species, field)]
 *             vp.p_ind[vp.n_p] = pri_vars.index(field)
 */
      __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __Pyx_PyInt_From_npy_int64(__pyx_v_tp); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_15);
      __pyx_t_15 = 0;
      __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_19, __pyx_t_15); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_15, __pyx_t_20) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1178
 *         elif npri_vars[species] > 0 and field in pri_vars :
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]             # <<<<<<<<<<<<<<
 *             vp.p_ind[vp.n_p] = pri_vars.index(field)
 *             vp.pvars[vp.n_p] = <np.float64_t *> npf64arr.data
 */
      __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_field);
      __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_20); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_27 = ((PyArrayObject *)__pyx_t_15);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer);
        __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_1 < 0)) {
          PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_npf64arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
          }
        }
        __pyx_pybuffernd_npf64arr.diminfo[0].strides = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_npf64arr.diminfo[0].shape = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_27 = 0;
      __Pyx_XDECREF_SET(__pyx_v_npf64arr, ((PyArrayObject *)__pyx_t_15));
      __pyx_t_15 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1179
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]
 *             vp.p_ind[vp.n_p] = pri_vars.index(field)             # <<<<<<<<<<<<<<
 *             vp.pvars[vp.n_p] = <np.float64_t *> npf64arr.data
 *             vp.n_p += 1
 */
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_pri_vars, __pyx_n_s_index); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_19 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_20))) {
        __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20);
        if (likely(__pyx_t_19)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_20, function);
        }
      }
      if (!__pyx_t_19) {
        __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_v_field); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_19); __pyx_t_19 = NULL;
        __Pyx_INCREF(__pyx_v_field);
        __Pyx_GIVEREF(__pyx_v_field);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_field);
        __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_6, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_15); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      (__pyx_v_vp->p_ind[__pyx_v_vp->n_p]) = __pyx_t_1;

      /* "yt/frontends/artio/_artio_caller.pyx":1180
 *             npf64arr = data[(species, field)]
 *             vp.p_ind[vp.n_p] = pri_vars.index(field)
 *             vp.pvars[vp.n_p] = <np.float64_t *> npf64arr.data             # <<<<<<<<<<<<<<
 *             vp.n_p += 1
 *         elif nsec_vars[species] > 0 and field in sec_vars :
 */
      (__pyx_v_vp->pvars[__pyx_v_vp->n_p]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_npf64arr->data);

      /* "yt/frontends/artio/_artio_caller.pyx":1181
 *             vp.p_ind[vp.n_p] = pri_vars.index(field)
 *             vp.pvars[vp.n_p] = <np.float64_t *> npf64arr.data
 *             vp.n_p += 1             # <<<<<<<<<<<<<<
 *         elif nsec_vars[species] > 0 and field in sec_vars :
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 */
      __pyx_v_vp->n_p = (__pyx_v_vp->n_p + 1);

      /* "yt/frontends/artio/_artio_caller.pyx":1176
 *             npi8arr += species
 *             vp.species = <np.int8_t*> npi8arr.data
 *         elif npri_vars[species] > 0 and field in pri_vars :             # <<<<<<<<<<<<<<
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]
 */
      goto __pyx_L20;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1182
 *             vp.pvars[vp.n_p] = <np.float64_t *> npf64arr.data
 *             vp.n_p += 1
 *         elif nsec_vars[species] > 0 and field in sec_vars :             # <<<<<<<<<<<<<<
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]
 */
    __pyx_t_15 = PyObject_GetItem(__pyx_v_nsec_vars, __pyx_v_species); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_20 = PyObject_RichCompare(__pyx_t_15, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (__pyx_t_26) {
    } else {
      __pyx_t_3 = __pyx_t_26;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_26 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_v_sec_vars, Py_EQ)); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = (__pyx_t_26 != 0);
    __pyx_t_3 = __pyx_t_11;
    __pyx_L23_bool_binop_done:;
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":1183
 *             vp.n_p += 1
 *         elif nsec_vars[species] > 0 and field in sec_vars :
 *             data[(species, field)] = np.zeros(tp, dtype="float64")             # <<<<<<<<<<<<<<
 *             npf64arr = data[(species, field)]
 *             vp.s_ind[vp.n_s] = sec_vars.index(field)
 */
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_zeros); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyInt_From_npy_int64(__pyx_v_tp); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_20);
      __pyx_t_20 = 0;
      __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_6, __pyx_t_20); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_20, __pyx_t_19) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1184
 *         elif nsec_vars[species] > 0 and field in sec_vars :
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]             # <<<<<<<<<<<<<<
 *             vp.s_ind[vp.n_s] = sec_vars.index(field)
 *             vp.svars[vp.n_s] = <np.float64_t *> npf64arr.data
 */
      __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_field);
      __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_19); if (unlikely(__pyx_t_20 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_27 = ((PyArrayObject *)__pyx_t_20);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer);
        __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_1 < 0)) {
          PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_npf64arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
          }
        }
        __pyx_pybuffernd_npf64arr.diminfo[0].strides = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_npf64arr.diminfo[0].shape = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_27 = 0;
      __Pyx_XDECREF_SET(__pyx_v_npf64arr, ((PyArrayObject *)__pyx_t_20));
      __pyx_t_20 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1185
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]
 *             vp.s_ind[vp.n_s] = sec_vars.index(field)             # <<<<<<<<<<<<<<
 *             vp.svars[vp.n_s] = <np.float64_t *> npf64arr.data
 *             vp.n_s += 1
 */
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_sec_vars, __pyx_n_s_index); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_19))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_19, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_field); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
      } else {
        __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_field);
        __Pyx_GIVEREF(__pyx_v_field);
        PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_field);
        __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_15, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      }
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_20); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      (__pyx_v_vp->s_ind[__pyx_v_vp->n_s]) = __pyx_t_1;

      /* "yt/frontends/artio/_artio_caller.pyx":1186
 *             npf64arr = data[(species, field)]
 *             vp.s_ind[vp.n_s] = sec_vars.index(field)
 *             vp.svars[vp.n_s] = <np.float64_t *> npf64arr.data             # <<<<<<<<<<<<<<
 *             vp.n_s += 1
 *         elif field == "MASS":
 */
      (__pyx_v_vp->svars[__pyx_v_vp->n_s]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_npf64arr->data);

      /* "yt/frontends/artio/_artio_caller.pyx":1187
 *             vp.s_ind[vp.n_s] = sec_vars.index(field)
 *             vp.svars[vp.n_s] = <np.float64_t *> npf64arr.data
 *             vp.n_s += 1             # <<<<<<<<<<<<<<
 *         elif field == "MASS":
 *             vp.n_mass = 1
 */
      __pyx_v_vp->n_s = (__pyx_v_vp->n_s + 1);

      /* "yt/frontends/artio/_artio_caller.pyx":1182
 *             vp.pvars[vp.n_p] = <np.float64_t *> npf64arr.data
 *             vp.n_p += 1
 *         elif nsec_vars[species] > 0 and field in sec_vars :             # <<<<<<<<<<<<<<
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]
 */
      goto __pyx_L20;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1188
 *             vp.svars[vp.n_s] = <np.float64_t *> npf64arr.data
 *             vp.n_s += 1
 *         elif field == "MASS":             # <<<<<<<<<<<<<<
 *             vp.n_mass = 1
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_MASS, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "yt/frontends/artio/_artio_caller.pyx":1189
 *             vp.n_s += 1
 *         elif field == "MASS":
 *             vp.n_mass = 1             # <<<<<<<<<<<<<<
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]
 */
      __pyx_v_vp->n_mass = 1;

      /* "yt/frontends/artio/_artio_caller.pyx":1190
 *         elif field == "MASS":
 *             vp.n_mass = 1
 *             data[(species, field)] = np.zeros(tp, dtype="float64")             # <<<<<<<<<<<<<<
 *             npf64arr = data[(species, field)]
 *             # We fill this *now*
 */
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_zeros); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyInt_From_npy_int64(__pyx_v_tp); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_20);
      __pyx_t_20 = 0;
      __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_15, __pyx_t_20); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_field);
      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_t_20, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1191
 *             vp.n_mass = 1
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 *             npf64arr = data[(species, field)]             # <<<<<<<<<<<<<<
 *             # We fill this *now*
 *             npf64arr += params["particle_species_mass"][species]
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_species);
      __Pyx_GIVEREF(__pyx_v_species);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_species);
      __Pyx_INCREF(__pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_field);
      __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(__pyx_t_20 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_27 = ((PyArrayObject *)__pyx_t_20);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer);
        __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_1 < 0)) {
          PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_npf64arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
          }
        }
        __pyx_pybuffernd_npf64arr.diminfo[0].strides = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_npf64arr.diminfo[0].shape = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_27 = 0;
      __Pyx_XDECREF_SET(__pyx_v_npf64arr, ((PyArrayObject *)__pyx_t_20));
      __pyx_t_20 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1193
 *             npf64arr = data[(species, field)]
 *             # We fill this *now*
 *             npf64arr += params["particle_species_mass"][species]             # <<<<<<<<<<<<<<
 *             vp.mass = <np.float64_t*> npf64arr.data
 * 
 */
      __pyx_t_20 = PyObject_GetItem(__pyx_v_params, __pyx_n_s_particle_species_mass); if (unlikely(__pyx_t_20 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_6 = PyObject_GetItem(__pyx_t_20, __pyx_v_species); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_npf64arr), __pyx_t_6); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_27 = ((PyArrayObject *)__pyx_t_20);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer);
        __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_1 < 0)) {
          PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_npf64arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
          }
        }
        __pyx_pybuffernd_npf64arr.diminfo[0].strides = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_npf64arr.diminfo[0].shape = __pyx_pybuffernd_npf64arr.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_27 = 0;
      __Pyx_DECREF_SET(__pyx_v_npf64arr, ((PyArrayObject *)__pyx_t_20));
      __pyx_t_20 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1194
 *             # We fill this *now*
 *             npf64arr += params["particle_species_mass"][species]
 *             vp.mass = <np.float64_t*> npf64arr.data             # <<<<<<<<<<<<<<
 * 
 *     status = artio_particle_cache_sfc_range( handle,
 */
      __pyx_v_vp->mass = ((__pyx_t_5numpy_float64_t *)__pyx_v_npf64arr->data);

      /* "yt/frontends/artio/_artio_caller.pyx":1188
 *             vp.svars[vp.n_s] = <np.float64_t *> npf64arr.data
 *             vp.n_s += 1
 *         elif field == "MASS":             # <<<<<<<<<<<<<<
 *             vp.n_mass = 1
 *             data[(species, field)] = np.zeros(tp, dtype="float64")
 */
    }
    __pyx_L20:;

    /* "yt/frontends/artio/_artio_caller.pyx":1156
 *     #        sfc_start, sfc_end + 1, total_particles[ispec], ispec)
 *     data = {}
 *     for species, field in sorted(fields):             # <<<<<<<<<<<<<<
 *         accessed_species[species] = 1
 *         pri_vars = params.get(
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1196
 *             vp.mass = <np.float64_t*> npf64arr.data
 * 
 *     status = artio_particle_cache_sfc_range( handle,             # <<<<<<<<<<<<<<
 *             sfc_start, sfc_end )
 *     check_artio_status(status)
 */
  __pyx_v_status = artio_particle_cache_sfc_range(__pyx_v_handle, __pyx_v_sfc_start, __pyx_v_sfc_end);

  /* "yt/frontends/artio/_artio_caller.pyx":1198
 *     status = artio_particle_cache_sfc_range( handle,
 *             sfc_start, sfc_end )
 *     check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *     for sfc in range(sfc_start, sfc_end + 1):
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":1200
 *     check_artio_status(status)
 * 
 *     for sfc in range(sfc_start, sfc_end + 1):             # <<<<<<<<<<<<<<
 *         c = doct_count[sfc - sfc_start]
 *         check_artio_status(status)
 */
  __pyx_t_9 = (__pyx_v_sfc_end + 1);
  for (__pyx_t_10 = __pyx_v_sfc_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_sfc = __pyx_t_10;

    /* "yt/frontends/artio/_artio_caller.pyx":1201
 * 
 *     for sfc in range(sfc_start, sfc_end + 1):
 *         c = doct_count[sfc - sfc_start]             # <<<<<<<<<<<<<<
 *         check_artio_status(status)
 *         if read_unrefined == 1 and c > 0: continue
 */
    __pyx_v_c = (__pyx_v_doct_count[(__pyx_v_sfc - __pyx_v_sfc_start)]);

    /* "yt/frontends/artio/_artio_caller.pyx":1202
 *     for sfc in range(sfc_start, sfc_end + 1):
 *         c = doct_count[sfc - sfc_start]
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 *         if read_unrefined == 1 and c > 0: continue
 *         if read_unrefined == 0 and c == 0: continue
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":1203
 *         c = doct_count[sfc - sfc_start]
 *         check_artio_status(status)
 *         if read_unrefined == 1 and c > 0: continue             # <<<<<<<<<<<<<<
 *         if read_unrefined == 0 and c == 0: continue
 *         c = 0
 */
    __pyx_t_11 = ((__pyx_v_read_unrefined == 1) != 0);
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L28_bool_binop_done;
    }
    __pyx_t_11 = ((__pyx_v_c > 0) != 0);
    __pyx_t_3 = __pyx_t_11;
    __pyx_L28_bool_binop_done:;
    if (__pyx_t_3) {
      goto __pyx_L25_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1204
 *         check_artio_status(status)
 *         if read_unrefined == 1 and c > 0: continue
 *         if read_unrefined == 0 and c == 0: continue             # <<<<<<<<<<<<<<
 *         c = 0
 *         for ispec in range(num_species) :
 */
    __pyx_t_11 = ((__pyx_v_read_unrefined == 0) != 0);
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L31_bool_binop_done;
    }
    __pyx_t_11 = ((__pyx_v_c == 0) != 0);
    __pyx_t_3 = __pyx_t_11;
    __pyx_L31_bool_binop_done:;
    if (__pyx_t_3) {
      goto __pyx_L25_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1205
 *         if read_unrefined == 1 and c > 0: continue
 *         if read_unrefined == 0 and c == 0: continue
 *         c = 0             # <<<<<<<<<<<<<<
 *         for ispec in range(num_species) :
 *             if accessed_species[ispec] == 0: continue
 */
    __pyx_v_c = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1206
 *         if read_unrefined == 0 and c == 0: continue
 *         c = 0
 *         for ispec in range(num_species) :             # <<<<<<<<<<<<<<
 *             if accessed_species[ispec] == 0: continue
 *             c += pcount[ispec][sfc - sfc_start]
 */
    __pyx_t_1 = __pyx_v_num_species;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
      __pyx_v_ispec = __pyx_t_8;

      /* "yt/frontends/artio/_artio_caller.pyx":1207
 *         c = 0
 *         for ispec in range(num_species) :
 *             if accessed_species[ispec] == 0: continue             # <<<<<<<<<<<<<<
 *             c += pcount[ispec][sfc - sfc_start]
 *         if c == 0: continue
 */
      __pyx_t_3 = (((__pyx_v_accessed_species[__pyx_v_ispec]) == 0) != 0);
      if (__pyx_t_3) {
        goto __pyx_L33_continue;
      }

      /* "yt/frontends/artio/_artio_caller.pyx":1208
 *         for ispec in range(num_species) :
 *             if accessed_species[ispec] == 0: continue
 *             c += pcount[ispec][sfc - sfc_start]             # <<<<<<<<<<<<<<
 *         if c == 0: continue
 *         status = artio_particle_read_root_cell_begin( handle, sfc,
 */
      __pyx_v_c = (__pyx_v_c + ((__pyx_v_pcount[__pyx_v_ispec])[(__pyx_v_sfc - __pyx_v_sfc_start)]));
      __pyx_L33_continue:;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1209
 *             if accessed_species[ispec] == 0: continue
 *             c += pcount[ispec][sfc - sfc_start]
 *         if c == 0: continue             # <<<<<<<<<<<<<<
 *         status = artio_particle_read_root_cell_begin( handle, sfc,
 *                 num_particles_per_species )
 */
    __pyx_t_3 = ((__pyx_v_c == 0) != 0);
    if (__pyx_t_3) {
      goto __pyx_L25_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1210
 *             c += pcount[ispec][sfc - sfc_start]
 *         if c == 0: continue
 *         status = artio_particle_read_root_cell_begin( handle, sfc,             # <<<<<<<<<<<<<<
 *                 num_particles_per_species )
 *         check_artio_status(status)
 */
    __pyx_v_status = artio_particle_read_root_cell_begin(__pyx_v_handle, __pyx_v_sfc, __pyx_v_num_particles_per_species);

    /* "yt/frontends/artio/_artio_caller.pyx":1212
 *         status = artio_particle_read_root_cell_begin( handle, sfc,
 *                 num_particles_per_species )
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 *         for ispec in range(num_species) :
 *             if accessed_species[ispec] == 0: continue
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

    /* "yt/frontends/artio/_artio_caller.pyx":1213
 *                 num_particles_per_species )
 *         check_artio_status(status)
 *         for ispec in range(num_species) :             # <<<<<<<<<<<<<<
 *             if accessed_species[ispec] == 0: continue
 *             status = artio_particle_read_species_begin(handle, ispec);
 */
    __pyx_t_1 = __pyx_v_num_species;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
      __pyx_v_ispec = __pyx_t_8;

      /* "yt/frontends/artio/_artio_caller.pyx":1214
 *         check_artio_status(status)
 *         for ispec in range(num_species) :
 *             if accessed_species[ispec] == 0: continue             # <<<<<<<<<<<<<<
 *             status = artio_particle_read_species_begin(handle, ispec);
 *             check_artio_status(status)
 */
      __pyx_t_3 = (((__pyx_v_accessed_species[__pyx_v_ispec]) == 0) != 0);
      if (__pyx_t_3) {
        goto __pyx_L37_continue;
      }

      /* "yt/frontends/artio/_artio_caller.pyx":1215
 *         for ispec in range(num_species) :
 *             if accessed_species[ispec] == 0: continue
 *             status = artio_particle_read_species_begin(handle, ispec);             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 *             vp = &vpoints[ispec]
 */
      __pyx_v_status = artio_particle_read_species_begin(__pyx_v_handle, __pyx_v_ispec);

      /* "yt/frontends/artio/_artio_caller.pyx":1216
 *             if accessed_species[ispec] == 0: continue
 *             status = artio_particle_read_species_begin(handle, ispec);
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 *             vp = &vpoints[ispec]
 * 
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

      /* "yt/frontends/artio/_artio_caller.pyx":1217
 *             status = artio_particle_read_species_begin(handle, ispec);
 *             check_artio_status(status)
 *             vp = &vpoints[ispec]             # <<<<<<<<<<<<<<
 * 
 *             for particle in range(num_particles_per_species[ispec]) :
 */
      __pyx_v_vp = (&(__pyx_v_vpoints[__pyx_v_ispec]));

      /* "yt/frontends/artio/_artio_caller.pyx":1219
 *             vp = &vpoints[ispec]
 * 
 *             for particle in range(num_particles_per_species[ispec]) :             # <<<<<<<<<<<<<<
 *                 status = artio_particle_read_particle(handle,
 *                         &pid, &subspecies, primary_variables,
 */
      __pyx_t_12 = (__pyx_v_num_particles_per_species[__pyx_v_ispec]);
      for (__pyx_t_28 = 0; __pyx_t_28 < __pyx_t_12; __pyx_t_28+=1) {
        __pyx_v_particle = __pyx_t_28;

        /* "yt/frontends/artio/_artio_caller.pyx":1220
 * 
 *             for particle in range(num_particles_per_species[ispec]) :
 *                 status = artio_particle_read_particle(handle,             # <<<<<<<<<<<<<<
 *                         &pid, &subspecies, primary_variables,
 *                         secondary_variables)
 */
        __pyx_v_status = artio_particle_read_particle(__pyx_v_handle, ((int64_t *)(&__pyx_v_pid)), (&__pyx_v_subspecies), __pyx_v_primary_variables, __pyx_v_secondary_variables);

        /* "yt/frontends/artio/_artio_caller.pyx":1223
 *                         &pid, &subspecies, primary_variables,
 *                         secondary_variables)
 *                 check_artio_status(status)             # <<<<<<<<<<<<<<
 *                 ind = vp.count
 * 
 */
        __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

        /* "yt/frontends/artio/_artio_caller.pyx":1224
 *                         secondary_variables)
 *                 check_artio_status(status)
 *                 ind = vp.count             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(vp.n_p):
 */
        __pyx_t_29 = __pyx_v_vp->count;
        __pyx_v_ind = __pyx_t_29;

        /* "yt/frontends/artio/_artio_caller.pyx":1226
 *                 ind = vp.count
 * 
 *                 for i in range(vp.n_p):             # <<<<<<<<<<<<<<
 *                     vind = vp.p_ind[i]
 *                     vp.pvars[i][ind] = primary_variables[vind]
 */
        __pyx_t_30 = __pyx_v_vp->n_p;
        for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
          __pyx_v_i = __pyx_t_31;

          /* "yt/frontends/artio/_artio_caller.pyx":1227
 * 
 *                 for i in range(vp.n_p):
 *                     vind = vp.p_ind[i]             # <<<<<<<<<<<<<<
 *                     vp.pvars[i][ind] = primary_variables[vind]
 * 
 */
          __pyx_v_vind = (__pyx_v_vp->p_ind[__pyx_v_i]);

          /* "yt/frontends/artio/_artio_caller.pyx":1228
 *                 for i in range(vp.n_p):
 *                     vind = vp.p_ind[i]
 *                     vp.pvars[i][ind] = primary_variables[vind]             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(vp.n_s):
 */
          ((__pyx_v_vp->pvars[__pyx_v_i])[__pyx_v_ind]) = (__pyx_v_primary_variables[__pyx_v_vind]);
        }

        /* "yt/frontends/artio/_artio_caller.pyx":1230
 *                     vp.pvars[i][ind] = primary_variables[vind]
 * 
 *                 for i in range(vp.n_s):             # <<<<<<<<<<<<<<
 *                     vind = vp.s_ind[i]
 *                     vp.svars[i][ind] = secondary_variables[vind]
 */
        __pyx_t_30 = __pyx_v_vp->n_s;
        for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
          __pyx_v_i = __pyx_t_31;

          /* "yt/frontends/artio/_artio_caller.pyx":1231
 * 
 *                 for i in range(vp.n_s):
 *                     vind = vp.s_ind[i]             # <<<<<<<<<<<<<<
 *                     vp.svars[i][ind] = secondary_variables[vind]
 * 
 */
          __pyx_v_vind = (__pyx_v_vp->s_ind[__pyx_v_i]);

          /* "yt/frontends/artio/_artio_caller.pyx":1232
 *                 for i in range(vp.n_s):
 *                     vind = vp.s_ind[i]
 *                     vp.svars[i][ind] = secondary_variables[vind]             # <<<<<<<<<<<<<<
 * 
 *                 if vp.n_pid:
 */
          ((__pyx_v_vp->svars[__pyx_v_i])[__pyx_v_ind]) = (__pyx_v_secondary_variables[__pyx_v_vind]);
        }

        /* "yt/frontends/artio/_artio_caller.pyx":1234
 *                     vp.svars[i][ind] = secondary_variables[vind]
 * 
 *                 if vp.n_pid:             # <<<<<<<<<<<<<<
 *                     vp.pid[ind] = pid
 * 
 */
        __pyx_t_3 = (__pyx_v_vp->n_pid != 0);
        if (__pyx_t_3) {

          /* "yt/frontends/artio/_artio_caller.pyx":1235
 * 
 *                 if vp.n_pid:
 *                     vp.pid[ind] = pid             # <<<<<<<<<<<<<<
 * 
 *                 vp.count += 1
 */
          (__pyx_v_vp->pid[__pyx_v_ind]) = __pyx_v_pid;

          /* "yt/frontends/artio/_artio_caller.pyx":1234
 *                     vp.svars[i][ind] = secondary_variables[vind]
 * 
 *                 if vp.n_pid:             # <<<<<<<<<<<<<<
 *                     vp.pid[ind] = pid
 * 
 */
        }

        /* "yt/frontends/artio/_artio_caller.pyx":1237
 *                     vp.pid[ind] = pid
 * 
 *                 vp.count += 1             # <<<<<<<<<<<<<<
 * 
 *             status = artio_particle_read_species_end( handle )
 */
        __pyx_v_vp->count = (__pyx_v_vp->count + 1);
      }

      /* "yt/frontends/artio/_artio_caller.pyx":1239
 *                 vp.count += 1
 * 
 *             status = artio_particle_read_species_end( handle )             # <<<<<<<<<<<<<<
 *             check_artio_status(status)
 * 
 */
      __pyx_v_status = artio_particle_read_species_end(__pyx_v_handle);

      /* "yt/frontends/artio/_artio_caller.pyx":1240
 * 
 *             status = artio_particle_read_species_end( handle )
 *             check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *         status = artio_particle_read_root_cell_end( handle )
 */
      __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
      __pyx_L37_continue:;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1242
 *             check_artio_status(status)
 * 
 *         status = artio_particle_read_root_cell_end( handle )             # <<<<<<<<<<<<<<
 *         check_artio_status(status)
 * 
 */
    __pyx_v_status = artio_particle_read_root_cell_end(__pyx_v_handle);

    /* "yt/frontends/artio/_artio_caller.pyx":1243
 * 
 *         status = artio_particle_read_root_cell_end( handle )
 *         check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *     status = artio_particle_clear_sfc_cache(handle)
 */
    __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);
    __pyx_L25_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1245
 *         check_artio_status(status)
 * 
 *     status = artio_particle_clear_sfc_cache(handle)             # <<<<<<<<<<<<<<
 *     check_artio_status(status)
 * 
 */
  __pyx_v_status = artio_particle_clear_sfc_cache(__pyx_v_handle);

  /* "yt/frontends/artio/_artio_caller.pyx":1246
 * 
 *     status = artio_particle_clear_sfc_cache(handle)
 *     check_artio_status(status)             # <<<<<<<<<<<<<<
 * 
 *     free(num_octs_per_level)
 */
  __pyx_f_2yt_9frontends_5artio_13_artio_caller_check_artio_status(__pyx_v_status, NULL);

  /* "yt/frontends/artio/_artio_caller.pyx":1248
 *     check_artio_status(status)
 * 
 *     free(num_octs_per_level)             # <<<<<<<<<<<<<<
 *     free(num_particles_per_species)
 *     free(total_particles)
 */
  free(__pyx_v_num_octs_per_level);

  /* "yt/frontends/artio/_artio_caller.pyx":1249
 * 
 *     free(num_octs_per_level)
 *     free(num_particles_per_species)             # <<<<<<<<<<<<<<
 *     free(total_particles)
 *     free(accessed_species)
 */
  free(__pyx_v_num_particles_per_species);

  /* "yt/frontends/artio/_artio_caller.pyx":1250
 *     free(num_octs_per_level)
 *     free(num_particles_per_species)
 *     free(total_particles)             # <<<<<<<<<<<<<<
 *     free(accessed_species)
 *     free(vpoints)
 */
  free(__pyx_v_total_particles);

  /* "yt/frontends/artio/_artio_caller.pyx":1251
 *     free(num_particles_per_species)
 *     free(total_particles)
 *     free(accessed_species)             # <<<<<<<<<<<<<<
 *     free(vpoints)
 *     free(primary_variables)
 */
  free(__pyx_v_accessed_species);

  /* "yt/frontends/artio/_artio_caller.pyx":1252
 *     free(total_particles)
 *     free(accessed_species)
 *     free(vpoints)             # <<<<<<<<<<<<<<
 *     free(primary_variables)
 *     free(secondary_variables)
 */
  free(__pyx_v_vpoints);

  /* "yt/frontends/artio/_artio_caller.pyx":1253
 *     free(accessed_species)
 *     free(vpoints)
 *     free(primary_variables)             # <<<<<<<<<<<<<<
 *     free(secondary_variables)
 *     return data
 */
  free(__pyx_v_primary_variables);

  /* "yt/frontends/artio/_artio_caller.pyx":1254
 *     free(vpoints)
 *     free(primary_variables)
 *     free(secondary_variables)             # <<<<<<<<<<<<<<
 *     return data
 * 
 */
  free(__pyx_v_secondary_variables);

  /* "yt/frontends/artio/_artio_caller.pyx":1255
 *     free(primary_variables)
 *     free(secondary_variables)
 *     return data             # <<<<<<<<<<<<<<
 * 
 * cdef class ARTIORootMeshContainer:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_data);
  __pyx_r = __pyx_v_data;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1085
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef read_sfc_particles(artio_fileset artio_handle,             # <<<<<<<<<<<<<<
 *                         np.int64_t sfc_start, np.int64_t sfc_end,
 *                         int read_unrefined, fields,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npi64arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.read_sfc_particles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npf64arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npi64arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_npi8arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_npi8arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_npi64arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_npf64arr);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_npri_vars);
  __Pyx_XDECREF(__pyx_v_nsec_vars);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_species);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_pri_vars);
  __Pyx_XDECREF(__pyx_v_sec_vars);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1273
 *     cdef np.int64_t nsfc
 * 
 *     def __init__(self, ARTIOSFCRangeHandler range_handler):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef np.int64_t sfci
 */

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_range_handler,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_range_handler)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_range_handler), __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, 1, "range_handler", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer___init__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_range_handler);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *__pyx_v_range_handler) {
  int __pyx_v_i;
  __pyx_t_5numpy_int64_t __pyx_v_sfci;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  artio_fileset *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_4;
  __pyx_t_5numpy_uint64_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":1276
 *         cdef int i
 *         cdef np.int64_t sfci
 *         for i in range(3):             # <<<<<<<<<<<<<<
 *             self.DLE[i] = range_handler.DLE[i]
 *             self.DRE[i] = range_handler.DRE[i]
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "yt/frontends/artio/_artio_caller.pyx":1277
 *         cdef np.int64_t sfci
 *         for i in range(3):
 *             self.DLE[i] = range_handler.DLE[i]             # <<<<<<<<<<<<<<
 *             self.DRE[i] = range_handler.DRE[i]
 *             self.dims[i] = range_handler.dims[i]
 */
    (__pyx_v_self->DLE[__pyx_v_i]) = (__pyx_v_range_handler->DLE[__pyx_v_i]);

    /* "yt/frontends/artio/_artio_caller.pyx":1278
 *         for i in range(3):
 *             self.DLE[i] = range_handler.DLE[i]
 *             self.DRE[i] = range_handler.DRE[i]             # <<<<<<<<<<<<<<
 *             self.dims[i] = range_handler.dims[i]
 *             self.dds[i] = range_handler.dds[i]
 */
    (__pyx_v_self->DRE[__pyx_v_i]) = (__pyx_v_range_handler->DRE[__pyx_v_i]);

    /* "yt/frontends/artio/_artio_caller.pyx":1279
 *             self.DLE[i] = range_handler.DLE[i]
 *             self.DRE[i] = range_handler.DRE[i]
 *             self.dims[i] = range_handler.dims[i]             # <<<<<<<<<<<<<<
 *             self.dds[i] = range_handler.dds[i]
 *         self.handle = range_handler.handle
 */
    (__pyx_v_self->dims[__pyx_v_i]) = (__pyx_v_range_handler->dims[__pyx_v_i]);

    /* "yt/frontends/artio/_artio_caller.pyx":1280
 *             self.DRE[i] = range_handler.DRE[i]
 *             self.dims[i] = range_handler.dims[i]
 *             self.dds[i] = range_handler.dds[i]             # <<<<<<<<<<<<<<
 *         self.handle = range_handler.handle
 *         self.artio_handle = range_handler.artio_handle
 */
    (__pyx_v_self->dds[__pyx_v_i]) = (__pyx_v_range_handler->dds[__pyx_v_i]);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1281
 *             self.dims[i] = range_handler.dims[i]
 *             self.dds[i] = range_handler.dds[i]
 *         self.handle = range_handler.handle             # <<<<<<<<<<<<<<
 *         self.artio_handle = range_handler.artio_handle
 *         self._last_mask = None
 */
  __pyx_t_2 = __pyx_v_range_handler->handle;
  __pyx_v_self->handle = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":1282
 *             self.dds[i] = range_handler.dds[i]
 *         self.handle = range_handler.handle
 *         self.artio_handle = range_handler.artio_handle             # <<<<<<<<<<<<<<
 *         self._last_mask = None
 *         self._last_selector_id = -1
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_range_handler->artio_handle);
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1283
 *         self.handle = range_handler.handle
 *         self.artio_handle = range_handler.artio_handle
 *         self._last_mask = None             # <<<<<<<<<<<<<<
 *         self._last_selector_id = -1
 *         self.sfc_start = range_handler.sfc_start
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_last_mask);
  __Pyx_DECREF(__pyx_v_self->_last_mask);
  __pyx_v_self->_last_mask = Py_None;

  /* "yt/frontends/artio/_artio_caller.pyx":1284
 *         self.artio_handle = range_handler.artio_handle
 *         self._last_mask = None
 *         self._last_selector_id = -1             # <<<<<<<<<<<<<<
 *         self.sfc_start = range_handler.sfc_start
 *         self.sfc_end = range_handler.sfc_end
 */
  __pyx_v_self->_last_selector_id = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1285
 *         self._last_mask = None
 *         self._last_selector_id = -1
 *         self.sfc_start = range_handler.sfc_start             # <<<<<<<<<<<<<<
 *         self.sfc_end = range_handler.sfc_end
 *         self.range_handler = range_handler
 */
  __pyx_t_4 = __pyx_v_range_handler->sfc_start;
  __pyx_v_self->sfc_start = __pyx_t_4;

  /* "yt/frontends/artio/_artio_caller.pyx":1286
 *         self._last_selector_id = -1
 *         self.sfc_start = range_handler.sfc_start
 *         self.sfc_end = range_handler.sfc_end             # <<<<<<<<<<<<<<
 *         self.range_handler = range_handler
 *         # We assume that the number of octs has been created and filled
 */
  __pyx_t_4 = __pyx_v_range_handler->sfc_end;
  __pyx_v_self->sfc_end = __pyx_t_4;

  /* "yt/frontends/artio/_artio_caller.pyx":1287
 *         self.sfc_start = range_handler.sfc_start
 *         self.sfc_end = range_handler.sfc_end
 *         self.range_handler = range_handler             # <<<<<<<<<<<<<<
 *         # We assume that the number of octs has been created and filled
 *         # already.  We no longer care about ANY of the SFCs that have octs
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_range_handler));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_range_handler));
  __Pyx_GOTREF(__pyx_v_self->range_handler);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->range_handler));
  __pyx_v_self->range_handler = __pyx_v_range_handler;

  /* "yt/frontends/artio/_artio_caller.pyx":1292
 *         # inside them -- this goes for every operation that this object
 *         # performs.
 *         self.sfc_mask = <np.uint8_t *>malloc(sizeof(np.uint8_t) *             # <<<<<<<<<<<<<<
 *           self.sfc_end - self.sfc_start + 1)
 *         self.nsfc = 0
 */
  __pyx_v_self->sfc_mask = ((__pyx_t_5numpy_uint8_t *)malloc(((((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_self->sfc_end) - __pyx_v_self->sfc_start) + 1)));

  /* "yt/frontends/artio/_artio_caller.pyx":1294
 *         self.sfc_mask = <np.uint8_t *>malloc(sizeof(np.uint8_t) *
 *           self.sfc_end - self.sfc_start + 1)
 *         self.nsfc = 0             # <<<<<<<<<<<<<<
 *         for sfci in range(self.sfc_end - self.sfc_start + 1):
 *             if self.range_handler.oct_count[sfci] > 0:
 */
  __pyx_v_self->nsfc = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1295
 *           self.sfc_end - self.sfc_start + 1)
 *         self.nsfc = 0
 *         for sfci in range(self.sfc_end - self.sfc_start + 1):             # <<<<<<<<<<<<<<
 *             if self.range_handler.oct_count[sfci] > 0:
 *                 self.sfc_mask[sfci] = 0
 */
  __pyx_t_5 = ((__pyx_v_self->sfc_end - __pyx_v_self->sfc_start) + 1);
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
    __pyx_v_sfci = __pyx_t_4;

    /* "yt/frontends/artio/_artio_caller.pyx":1296
 *         self.nsfc = 0
 *         for sfci in range(self.sfc_end - self.sfc_start + 1):
 *             if self.range_handler.oct_count[sfci] > 0:             # <<<<<<<<<<<<<<
 *                 self.sfc_mask[sfci] = 0
 *             else:
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->range_handler->oct_count, __pyx_v_sfci, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {

      /* "yt/frontends/artio/_artio_caller.pyx":1297
 *         for sfci in range(self.sfc_end - self.sfc_start + 1):
 *             if self.range_handler.oct_count[sfci] > 0:
 *                 self.sfc_mask[sfci] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 self.sfc_mask[sfci] = 1
 */
      (__pyx_v_self->sfc_mask[__pyx_v_sfci]) = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1296
 *         self.nsfc = 0
 *         for sfci in range(self.sfc_end - self.sfc_start + 1):
 *             if self.range_handler.oct_count[sfci] > 0:             # <<<<<<<<<<<<<<
 *                 self.sfc_mask[sfci] = 0
 *             else:
 */
      goto __pyx_L7;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1299
 *                 self.sfc_mask[sfci] = 0
 *             else:
 *                 self.sfc_mask[sfci] = 1             # <<<<<<<<<<<<<<
 *                 self.nsfc += 1
 * 
 */
    /*else*/ {
      (__pyx_v_self->sfc_mask[__pyx_v_sfci]) = 1;

      /* "yt/frontends/artio/_artio_caller.pyx":1300
 *             else:
 *                 self.sfc_mask[sfci] = 1
 *                 self.nsfc += 1             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
      __pyx_v_self->nsfc = (__pyx_v_self->nsfc + 1);
    }
    __pyx_L7:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1273
 *     cdef np.int64_t nsfc
 * 
 *     def __init__(self, ARTIOSFCRangeHandler range_handler):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef np.int64_t sfci
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1302
 *                 self.nsfc += 1
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.sfc_mask)
 * 
 */

/* Python wrapper */
static void __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_2__dealloc__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_2__dealloc__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":1303
 * 
 *     def __dealloc__(self):
 *         free(self.sfc_mask)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  free(__pyx_v_self->sfc_mask);

  /* "yt/frontends/artio/_artio_caller.pyx":1302
 *                 self.nsfc += 1
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.sfc_mask)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "yt/frontends/artio/_artio_caller.pyx":1306
 * 
 *     @cython.cdivision(True)
 *     cdef np.int64_t pos_to_sfc(self, np.float64_t pos[3]) nogil:             # <<<<<<<<<<<<<<
 *         # Calculate the index
 *         cdef int coords[3]
 */

static __pyx_t_5numpy_int64_t __pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_pos_to_sfc(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) {
  int __pyx_v_coords[3];
  int __pyx_v_i;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_r;
  int __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1311
 *         cdef int i
 *         cdef np.int64_t sfc
 *         for i in range(3):             # <<<<<<<<<<<<<<
 *             coords[i] = <int>((pos[i] - self.DLE[i])/self.dds[i])
 *         sfc = artio_sfc_index(self.handle, coords)
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "yt/frontends/artio/_artio_caller.pyx":1312
 *         cdef np.int64_t sfc
 *         for i in range(3):
 *             coords[i] = <int>((pos[i] - self.DLE[i])/self.dds[i])             # <<<<<<<<<<<<<<
 *         sfc = artio_sfc_index(self.handle, coords)
 *         return sfc
 */
    (__pyx_v_coords[__pyx_v_i]) = ((int)(((__pyx_v_pos[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->dds[__pyx_v_i])));
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1313
 *         for i in range(3):
 *             coords[i] = <int>((pos[i] - self.DLE[i])/self.dds[i])
 *         sfc = artio_sfc_index(self.handle, coords)             # <<<<<<<<<<<<<<
 *         return sfc
 * 
 */
  __pyx_v_sfc = artio_sfc_index(__pyx_v_self->handle, __pyx_v_coords);

  /* "yt/frontends/artio/_artio_caller.pyx":1314
 *             coords[i] = <int>((pos[i] - self.DLE[i])/self.dds[i])
 *         sfc = artio_sfc_index(self.handle, coords)
 *         return sfc             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_r = __pyx_v_sfc;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1306
 * 
 *     @cython.cdivision(True)
 *     cdef np.int64_t pos_to_sfc(self, np.float64_t pos[3]) nogil:             # <<<<<<<<<<<<<<
 *         # Calculate the index
 *         cdef int coords[3]
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1317
 * 
 *     @cython.cdivision(True)
 *     cdef void sfc_to_pos(self, np.int64_t sfc, np.float64_t pos[3]) nogil:             # <<<<<<<<<<<<<<
 *         cdef int coords[3]
 *         cdef int i
 */

static void __pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_sfc_to_pos(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_sfc, __pyx_t_5numpy_float64_t *__pyx_v_pos) {
  int __pyx_v_coords[3];
  int __pyx_v_i;
  int __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1320
 *         cdef int coords[3]
 *         cdef int i
 *         artio_sfc_coords(self.handle, sfc, coords)             # <<<<<<<<<<<<<<
 *         for i in range(3):
 *             pos[i] = self.DLE[i] + (coords[i] + 0.5) * self.dds[i]
 */
  artio_sfc_coords(__pyx_v_self->handle, __pyx_v_sfc, __pyx_v_coords);

  /* "yt/frontends/artio/_artio_caller.pyx":1321
 *         cdef int i
 *         artio_sfc_coords(self.handle, sfc, coords)
 *         for i in range(3):             # <<<<<<<<<<<<<<
 *             pos[i] = self.DLE[i] + (coords[i] + 0.5) * self.dds[i]
 * 
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "yt/frontends/artio/_artio_caller.pyx":1322
 *         artio_sfc_coords(self.handle, sfc, coords)
 *         for i in range(3):
 *             pos[i] = self.DLE[i] + (coords[i] + 0.5) * self.dds[i]             # <<<<<<<<<<<<<<
 * 
 *     cdef np.int64_t count_cells(self, SelectorObject selector):
 */
    (__pyx_v_pos[__pyx_v_i]) = ((__pyx_v_self->DLE[__pyx_v_i]) + (((__pyx_v_coords[__pyx_v_i]) + 0.5) * (__pyx_v_self->dds[__pyx_v_i])));
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1317
 * 
 *     @cython.cdivision(True)
 *     cdef void sfc_to_pos(self, np.int64_t sfc, np.float64_t pos[3]) nogil:             # <<<<<<<<<<<<<<
 *         cdef int coords[3]
 *         cdef int i
 */

  /* function exit code */
}

/* "yt/frontends/artio/_artio_caller.pyx":1324
 *             pos[i] = self.DLE[i] + (coords[i] + 0.5) * self.dds[i]
 * 
 *     cdef np.int64_t count_cells(self, SelectorObject selector):             # <<<<<<<<<<<<<<
 *         # We visit each cell if it is not refined and determine whether it is
 *         # included or not.
 */

static __pyx_t_5numpy_int64_t __pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_count_cells(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) {
  CYTHON_UNUSED int __pyx_v_num_cells;
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("count_cells", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":1330
 *         cdef np.float64_t pos[3]
 *         cdef np.float64_t right_edge[3]
 *         cdef int num_cells = 0             # <<<<<<<<<<<<<<
 *         cdef int i
 *         return self.mask(selector).sum()
 */
  __pyx_v_num_cells = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1332
 *         cdef int num_cells = 0
 *         cdef int i
 *         return self.mask(selector).sum()             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_selector)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_selector));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_selector));
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1324
 *             pos[i] = self.DLE[i] + (coords[i] + 0.5) * self.dds[i]
 * 
 *     cdef np.int64_t count_cells(self, SelectorObject selector):             # <<<<<<<<<<<<<<
 *         # We visit each cell if it is not refined and determine whether it is
 *         # included or not.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.count_cells", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1337
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def icoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         # Note that num_octs does not have to equal sfc_end - sfc_start + 1.
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_5icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_5icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  __pyx_t_5numpy_int64_t __pyx_v_num_cells;
  CYTHON_UNUSED int __pyx_v_domain_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("icoords (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "icoords") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    if (values[1]) {
      __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1);
    }
    if (values[2]) {
      __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_domain_id = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("icoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.icoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_4icoords(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_4icoords(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id) {
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_sfci;
  int __pyx_v_acoords[3];
  int __pyx_v_i;
  PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_coords = 0;
  int __pyx_v_filled;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
  __Pyx_Buffer __pyx_pybuffer_coords;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_10;
  PyArrayObject *__pyx_t_11 = NULL;
  __pyx_t_5numpy_uint64_t __pyx_t_12;
  int __pyx_t_13;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("icoords", 0);
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_coords.pybuffer.buf = NULL;
  __pyx_pybuffer_coords.refcount = 0;
  __pyx_pybuffernd_coords.data = NULL;
  __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;

  /* "yt/frontends/artio/_artio_caller.pyx":1340
 *                 int domain_id = -1):
 *         # Note that num_octs does not have to equal sfc_end - sfc_start + 1.
 *         cdef np.int64_t sfc, sfci = -1             # <<<<<<<<<<<<<<
 *         cdef int acoords[3]
 *         cdef int i
 */
  __pyx_v_sfci = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1344
 *         cdef int i
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)             # <<<<<<<<<<<<<<
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.int64_t, ndim=2] coords
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_selector)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_selector));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_selector));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1345
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)
 *         num_cells = self._last_mask_sum             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.int64_t, ndim=2] coords
 *         coords = np.empty((num_cells, 3), dtype="int64")
 */
  __pyx_t_10 = __pyx_v_self->_last_mask_sum;
  __pyx_v_num_cells = __pyx_t_10;

  /* "yt/frontends/artio/_artio_caller.pyx":1347
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.int64_t, ndim=2] coords
 *         coords = np.empty((num_cells, 3), dtype="int64")             # <<<<<<<<<<<<<<
 *         cdef int filled = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_coords = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1348
 *         cdef np.ndarray[np.int64_t, ndim=2] coords
 *         coords = np.empty((num_cells, 3), dtype="int64")
 *         cdef int filled = 0             # <<<<<<<<<<<<<<
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 */
  __pyx_v_filled = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1349
 *         coords = np.empty((num_cells, 3), dtype="int64")
 *         cdef int filled = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 */
  __pyx_t_12 = (__pyx_v_self->sfc_end + 1);
  for (__pyx_t_10 = __pyx_v_self->sfc_start; __pyx_t_10 < __pyx_t_12; __pyx_t_10+=1) {
    __pyx_v_sfc = __pyx_t_10;

    /* "yt/frontends/artio/_artio_caller.pyx":1350
 *         cdef int filled = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue             # <<<<<<<<<<<<<<
 *             sfci += 1
 *             if mask[sfci] == 0: continue
 */
    __pyx_t_13 = (((__pyx_v_self->sfc_mask[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) == 0) != 0);
    if (__pyx_t_13) {
      goto __pyx_L3_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1351
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1             # <<<<<<<<<<<<<<
 *             if mask[sfci] == 0: continue
 *             # Note that we do *no* checks on refinement here.  In fact, this
 */
    __pyx_v_sfci = (__pyx_v_sfci + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":1352
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 *             if mask[sfci] == 0: continue             # <<<<<<<<<<<<<<
 *             # Note that we do *no* checks on refinement here.  In fact, this
 *             # entire setup should not need to touch the disk except if the
 */
    __pyx_t_14 = __pyx_v_sfci;
    __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides)) == 0) != 0);
    if (__pyx_t_13) {
      goto __pyx_L3_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1356
 *             # entire setup should not need to touch the disk except if the
 *             # artio sfc calculators need to.
 *             artio_sfc_coords(self.handle, sfc, acoords)             # <<<<<<<<<<<<<<
 *             for i in range(3):
 *                 coords[filled, i] = acoords[i]
 */
    artio_sfc_coords(__pyx_v_self->handle, __pyx_v_sfc, __pyx_v_acoords);

    /* "yt/frontends/artio/_artio_caller.pyx":1357
 *             # artio sfc calculators need to.
 *             artio_sfc_coords(self.handle, sfc, acoords)
 *             for i in range(3):             # <<<<<<<<<<<<<<
 *                 coords[filled, i] = acoords[i]
 *             filled += 1
 */
    for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "yt/frontends/artio/_artio_caller.pyx":1358
 *             artio_sfc_coords(self.handle, sfc, acoords)
 *             for i in range(3):
 *                 coords[filled, i] = acoords[i]             # <<<<<<<<<<<<<<
 *             filled += 1
 *         return coords
 */
      __pyx_t_15 = __pyx_v_filled;
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_coords.diminfo[1].strides) = (__pyx_v_acoords[__pyx_v_i]);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1359
 *             for i in range(3):
 *                 coords[filled, i] = acoords[i]
 *             filled += 1             # <<<<<<<<<<<<<<
 *         return coords
 * 
 */
    __pyx_v_filled = (__pyx_v_filled + 1);
    __pyx_L3_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1360
 *                 coords[filled, i] = acoords[i]
 *             filled += 1
 *         return coords             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_coords));
  __pyx_r = ((PyObject *)__pyx_v_coords);
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1337
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def icoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         # Note that num_octs does not have to equal sfc_end - sfc_start + 1.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.icoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1365
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         # Note that num_cells does not have to equal sfc_end - sfc_start + 1.
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_7fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_7fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  __pyx_t_5numpy_int64_t __pyx_v_num_cells;
  CYTHON_UNUSED int __pyx_v_domain_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fcoords (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fcoords") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    if (values[1]) {
      __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1);
    }
    if (values[2]) {
      __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_domain_id = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fcoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_6fcoords(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_6fcoords(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id) {
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_sfci;
  __pyx_t_5numpy_float64_t __pyx_v_pos[3];
  int __pyx_v_i;
  PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_coords = 0;
  int __pyx_v_filled;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
  __Pyx_Buffer __pyx_pybuffer_coords;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_10;
  PyArrayObject *__pyx_t_11 = NULL;
  __pyx_t_5numpy_uint64_t __pyx_t_12;
  int __pyx_t_13;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fcoords", 0);
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_coords.pybuffer.buf = NULL;
  __pyx_pybuffer_coords.refcount = 0;
  __pyx_pybuffernd_coords.data = NULL;
  __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;

  /* "yt/frontends/artio/_artio_caller.pyx":1368
 *                 int domain_id = -1):
 *         # Note that num_cells does not have to equal sfc_end - sfc_start + 1.
 *         cdef np.int64_t sfc, sfci = -1             # <<<<<<<<<<<<<<
 *         cdef np.float64_t pos[3]
 *         cdef int acoords[3]
 */
  __pyx_v_sfci = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1373
 *         cdef int i
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)             # <<<<<<<<<<<<<<
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.float64_t, ndim=2] coords
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_selector)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_selector));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_selector));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1374
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)
 *         num_cells = self._last_mask_sum             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.float64_t, ndim=2] coords
 *         coords = np.empty((num_cells, 3), dtype="float64")
 */
  __pyx_t_10 = __pyx_v_self->_last_mask_sum;
  __pyx_v_num_cells = __pyx_t_10;

  /* "yt/frontends/artio/_artio_caller.pyx":1376
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.float64_t, ndim=2] coords
 *         coords = np.empty((num_cells, 3), dtype="float64")             # <<<<<<<<<<<<<<
 *         cdef int filled = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_coords = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1377
 *         cdef np.ndarray[np.float64_t, ndim=2] coords
 *         coords = np.empty((num_cells, 3), dtype="float64")
 *         cdef int filled = 0             # <<<<<<<<<<<<<<
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 */
  __pyx_v_filled = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1378
 *         coords = np.empty((num_cells, 3), dtype="float64")
 *         cdef int filled = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 */
  __pyx_t_12 = (__pyx_v_self->sfc_end + 1);
  for (__pyx_t_10 = __pyx_v_self->sfc_start; __pyx_t_10 < __pyx_t_12; __pyx_t_10+=1) {
    __pyx_v_sfc = __pyx_t_10;

    /* "yt/frontends/artio/_artio_caller.pyx":1379
 *         cdef int filled = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue             # <<<<<<<<<<<<<<
 *             sfci += 1
 *             if mask[sfci] == 0: continue
 */
    __pyx_t_13 = (((__pyx_v_self->sfc_mask[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) == 0) != 0);
    if (__pyx_t_13) {
      goto __pyx_L3_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1380
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1             # <<<<<<<<<<<<<<
 *             if mask[sfci] == 0: continue
 *             # Note that we do *no* checks on refinement here.  In fact, this
 */
    __pyx_v_sfci = (__pyx_v_sfci + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":1381
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 *             if mask[sfci] == 0: continue             # <<<<<<<<<<<<<<
 *             # Note that we do *no* checks on refinement here.  In fact, this
 *             # entire setup should not need to touch the disk except if the
 */
    __pyx_t_14 = __pyx_v_sfci;
    __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides)) == 0) != 0);
    if (__pyx_t_13) {
      goto __pyx_L3_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1385
 *             # entire setup should not need to touch the disk except if the
 *             # artio sfc calculators need to.
 *             self.sfc_to_pos(sfc, pos)             # <<<<<<<<<<<<<<
 *             for i in range(3):
 *                 coords[filled, i] = pos[i]
 */
    ((struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self->__pyx_vtab)->sfc_to_pos(__pyx_v_self, __pyx_v_sfc, __pyx_v_pos);

    /* "yt/frontends/artio/_artio_caller.pyx":1386
 *             # artio sfc calculators need to.
 *             self.sfc_to_pos(sfc, pos)
 *             for i in range(3):             # <<<<<<<<<<<<<<
 *                 coords[filled, i] = pos[i]
 *             filled += 1
 */
    for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "yt/frontends/artio/_artio_caller.pyx":1387
 *             self.sfc_to_pos(sfc, pos)
 *             for i in range(3):
 *                 coords[filled, i] = pos[i]             # <<<<<<<<<<<<<<
 *             filled += 1
 *         return coords
 */
      __pyx_t_15 = __pyx_v_filled;
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_coords.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_coords.diminfo[1].strides) = (__pyx_v_pos[__pyx_v_i]);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1388
 *             for i in range(3):
 *                 coords[filled, i] = pos[i]
 *             filled += 1             # <<<<<<<<<<<<<<
 *         return coords
 * 
 */
    __pyx_v_filled = (__pyx_v_filled + 1);
    __pyx_L3_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1389
 *                 coords[filled, i] = pos[i]
 *             filled += 1
 *         return coords             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_coords));
  __pyx_r = ((PyObject *)__pyx_v_coords);
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1365
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         # Note that num_cells does not have to equal sfc_end - sfc_start + 1.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1394
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         cdef int i
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_9fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_9fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  __pyx_t_5numpy_int64_t __pyx_v_num_cells;
  CYTHON_UNUSED int __pyx_v_domain_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fwidth (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwidth") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    if (values[1]) {
      __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1);
    }
    if (values[2]) {
      __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_domain_id = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fwidth", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_8fwidth(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_8fwidth(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id) {
  int __pyx_v_i;
  CYTHON_UNUSED PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_width = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_width;
  __Pyx_Buffer __pyx_pybuffer_width;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_10;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fwidth", 0);
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_width.pybuffer.buf = NULL;
  __pyx_pybuffer_width.refcount = 0;
  __pyx_pybuffernd_width.data = NULL;
  __pyx_pybuffernd_width.rcbuffer = &__pyx_pybuffer_width;

  /* "yt/frontends/artio/_artio_caller.pyx":1398
 *         cdef int i
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)             # <<<<<<<<<<<<<<
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.float64_t, ndim=2] width
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_selector)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_selector));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_selector));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1399
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)
 *         num_cells = self._last_mask_sum             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.float64_t, ndim=2] width
 *         width = np.zeros((num_cells, 3), dtype="float64")
 */
  __pyx_t_10 = __pyx_v_self->_last_mask_sum;
  __pyx_v_num_cells = __pyx_t_10;

  /* "yt/frontends/artio/_artio_caller.pyx":1401
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.float64_t, ndim=2] width
 *         width = np.zeros((num_cells, 3), dtype="float64")             # <<<<<<<<<<<<<<
 *         for i in range(3):
 *             width[:,i] = self.dds[i]
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_width.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_width.rcbuffer->pybuffer, (PyObject*)__pyx_v_width, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_pybuffernd_width.diminfo[0].strides = __pyx_pybuffernd_width.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_width.diminfo[0].shape = __pyx_pybuffernd_width.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_width.diminfo[1].strides = __pyx_pybuffernd_width.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_width.diminfo[1].shape = __pyx_pybuffernd_width.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_width = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1402
 *         cdef np.ndarray[np.float64_t, ndim=2] width
 *         width = np.zeros((num_cells, 3), dtype="float64")
 *         for i in range(3):             # <<<<<<<<<<<<<<
 *             width[:,i] = self.dds[i]
 *         return width
 */
  for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "yt/frontends/artio/_artio_caller.pyx":1403
 *         width = np.zeros((num_cells, 3), dtype="float64")
 *         for i in range(3):
 *             width[:,i] = self.dds[i]             # <<<<<<<<<<<<<<
 *         return width
 * 
 */
    __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->dds[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_slice__31);
    __Pyx_GIVEREF(__pyx_slice__31);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__31);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_width), __pyx_t_1, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1404
 *         for i in range(3):
 *             width[:,i] = self.dds[i]
 *         return width             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_width));
  __pyx_r = ((PyObject *)__pyx_v_width);
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1394
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         cdef int i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_width.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_width.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_width);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1409
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def ires(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_11ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_11ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  __pyx_t_5numpy_int64_t __pyx_v_num_cells;
  CYTHON_UNUSED int __pyx_v_domain_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ires (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ires") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    if (values[1]) {
      __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1);
    }
    if (values[2]) {
      __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_domain_id = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ires", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.ires", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10ires(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10ires(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id) {
  CYTHON_UNUSED PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_10;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ires", 0);
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "yt/frontends/artio/_artio_caller.pyx":1412
 *                 int domain_id = -1):
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)             # <<<<<<<<<<<<<<
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.int64_t, ndim=1] res
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_selector)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_selector));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_selector));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1413
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)
 *         num_cells = self._last_mask_sum             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.int64_t, ndim=1] res
 *         res = np.zeros(num_cells, dtype="int64")
 */
  __pyx_t_10 = __pyx_v_self->_last_mask_sum;
  __pyx_v_num_cells = __pyx_t_10;

  /* "yt/frontends/artio/_artio_caller.pyx":1415
 *         num_cells = self._last_mask_sum
 *         cdef np.ndarray[np.int64_t, ndim=1] res
 *         res = np.zeros(num_cells, dtype="int64")             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_v_res, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1416
 *         cdef np.ndarray[np.int64_t, ndim=1] res
 *         res = np.zeros(num_cells, dtype="int64")
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_res));
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1409
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def ires(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *                 int domain_id = -1):
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.ires", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1421
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def selector_fill(self, SelectorObject selector,             # <<<<<<<<<<<<<<
 *                       np.ndarray source,
 *                       np.ndarray dest = None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_13selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_13selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  PyArrayObject *__pyx_v_source = 0;
  PyArrayObject *__pyx_v_dest = 0;
  __pyx_t_5numpy_int64_t __pyx_v_offset;
  int __pyx_v_dims;
  CYTHON_UNUSED int __pyx_v_domain_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("selector_fill (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_offset,&__pyx_n_s_dims,&__pyx_n_s_domain_id,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "yt/frontends/artio/_artio_caller.pyx":1423
 *     def selector_fill(self, SelectorObject selector,
 *                       np.ndarray source,
 *                       np.ndarray dest = None,             # <<<<<<<<<<<<<<
 *                       np.int64_t offset = 0, int dims = 1,
 *                       int domain_id = -1):
 */
    values[2] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dims);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "selector_fill") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    __pyx_v_source = ((PyArrayObject *)values[1]);
    __pyx_v_dest = ((PyArrayObject *)values[2]);
    if (values[3]) {
      __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_offset == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_offset = ((__pyx_t_5numpy_int64_t)0);
    }
    if (values[4]) {
      __pyx_v_dims = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_dims = ((int)1);
    }
    if (values[5]) {
      __pyx_v_domain_id = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_domain_id = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.selector_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_5numpy_ndarray, 1, "source", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_5numpy_ndarray, 1, "dest", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12selector_fill(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_source, __pyx_v_dest, __pyx_v_offset, __pyx_v_dims, __pyx_v_domain_id);

  /* "yt/frontends/artio/_artio_caller.pyx":1421
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def selector_fill(self, SelectorObject selector,             # <<<<<<<<<<<<<<
 *                       np.ndarray source,
 *                       np.ndarray dest = None,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12selector_fill(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, CYTHON_UNUSED int __pyx_v_domain_id) {
  __pyx_t_5numpy_int64_t __pyx_v_num_cells;
  __pyx_t_5numpy_int64_t __pyx_v_ind;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_sfci;
  int __pyx_v_filled;
  int __pyx_v_max_level;
  CYTHON_UNUSED int *__pyx_v_num_octs_per_level;
  char *__pyx_v_sdata;
  char *__pyx_v_ddata;
  int __pyx_v_ss;
  PyArrayObject *__pyx_v_mask = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  __pyx_t_5numpy_int64_t __pyx_t_12;
  __pyx_t_5numpy_uint64_t __pyx_t_13;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("selector_fill", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_dest);
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;

  /* "yt/frontends/artio/_artio_caller.pyx":1428
 *         # This is where we use the selector to transplant from one to the
 *         # other.  Note that we *do* apply the selector here.
 *         cdef np.int64_t num_cells = -1             # <<<<<<<<<<<<<<
 *         cdef np.int64_t ind
 *         cdef np.int64_t sfc, sfci = -1
 */
  __pyx_v_num_cells = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1430
 *         cdef np.int64_t num_cells = -1
 *         cdef np.int64_t ind
 *         cdef np.int64_t sfc, sfci = -1             # <<<<<<<<<<<<<<
 *         cdef np.float64_t pos[3]
 *         cdef np.float64_t dpos[3]
 */
  __pyx_v_sfci = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1433
 *         cdef np.float64_t pos[3]
 *         cdef np.float64_t dpos[3]
 *         cdef int dim, status, filled = 0             # <<<<<<<<<<<<<<
 *         cdef int num_oct_levels, level
 *         cdef int max_level = self.artio_handle.max_level
 */
  __pyx_v_filled = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1435
 *         cdef int dim, status, filled = 0
 *         cdef int num_oct_levels, level
 *         cdef int max_level = self.artio_handle.max_level             # <<<<<<<<<<<<<<
 *         cdef int *num_octs_per_level = <int *>malloc(
 *             (max_level + 1)*sizeof(int))
 */
  __pyx_t_1 = __pyx_v_self->artio_handle->max_level;
  __pyx_v_max_level = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1436
 *         cdef int num_oct_levels, level
 *         cdef int max_level = self.artio_handle.max_level
 *         cdef int *num_octs_per_level = <int *>malloc(             # <<<<<<<<<<<<<<
 *             (max_level + 1)*sizeof(int))
 *         cdef char *sdata = <char*> source.data
 */
  __pyx_v_num_octs_per_level = ((int *)malloc(((__pyx_v_max_level + 1) * (sizeof(int)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1438
 *         cdef int *num_octs_per_level = <int *>malloc(
 *             (max_level + 1)*sizeof(int))
 *         cdef char *sdata = <char*> source.data             # <<<<<<<<<<<<<<
 *         cdef char *ddata
 *         cdef int ss = source.dtype.itemsize
 */
  __pyx_v_sdata = ((char *)__pyx_v_source->data);

  /* "yt/frontends/artio/_artio_caller.pyx":1440
 *         cdef char *sdata = <char*> source.data
 *         cdef char *ddata
 *         cdef int ss = source.dtype.itemsize             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ss = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1442
 *         cdef int ss = source.dtype.itemsize
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)             # <<<<<<<<<<<<<<
 *         if dest is None:
 *             # Note that RAMSES can have partial refinement inside an Oct.  This
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_selector)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_selector));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_selector));
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1443
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)
 *         if dest is None:             # <<<<<<<<<<<<<<
 *             # Note that RAMSES can have partial refinement inside an Oct.  This
 *             # means we actually do want the number of Octs, not the number of
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_dest) == Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "yt/frontends/artio/_artio_caller.pyx":1447
 *             # means we actually do want the number of Octs, not the number of
 *             # cells.
 *             num_cells = self._last_mask_sum             # <<<<<<<<<<<<<<
 *             if dims > 1:
 *                 dest = np.zeros((num_cells, dims), dtype=source.dtype,
 */
    __pyx_t_12 = __pyx_v_self->_last_mask_sum;
    __pyx_v_num_cells = __pyx_t_12;

    /* "yt/frontends/artio/_artio_caller.pyx":1448
 *             # cells.
 *             num_cells = self._last_mask_sum
 *             if dims > 1:             # <<<<<<<<<<<<<<
 *                 dest = np.zeros((num_cells, dims), dtype=source.dtype,
 *                     order='C')
 */
    __pyx_t_11 = ((__pyx_v_dims > 1) != 0);
    if (__pyx_t_11) {

      /* "yt/frontends/artio/_artio_caller.pyx":1449
 *             num_cells = self._last_mask_sum
 *             if dims > 1:
 *                 dest = np.zeros((num_cells, dims), dtype=source.dtype,             # <<<<<<<<<<<<<<
 *                     order='C')
 *             else:
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "yt/frontends/artio/_artio_caller.pyx":1448
 *             # cells.
 *             num_cells = self._last_mask_sum
 *             if dims > 1:             # <<<<<<<<<<<<<<
 *                 dest = np.zeros((num_cells, dims), dtype=source.dtype,
 *                     order='C')
 */
      goto __pyx_L4;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1452
 *                     order='C')
 *             else:
 *                 dest = np.zeros(num_cells, dtype=source.dtype, order='C')             # <<<<<<<<<<<<<<
 *         ddata = (<char*>dest.data) + offset*ss*dims
 *         ind = 0
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;
    }
    __pyx_L4:;

    /* "yt/frontends/artio/_artio_caller.pyx":1443
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector)
 *         if dest is None:             # <<<<<<<<<<<<<<
 *             # Note that RAMSES can have partial refinement inside an Oct.  This
 *             # means we actually do want the number of Octs, not the number of
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1453
 *             else:
 *                 dest = np.zeros(num_cells, dtype=source.dtype, order='C')
 *         ddata = (<char*>dest.data) + offset*ss*dims             # <<<<<<<<<<<<<<
 *         ind = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 */
  __pyx_v_ddata = (((char *)__pyx_v_dest->data) + ((__pyx_v_offset * __pyx_v_ss) * __pyx_v_dims));

  /* "yt/frontends/artio/_artio_caller.pyx":1454
 *                 dest = np.zeros(num_cells, dtype=source.dtype, order='C')
 *         ddata = (<char*>dest.data) + offset*ss*dims
 *         ind = 0             # <<<<<<<<<<<<<<
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 */
  __pyx_v_ind = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1455
 *         ddata = (<char*>dest.data) + offset*ss*dims
 *         ind = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 */
  __pyx_t_13 = (__pyx_v_self->sfc_end + 1);
  for (__pyx_t_12 = __pyx_v_self->sfc_start; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
    __pyx_v_sfc = __pyx_t_12;

    /* "yt/frontends/artio/_artio_caller.pyx":1456
 *         ind = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue             # <<<<<<<<<<<<<<
 *             sfci += 1
 *             if mask[sfci] == 0: continue
 */
    __pyx_t_11 = (((__pyx_v_self->sfc_mask[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) == 0) != 0);
    if (__pyx_t_11) {
      goto __pyx_L5_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1457
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1             # <<<<<<<<<<<<<<
 *             if mask[sfci] == 0: continue
 *             memcpy(ddata, sdata + ind, dims * ss)
 */
    __pyx_v_sfci = (__pyx_v_sfci + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":1458
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 *             if mask[sfci] == 0: continue             # <<<<<<<<<<<<<<
 *             memcpy(ddata, sdata + ind, dims * ss)
 *             ddata += dims * ss
 */
    __pyx_t_14 = __pyx_v_sfci;
    __pyx_t_11 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides)) == 0) != 0);
    if (__pyx_t_11) {
      goto __pyx_L5_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1459
 *             sfci += 1
 *             if mask[sfci] == 0: continue
 *             memcpy(ddata, sdata + ind, dims * ss)             # <<<<<<<<<<<<<<
 *             ddata += dims * ss
 *             filled += 1
 */
    memcpy(__pyx_v_ddata, (__pyx_v_sdata + __pyx_v_ind), (__pyx_v_dims * __pyx_v_ss));

    /* "yt/frontends/artio/_artio_caller.pyx":1460
 *             if mask[sfci] == 0: continue
 *             memcpy(ddata, sdata + ind, dims * ss)
 *             ddata += dims * ss             # <<<<<<<<<<<<<<
 *             filled += 1
 *             ind += ss * dims
 */
    __pyx_v_ddata = (__pyx_v_ddata + (__pyx_v_dims * __pyx_v_ss));

    /* "yt/frontends/artio/_artio_caller.pyx":1461
 *             memcpy(ddata, sdata + ind, dims * ss)
 *             ddata += dims * ss
 *             filled += 1             # <<<<<<<<<<<<<<
 *             ind += ss * dims
 *         if num_cells >= 0:
 */
    __pyx_v_filled = (__pyx_v_filled + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":1462
 *             ddata += dims * ss
 *             filled += 1
 *             ind += ss * dims             # <<<<<<<<<<<<<<
 *         if num_cells >= 0:
 *             return dest
 */
    __pyx_v_ind = (__pyx_v_ind + (__pyx_v_ss * __pyx_v_dims));
    __pyx_L5_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1463
 *             filled += 1
 *             ind += ss * dims
 *         if num_cells >= 0:             # <<<<<<<<<<<<<<
 *             return dest
 *         return filled
 */
  __pyx_t_11 = ((__pyx_v_num_cells >= 0) != 0);
  if (__pyx_t_11) {

    /* "yt/frontends/artio/_artio_caller.pyx":1464
 *             ind += ss * dims
 *         if num_cells >= 0:
 *             return dest             # <<<<<<<<<<<<<<
 *         return filled
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_dest));
    __pyx_r = ((PyObject *)__pyx_v_dest);
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":1463
 *             filled += 1
 *             ind += ss * dims
 *         if num_cells >= 0:             # <<<<<<<<<<<<<<
 *             return dest
 *         return filled
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1465
 *         if num_cells >= 0:
 *             return dest
 *         return filled             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_filled); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1421
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def selector_fill(self, SelectorObject selector,             # <<<<<<<<<<<<<<
 *                       np.ndarray source,
 *                       np.ndarray dest = None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.selector_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1470
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def mask(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *              int domain_id = -1):
 *         # We take a domain_id here to avoid subclassing
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_15mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_15mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_num_cells;
  CYTHON_UNUSED int __pyx_v_domain_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mask (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_cells);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_domain_id);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    if (values[1]) {
      __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1);
    }
    if (values[2]) {
      __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_domain_id = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mask", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_14mask(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_14mask(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_num_cells, CYTHON_UNUSED int __pyx_v_domain_id) {
  __pyx_t_5numpy_float64_t __pyx_v_pos[3];
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_sfci;
  PyArrayObject *__pyx_v_mask = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_hash_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __pyx_t_5numpy_uint64_t __pyx_t_12;
  __pyx_t_5numpy_int64_t __pyx_t_13;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mask", 0);
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;

  /* "yt/frontends/artio/_artio_caller.pyx":1475
 *         cdef int i
 *         cdef np.float64_t pos[3]
 *         cdef np.int64_t sfc, sfci = -1             # <<<<<<<<<<<<<<
 *         if self._last_selector_id == hash(selector):
 *             return self._last_mask
 */
  __pyx_v_sfci = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1476
 *         cdef np.float64_t pos[3]
 *         cdef np.int64_t sfc, sfci = -1
 *         if self._last_selector_id == hash(selector):             # <<<<<<<<<<<<<<
 *             return self._last_mask
 *         cdef np.ndarray[np.uint8_t, ndim=1] mask
 */
  __pyx_t_1 = PyObject_Hash(((PyObject *)__pyx_v_selector)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_v_self->_last_selector_id == __pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "yt/frontends/artio/_artio_caller.pyx":1477
 *         cdef np.int64_t sfc, sfci = -1
 *         if self._last_selector_id == hash(selector):
 *             return self._last_mask             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.uint8_t, ndim=1] mask
 *         mask = np.zeros((self.nsfc), dtype="uint8")
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->_last_mask);
    __pyx_r = __pyx_v_self->_last_mask;
    goto __pyx_L0;

    /* "yt/frontends/artio/_artio_caller.pyx":1476
 *         cdef np.float64_t pos[3]
 *         cdef np.int64_t sfc, sfci = -1
 *         if self._last_selector_id == hash(selector):             # <<<<<<<<<<<<<<
 *             return self._last_mask
 *         cdef np.ndarray[np.uint8_t, ndim=1] mask
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1479
 *             return self._last_mask
 *         cdef np.ndarray[np.uint8_t, ndim=1] mask
 *         mask = np.zeros((self.nsfc), dtype="uint8")             # <<<<<<<<<<<<<<
 *         self._last_mask_sum = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nsfc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1480
 *         cdef np.ndarray[np.uint8_t, ndim=1] mask
 *         mask = np.zeros((self.nsfc), dtype="uint8")
 *         self._last_mask_sum = 0             # <<<<<<<<<<<<<<
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 */
  __pyx_v_self->_last_mask_sum = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1481
 *         mask = np.zeros((self.nsfc), dtype="uint8")
 *         self._last_mask_sum = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 */
  __pyx_t_12 = (__pyx_v_self->sfc_end + 1);
  for (__pyx_t_13 = __pyx_v_self->sfc_start; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_sfc = __pyx_t_13;

    /* "yt/frontends/artio/_artio_caller.pyx":1482
 *         self._last_mask_sum = 0
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue             # <<<<<<<<<<<<<<
 *             sfci += 1
 *             self.sfc_to_pos(sfc, pos)
 */
    __pyx_t_2 = (((__pyx_v_self->sfc_mask[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) == 0) != 0);
    if (__pyx_t_2) {
      goto __pyx_L4_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1483
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1             # <<<<<<<<<<<<<<
 *             self.sfc_to_pos(sfc, pos)
 *             if selector.select_cell(pos, self.dds) == 0: continue
 */
    __pyx_v_sfci = (__pyx_v_sfci + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":1484
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 *             self.sfc_to_pos(sfc, pos)             # <<<<<<<<<<<<<<
 *             if selector.select_cell(pos, self.dds) == 0: continue
 *             mask[sfci] = 1
 */
    ((struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self->__pyx_vtab)->sfc_to_pos(__pyx_v_self, __pyx_v_sfc, __pyx_v_pos);

    /* "yt/frontends/artio/_artio_caller.pyx":1485
 *             sfci += 1
 *             self.sfc_to_pos(sfc, pos)
 *             if selector.select_cell(pos, self.dds) == 0: continue             # <<<<<<<<<<<<<<
 *             mask[sfci] = 1
 *             self._last_mask_sum += 1
 */
    __pyx_t_2 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->select_cell(__pyx_v_selector, __pyx_v_pos, __pyx_v_self->dds) == 0) != 0);
    if (__pyx_t_2) {
      goto __pyx_L4_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1486
 *             self.sfc_to_pos(sfc, pos)
 *             if selector.select_cell(pos, self.dds) == 0: continue
 *             mask[sfci] = 1             # <<<<<<<<<<<<<<
 *             self._last_mask_sum += 1
 *         self._last_mask = mask.astype("bool")
 */
    __pyx_t_14 = __pyx_v_sfci;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides) = 1;

    /* "yt/frontends/artio/_artio_caller.pyx":1487
 *             if selector.select_cell(pos, self.dds) == 0: continue
 *             mask[sfci] = 1
 *             self._last_mask_sum += 1             # <<<<<<<<<<<<<<
 *         self._last_mask = mask.astype("bool")
 *         self._last_selector_id = hash(selector)
 */
    __pyx_v_self->_last_mask_sum = (__pyx_v_self->_last_mask_sum + 1);
    __pyx_L4_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1488
 *             mask[sfci] = 1
 *             self._last_mask_sum += 1
 *         self._last_mask = mask.astype("bool")             # <<<<<<<<<<<<<<
 *         self._last_selector_id = hash(selector)
 *         return self._last_mask
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_last_mask);
  __Pyx_DECREF(__pyx_v_self->_last_mask);
  __pyx_v_self->_last_mask = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1489
 *             self._last_mask_sum += 1
 *         self._last_mask = mask.astype("bool")
 *         self._last_selector_id = hash(selector)             # <<<<<<<<<<<<<<
 *         return self._last_mask
 * 
 */
  __pyx_t_1 = PyObject_Hash(((PyObject *)__pyx_v_selector)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_last_selector_id = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1490
 *         self._last_mask = mask.astype("bool")
 *         self._last_selector_id = hash(selector)
 *         return self._last_mask             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_last_mask);
  __pyx_r = __pyx_v_self->_last_mask;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1470
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def mask(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
 *              int domain_id = -1):
 *         # We take a domain_id here to avoid subclassing
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1493
 * 
 * 
 *     def fill_sfc_particles(self, fields):             # <<<<<<<<<<<<<<
 *         rv = read_sfc_particles(self.artio_handle,
 *                                 self.sfc_start, self.sfc_end,
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17fill_sfc_particles(PyObject *__pyx_v_self, PyObject *__pyx_v_fields); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17fill_sfc_particles(PyObject *__pyx_v_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fill_sfc_particles (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_16fill_sfc_particles(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), ((PyObject *)__pyx_v_fields));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_16fill_sfc_particles(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fill_sfc_particles", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":1494
 * 
 *     def fill_sfc_particles(self, fields):
 *         rv = read_sfc_particles(self.artio_handle,             # <<<<<<<<<<<<<<
 *                                 self.sfc_start, self.sfc_end,
 *                                 1, fields, self.range_handler.doct_count,
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->artio_handle);
  __Pyx_INCREF(__pyx_t_1);

  /* "yt/frontends/artio/_artio_caller.pyx":1497
 *                                 self.sfc_start, self.sfc_end,
 *                                 1, fields, self.range_handler.doct_count,
 *                                 self.range_handler.pcount)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_t_2 = __pyx_f_2yt_9frontends_5artio_13_artio_caller_read_sfc_particles(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_1), __pyx_v_self->sfc_start, __pyx_v_self->sfc_end, 1, __pyx_v_fields, __pyx_v_self->range_handler->doct_count, __pyx_v_self->range_handler->pcount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1498
 *                                 1, fields, self.range_handler.doct_count,
 *                                 self.range_handler.pcount)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1493
 * 
 * 
 *     def fill_sfc_particles(self, fields):             # <<<<<<<<<<<<<<
 *         rv = read_sfc_particles(self.artio_handle,
 *                                 self.sfc_start, self.sfc_end,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.fill_sfc_particles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1503
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fill_sfc(self, SelectorObject selector, field_indices):             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.float64_t, ndim=1] dest
 *         cdef int n, status, i, di, num_oct_levels, nf, ngv, max_level
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_19fill_sfc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_19fill_sfc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  PyObject *__pyx_v_field_indices = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fill_sfc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_field_indices,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_sfc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
    __pyx_v_field_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fill_sfc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.fill_sfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_18fill_sfc(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_field_indices);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_18fill_sfc(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyObject *__pyx_v_field_indices) {
  PyArrayObject *__pyx_v_dest = 0;
  int __pyx_v_i;
  int __pyx_v_nf;
  CYTHON_UNUSED int __pyx_v_ngv;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_num_cells;
  __pyx_t_5numpy_int64_t __pyx_v_sfci;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_tr = NULL;
  int *__pyx_v_field_ind;
  __pyx_t_5numpy_float64_t **__pyx_v_field_vals;
  int __pyx_v_filled;
  float **__pyx_v_mesh_data;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dest;
  __Pyx_Buffer __pyx_pybuffer_dest;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  float **__pyx_t_15;
  __pyx_t_5numpy_uint64_t __pyx_t_16;
  int __pyx_t_17;
  __pyx_t_5numpy_int64_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fill_sfc", 0);
  __pyx_pybuffer_dest.pybuffer.buf = NULL;
  __pyx_pybuffer_dest.refcount = 0;
  __pyx_pybuffernd_dest.data = NULL;
  __pyx_pybuffernd_dest.rcbuffer = &__pyx_pybuffer_dest;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;

  /* "yt/frontends/artio/_artio_caller.pyx":1506
 *         cdef np.ndarray[np.float64_t, ndim=1] dest
 *         cdef int n, status, i, di, num_oct_levels, nf, ngv, max_level
 *         cdef np.int64_t sfc, num_cells, sfci = -1             # <<<<<<<<<<<<<<
 *         cdef np.float64_t val
 *         cdef double dpos[3]
 */
  __pyx_v_sfci = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1511
 *         # We duplicate some of the grid_variables stuff here so that we can
 *         # potentially release the GIL
 *         nf = len(field_indices)             # <<<<<<<<<<<<<<
 *         ngv = self.artio_handle.num_grid_variables
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_field_indices); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nf = __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1512
 *         # potentially release the GIL
 *         nf = len(field_indices)
 *         ngv = self.artio_handle.num_grid_variables             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector, -1)
 */
  __pyx_t_2 = __pyx_v_self->artio_handle->num_grid_variables;
  __pyx_v_ngv = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":1514
 *         ngv = self.artio_handle.num_grid_variables
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector, -1)             # <<<<<<<<<<<<<<
 *         num_cells = self._last_mask_sum
 *         tr = []
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_selector));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_1, ((PyObject *)__pyx_v_selector));
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_int_neg_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1515
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector, -1)
 *         num_cells = self._last_mask_sum             # <<<<<<<<<<<<<<
 *         tr = []
 *         for i in range(nf):
 */
  __pyx_t_11 = __pyx_v_self->_last_mask_sum;
  __pyx_v_num_cells = __pyx_t_11;

  /* "yt/frontends/artio/_artio_caller.pyx":1516
 *         mask = self.mask(selector, -1)
 *         num_cells = self._last_mask_sum
 *         tr = []             # <<<<<<<<<<<<<<
 *         for i in range(nf):
 *             tr.append(np.zeros(num_cells, dtype="float64"))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_tr = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1517
 *         num_cells = self._last_mask_sum
 *         tr = []
 *         for i in range(nf):             # <<<<<<<<<<<<<<
 *             tr.append(np.zeros(num_cells, dtype="float64"))
 *         cdef int* field_ind = <int*> malloc(
 */
  __pyx_t_2 = __pyx_v_nf;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "yt/frontends/artio/_artio_caller.pyx":1518
 *         tr = []
 *         for i in range(nf):
 *             tr.append(np.zeros(num_cells, dtype="float64"))             # <<<<<<<<<<<<<<
 *         cdef int* field_ind = <int*> malloc(
 *             nf * sizeof(int))
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_tr, __pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1519
 *         for i in range(nf):
 *             tr.append(np.zeros(num_cells, dtype="float64"))
 *         cdef int* field_ind = <int*> malloc(             # <<<<<<<<<<<<<<
 *             nf * sizeof(int))
 *         cdef np.float64_t **field_vals = <np.float64_t**> malloc(
 */
  __pyx_v_field_ind = ((int *)malloc((__pyx_v_nf * (sizeof(int)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1521
 *         cdef int* field_ind = <int*> malloc(
 *             nf * sizeof(int))
 *         cdef np.float64_t **field_vals = <np.float64_t**> malloc(             # <<<<<<<<<<<<<<
 *             nf * sizeof(np.float64_t*))
 *         for i in range(nf):
 */
  __pyx_v_field_vals = ((__pyx_t_5numpy_float64_t **)malloc((__pyx_v_nf * (sizeof(__pyx_t_5numpy_float64_t *)))));

  /* "yt/frontends/artio/_artio_caller.pyx":1523
 *         cdef np.float64_t **field_vals = <np.float64_t**> malloc(
 *             nf * sizeof(np.float64_t*))
 *         for i in range(nf):             # <<<<<<<<<<<<<<
 *             field_ind[i] = field_indices[i]
 *             # This zeros should be an empty once we handle the root grid
 */
  __pyx_t_2 = __pyx_v_nf;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "yt/frontends/artio/_artio_caller.pyx":1524
 *             nf * sizeof(np.float64_t*))
 *         for i in range(nf):
 *             field_ind[i] = field_indices[i]             # <<<<<<<<<<<<<<
 *             # This zeros should be an empty once we handle the root grid
 *             dest = tr[i]
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_field_indices, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    (__pyx_v_field_ind[__pyx_v_i]) = __pyx_t_14;

    /* "yt/frontends/artio/_artio_caller.pyx":1526
 *             field_ind[i] = field_indices[i]
 *             # This zeros should be an empty once we handle the root grid
 *             dest = tr[i]             # <<<<<<<<<<<<<<
 *             field_vals[i] = <np.float64_t*> dest.data
 *         # First we need to walk the mesh in the file.  Then we fill in the dest
 */
    if (!(likely(((PyList_GET_ITEM(__pyx_v_tr, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_tr, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyList_GET_ITEM(__pyx_v_tr, __pyx_v_i);
    __Pyx_INCREF(__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
      __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_14 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_v_dest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_dest.diminfo[0].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dest.diminfo[0].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_XDECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1527
 *             # This zeros should be an empty once we handle the root grid
 *             dest = tr[i]
 *             field_vals[i] = <np.float64_t*> dest.data             # <<<<<<<<<<<<<<
 *         # First we need to walk the mesh in the file.  Then we fill in the dest
 *         # location based on the file index.
 */
    (__pyx_v_field_vals[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_dest->data);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1530
 *         # First we need to walk the mesh in the file.  Then we fill in the dest
 *         # location based on the file index.
 *         cdef int filled = 0             # <<<<<<<<<<<<<<
 *         cdef float **mesh_data = self.range_handler.root_mesh_data
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 */
  __pyx_v_filled = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1531
 *         # location based on the file index.
 *         cdef int filled = 0
 *         cdef float **mesh_data = self.range_handler.root_mesh_data             # <<<<<<<<<<<<<<
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 */
  __pyx_t_15 = __pyx_v_self->range_handler->root_mesh_data;
  __pyx_v_mesh_data = __pyx_t_15;

  /* "yt/frontends/artio/_artio_caller.pyx":1532
 *         cdef int filled = 0
 *         cdef float **mesh_data = self.range_handler.root_mesh_data
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 */
  __pyx_t_16 = (__pyx_v_self->sfc_end + 1);
  for (__pyx_t_11 = __pyx_v_self->sfc_start; __pyx_t_11 < __pyx_t_16; __pyx_t_11+=1) {
    __pyx_v_sfc = __pyx_t_11;

    /* "yt/frontends/artio/_artio_caller.pyx":1533
 *         cdef float **mesh_data = self.range_handler.root_mesh_data
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue             # <<<<<<<<<<<<<<
 *             sfci += 1
 *             if mask[sfci] == 0: continue
 */
    __pyx_t_17 = (((__pyx_v_self->sfc_mask[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) == 0) != 0);
    if (__pyx_t_17) {
      goto __pyx_L7_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1534
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1             # <<<<<<<<<<<<<<
 *             if mask[sfci] == 0: continue
 *             for i in range(nf):
 */
    __pyx_v_sfci = (__pyx_v_sfci + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":1535
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 *             if mask[sfci] == 0: continue             # <<<<<<<<<<<<<<
 *             for i in range(nf):
 *                 field_vals[i][filled] = mesh_data[field_ind[i]][
 */
    __pyx_t_18 = __pyx_v_sfci;
    __pyx_t_17 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_mask.diminfo[0].strides)) == 0) != 0);
    if (__pyx_t_17) {
      goto __pyx_L7_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1536
 *             sfci += 1
 *             if mask[sfci] == 0: continue
 *             for i in range(nf):             # <<<<<<<<<<<<<<
 *                 field_vals[i][filled] = mesh_data[field_ind[i]][
 *                     sfc - self.sfc_start]
 */
    __pyx_t_2 = __pyx_v_nf;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "yt/frontends/artio/_artio_caller.pyx":1537
 *             if mask[sfci] == 0: continue
 *             for i in range(nf):
 *                 field_vals[i][filled] = mesh_data[field_ind[i]][             # <<<<<<<<<<<<<<
 *                     sfc - self.sfc_start]
 *             filled += 1
 */
      ((__pyx_v_field_vals[__pyx_v_i])[__pyx_v_filled]) = ((__pyx_v_mesh_data[(__pyx_v_field_ind[__pyx_v_i])])[(__pyx_v_sfc - __pyx_v_self->sfc_start)]);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1539
 *                 field_vals[i][filled] = mesh_data[field_ind[i]][
 *                     sfc - self.sfc_start]
 *             filled += 1             # <<<<<<<<<<<<<<
 *         # Now we have all our sources.
 *         free(field_ind)
 */
    __pyx_v_filled = (__pyx_v_filled + 1);
    __pyx_L7_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1541
 *             filled += 1
 *         # Now we have all our sources.
 *         free(field_ind)             # <<<<<<<<<<<<<<
 *         free(field_vals)
 *         return tr
 */
  free(__pyx_v_field_ind);

  /* "yt/frontends/artio/_artio_caller.pyx":1542
 *         # Now we have all our sources.
 *         free(field_ind)
 *         free(field_vals)             # <<<<<<<<<<<<<<
 *         return tr
 * 
 */
  free(__pyx_v_field_vals);

  /* "yt/frontends/artio/_artio_caller.pyx":1543
 *         free(field_ind)
 *         free(field_vals)
 *         return tr             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tr);
  __pyx_r = __pyx_v_tr;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1503
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def fill_sfc(self, SelectorObject selector, field_indices):             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.float64_t, ndim=1] dest
 *         cdef int n, status, i, di, num_oct_levels, nf, ngv, max_level
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.fill_sfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_tr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1548
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def deposit(self, ParticleDepositOperation pdeposit,             # <<<<<<<<<<<<<<
 *                 SelectorObject selector,
 *                 np.ndarray[np.float64_t, ndim=2] positions,
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_21deposit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_21deposit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_pdeposit = 0;
  struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
  PyArrayObject *__pyx_v_positions = 0;
  PyObject *__pyx_v_fields = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deposit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pdeposit,&__pyx_n_s_selector,&__pyx_n_s_positions,&__pyx_n_s_fields,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdeposit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("deposit", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("deposit", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("deposit", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deposit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_pdeposit = ((struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)values[0]);
    __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[1]);
    __pyx_v_positions = ((PyArrayObject *)values[2]);
    __pyx_v_fields = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deposit", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.deposit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeposit), __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation, 1, "pdeposit", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_positions), __pyx_ptype_5numpy_ndarray, 1, "positions", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_20deposit(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), __pyx_v_pdeposit, __pyx_v_selector, __pyx_v_positions, __pyx_v_fields);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_20deposit(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation *__pyx_v_pdeposit, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_positions, PyObject *__pyx_v_fields) {
  int __pyx_v_nf;
  int __pyx_v_i;
  int __pyx_v_j;
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_sfci;
  PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_domain_ind = 0;
  __pyx_t_5numpy_float64_t **__pyx_v_field_pointers;
  __pyx_t_5numpy_float64_t *__pyx_v_field_vals;
  __pyx_t_5numpy_float64_t __pyx_v_pos[3];
  __pyx_t_5numpy_float64_t __pyx_v_left_edge[3];
  int __pyx_v_coords[3];
  PyArrayObject *__pyx_v_tarr = 0;
  int __pyx_v_dims[3];
  __pyx_t_5numpy_int64_t __pyx_v_offset;
  CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_numpart;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_ind;
  __Pyx_Buffer __pyx_pybuffer_domain_ind;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_positions;
  __Pyx_Buffer __pyx_pybuffer_positions;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_tarr;
  __Pyx_Buffer __pyx_pybuffer_tarr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  __pyx_t_5numpy_uint64_t __pyx_t_14;
  __pyx_t_5numpy_int64_t __pyx_t_15;
  __pyx_t_5numpy_int64_t __pyx_t_16;
  __pyx_t_5numpy_uint64_t __pyx_t_17;
  int __pyx_t_18;
  PyArrayObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  npy_intp __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deposit", 0);
  __Pyx_INCREF(__pyx_v_fields);
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_domain_ind.pybuffer.buf = NULL;
  __pyx_pybuffer_domain_ind.refcount = 0;
  __pyx_pybuffernd_domain_ind.data = NULL;
  __pyx_pybuffernd_domain_ind.rcbuffer = &__pyx_pybuffer_domain_ind;
  __pyx_pybuffer_tarr.pybuffer.buf = NULL;
  __pyx_pybuffer_tarr.refcount = 0;
  __pyx_pybuffernd_tarr.data = NULL;
  __pyx_pybuffernd_tarr.rcbuffer = &__pyx_pybuffer_tarr;
  __pyx_pybuffer_positions.pybuffer.buf = NULL;
  __pyx_pybuffer_positions.refcount = 0;
  __pyx_pybuffernd_positions.data = NULL;
  __pyx_pybuffernd_positions.rcbuffer = &__pyx_pybuffer_positions;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_positions.rcbuffer->pybuffer, (PyObject*)__pyx_v_positions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_positions.diminfo[0].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_positions.diminfo[0].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_positions.diminfo[1].strides = __pyx_pybuffernd_positions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_positions.diminfo[1].shape = __pyx_pybuffernd_positions.rcbuffer->pybuffer.shape[1];

  /* "yt/frontends/artio/_artio_caller.pyx":1556
 *         cdef int nf, i, j
 *         cdef np.int64_t sfc, sfci
 *         if fields is None:             # <<<<<<<<<<<<<<
 *             fields = []
 *         nf = len(fields)
 */
  __pyx_t_1 = (__pyx_v_fields == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "yt/frontends/artio/_artio_caller.pyx":1557
 *         cdef np.int64_t sfc, sfci
 *         if fields is None:
 *             fields = []             # <<<<<<<<<<<<<<
 *         nf = len(fields)
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1556
 *         cdef int nf, i, j
 *         cdef np.int64_t sfc, sfci
 *         if fields is None:             # <<<<<<<<<<<<<<
 *             fields = []
 *         nf = len(fields)
 */
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1558
 *         if fields is None:
 *             fields = []
 *         nf = len(fields)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector, -1)
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nf = __pyx_t_4;

  /* "yt/frontends/artio/_artio_caller.pyx":1560
 *         nf = len(fields)
 *         cdef np.ndarray[np.uint8_t, ndim=1, cast=True] mask
 *         mask = self.mask(selector, -1)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[np.int64_t, ndim=1] domain_ind
 *         domain_ind = np.zeros(self.sfc_end - self.sfc_start + 1,
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_selector));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_selector));
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, ((PyObject *)__pyx_v_selector));
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_int_neg_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1562
 *         mask = self.mask(selector, -1)
 *         cdef np.ndarray[np.int64_t, ndim=1] domain_ind
 *         domain_ind = np.zeros(self.sfc_end - self.sfc_start + 1,             # <<<<<<<<<<<<<<
 *                               dtype="int64") - 1
 *         j = 0
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_npy_uint64(((__pyx_v_self->sfc_end - __pyx_v_self->sfc_start) + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1563
 *         cdef np.ndarray[np.int64_t, ndim=1] domain_ind
 *         domain_ind = np.zeros(self.sfc_end - self.sfc_start + 1,
 *                               dtype="int64") - 1             # <<<<<<<<<<<<<<
 *         j = 0
 *         sfci = -1
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "yt/frontends/artio/_artio_caller.pyx":1562
 *         mask = self.mask(selector, -1)
 *         cdef np.ndarray[np.int64_t, ndim=1] domain_ind
 *         domain_ind = np.zeros(self.sfc_end - self.sfc_start + 1,             # <<<<<<<<<<<<<<
 *                               dtype="int64") - 1
 *         j = 0
 */
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1563
 *         cdef np.ndarray[np.int64_t, ndim=1] domain_ind
 *         domain_ind = np.zeros(self.sfc_end - self.sfc_start + 1,
 *                               dtype="int64") - 1             # <<<<<<<<<<<<<<
 *         j = 0
 *         sfci = -1
 */
  __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_ind.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_ind.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_domain_ind.diminfo[0].strides = __pyx_pybuffernd_domain_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_ind.diminfo[0].shape = __pyx_pybuffernd_domain_ind.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_domain_ind = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1564
 *         domain_ind = np.zeros(self.sfc_end - self.sfc_start + 1,
 *                               dtype="int64") - 1
 *         j = 0             # <<<<<<<<<<<<<<
 *         sfci = -1
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 */
  __pyx_v_j = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1565
 *                               dtype="int64") - 1
 *         j = 0
 *         sfci = -1             # <<<<<<<<<<<<<<
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 */
  __pyx_v_sfci = -1;

  /* "yt/frontends/artio/_artio_caller.pyx":1566
 *         j = 0
 *         sfci = -1
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):             # <<<<<<<<<<<<<<
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 */
  __pyx_t_14 = (__pyx_v_self->sfc_end + 1);
  for (__pyx_t_15 = __pyx_v_self->sfc_start; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
    __pyx_v_sfc = __pyx_t_15;

    /* "yt/frontends/artio/_artio_caller.pyx":1567
 *         sfci = -1
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue             # <<<<<<<<<<<<<<
 *             sfci += 1
 *             if mask[sfci] == 0:
 */
    __pyx_t_2 = (((__pyx_v_self->sfc_mask[(__pyx_v_sfc - __pyx_v_self->sfc_start)]) == 0) != 0);
    if (__pyx_t_2) {
      goto __pyx_L4_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1568
 *         for sfc in range(self.sfc_start, self.sfc_end + 1):
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1             # <<<<<<<<<<<<<<
 *             if mask[sfci] == 0:
 *                 continue
 */
    __pyx_v_sfci = (__pyx_v_sfci + 1);

    /* "yt/frontends/artio/_artio_caller.pyx":1569
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 *             if mask[sfci] == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             domain_ind[sfc - self.sfc_start] = j
 */
    __pyx_t_16 = __pyx_v_sfci;
    __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[0].strides)) == 0) != 0);
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":1570
 *             sfci += 1
 *             if mask[sfci] == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             domain_ind[sfc - self.sfc_start] = j
 *             j += 1
 */
      goto __pyx_L4_continue;

      /* "yt/frontends/artio/_artio_caller.pyx":1569
 *             if self.sfc_mask[sfc - self.sfc_start] == 0: continue
 *             sfci += 1
 *             if mask[sfci] == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             domain_ind[sfc - self.sfc_start] = j
 */
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1571
 *             if mask[sfci] == 0:
 *                 continue
 *             domain_ind[sfc - self.sfc_start] = j             # <<<<<<<<<<<<<<
 *             j += 1
 *         cdef np.float64_t **field_pointers
 */
    __pyx_t_17 = (__pyx_v_sfc - __pyx_v_self->sfc_start);
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_domain_ind.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_domain_ind.diminfo[0].strides) = __pyx_v_j;

    /* "yt/frontends/artio/_artio_caller.pyx":1572
 *                 continue
 *             domain_ind[sfc - self.sfc_start] = j
 *             j += 1             # <<<<<<<<<<<<<<
 *         cdef np.float64_t **field_pointers
 *         cdef np.float64_t *field_vals
 */
    __pyx_v_j = (__pyx_v_j + 1);
    __pyx_L4_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1579
 *         cdef int coords[3]
 *         cdef np.ndarray[np.float64_t, ndim=1] tarr
 *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)             # <<<<<<<<<<<<<<
 *         field_vals = <np.float64_t*>alloca(sizeof(np.float64_t) * nf)
 *         for i in range(nf):
 */
  __pyx_v_field_pointers = ((__pyx_t_5numpy_float64_t **)alloca(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_nf)));

  /* "yt/frontends/artio/_artio_caller.pyx":1580
 *         cdef np.ndarray[np.float64_t, ndim=1] tarr
 *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
 *         field_vals = <np.float64_t*>alloca(sizeof(np.float64_t) * nf)             # <<<<<<<<<<<<<<
 *         for i in range(nf):
 *             tarr = fields[i]
 */
  __pyx_v_field_vals = ((__pyx_t_5numpy_float64_t *)alloca(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_nf)));

  /* "yt/frontends/artio/_artio_caller.pyx":1581
 *         field_pointers = <np.float64_t**> alloca(sizeof(np.float64_t *) * nf)
 *         field_vals = <np.float64_t*>alloca(sizeof(np.float64_t) * nf)
 *         for i in range(nf):             # <<<<<<<<<<<<<<
 *             tarr = fields[i]
 *             field_pointers[i] = <np.float64_t *> tarr.data
 */
  __pyx_t_9 = __pyx_v_nf;
  for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_9; __pyx_t_18+=1) {
    __pyx_v_i = __pyx_t_18;

    /* "yt/frontends/artio/_artio_caller.pyx":1582
 *         field_vals = <np.float64_t*>alloca(sizeof(np.float64_t) * nf)
 *         for i in range(nf):
 *             tarr = fields[i]             # <<<<<<<<<<<<<<
 *             field_pointers[i] = <np.float64_t *> tarr.data
 *         cdef int dims[3]
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_19 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
      __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_20 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_tarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
      }
      __pyx_pybuffernd_tarr.diminfo[0].strides = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tarr.diminfo[0].shape = __pyx_pybuffernd_tarr.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_19 = 0;
    __Pyx_XDECREF_SET(__pyx_v_tarr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "yt/frontends/artio/_artio_caller.pyx":1583
 *         for i in range(nf):
 *             tarr = fields[i]
 *             field_pointers[i] = <np.float64_t *> tarr.data             # <<<<<<<<<<<<<<
 *         cdef int dims[3]
 *         dims[0] = dims[1] = dims[2] = 1
 */
    (__pyx_v_field_pointers[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tarr->data);
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1585
 *             field_pointers[i] = <np.float64_t *> tarr.data
 *         cdef int dims[3]
 *         dims[0] = dims[1] = dims[2] = 1             # <<<<<<<<<<<<<<
 *         cdef np.int64_t offset, moff
 *         cdef np.int64_t numpart = positions.shape[0]
 */
  (__pyx_v_dims[0]) = 1;
  (__pyx_v_dims[1]) = 1;
  (__pyx_v_dims[2]) = 1;

  /* "yt/frontends/artio/_artio_caller.pyx":1587
 *         dims[0] = dims[1] = dims[2] = 1
 *         cdef np.int64_t offset, moff
 *         cdef np.int64_t numpart = positions.shape[0]             # <<<<<<<<<<<<<<
 *         for i in range(positions.shape[0]):
 *             for j in range(nf):
 */
  __pyx_v_numpart = (__pyx_v_positions->dimensions[0]);

  /* "yt/frontends/artio/_artio_caller.pyx":1588
 *         cdef np.int64_t offset, moff
 *         cdef np.int64_t numpart = positions.shape[0]
 *         for i in range(positions.shape[0]):             # <<<<<<<<<<<<<<
 *             for j in range(nf):
 *                 field_vals[j] = field_pointers[j][i]
 */
  __pyx_t_21 = (__pyx_v_positions->dimensions[0]);
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_21; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "yt/frontends/artio/_artio_caller.pyx":1589
 *         cdef np.int64_t numpart = positions.shape[0]
 *         for i in range(positions.shape[0]):
 *             for j in range(nf):             # <<<<<<<<<<<<<<
 *                 field_vals[j] = field_pointers[j][i]
 *             for j in range(3):
 */
    __pyx_t_18 = __pyx_v_nf;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_18; __pyx_t_20+=1) {
      __pyx_v_j = __pyx_t_20;

      /* "yt/frontends/artio/_artio_caller.pyx":1590
 *         for i in range(positions.shape[0]):
 *             for j in range(nf):
 *                 field_vals[j] = field_pointers[j][i]             # <<<<<<<<<<<<<<
 *             for j in range(3):
 *                 pos[j] = positions[i, j]
 */
      (__pyx_v_field_vals[__pyx_v_j]) = ((__pyx_v_field_pointers[__pyx_v_j])[__pyx_v_i]);
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1591
 *             for j in range(nf):
 *                 field_vals[j] = field_pointers[j][i]
 *             for j in range(3):             # <<<<<<<<<<<<<<
 *                 pos[j] = positions[i, j]
 *                 coords[j] = <int>((pos[j] - self.DLE[j])/self.dds[j])
 */
    for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) {
      __pyx_v_j = __pyx_t_18;

      /* "yt/frontends/artio/_artio_caller.pyx":1592
 *                 field_vals[j] = field_pointers[j][i]
 *             for j in range(3):
 *                 pos[j] = positions[i, j]             # <<<<<<<<<<<<<<
 *                 coords[j] = <int>((pos[j] - self.DLE[j])/self.dds[j])
 *             sfc = artio_sfc_index(self.artio_handle.handle, coords)
 */
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      (__pyx_v_pos[__pyx_v_j]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_positions.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_positions.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_positions.diminfo[1].strides));

      /* "yt/frontends/artio/_artio_caller.pyx":1593
 *             for j in range(3):
 *                 pos[j] = positions[i, j]
 *                 coords[j] = <int>((pos[j] - self.DLE[j])/self.dds[j])             # <<<<<<<<<<<<<<
 *             sfc = artio_sfc_index(self.artio_handle.handle, coords)
 *             if sfc < self.sfc_start or sfc > self.sfc_end: continue
 */
      (__pyx_v_coords[__pyx_v_j]) = ((int)(((__pyx_v_pos[__pyx_v_j]) - (__pyx_v_self->DLE[__pyx_v_j])) / (__pyx_v_self->dds[__pyx_v_j])));
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1594
 *                 pos[j] = positions[i, j]
 *                 coords[j] = <int>((pos[j] - self.DLE[j])/self.dds[j])
 *             sfc = artio_sfc_index(self.artio_handle.handle, coords)             # <<<<<<<<<<<<<<
 *             if sfc < self.sfc_start or sfc > self.sfc_end: continue
 *             offset = domain_ind[sfc - self.sfc_start]
 */
    __pyx_v_sfc = artio_sfc_index(__pyx_v_self->artio_handle->handle, __pyx_v_coords);

    /* "yt/frontends/artio/_artio_caller.pyx":1595
 *                 coords[j] = <int>((pos[j] - self.DLE[j])/self.dds[j])
 *             sfc = artio_sfc_index(self.artio_handle.handle, coords)
 *             if sfc < self.sfc_start or sfc > self.sfc_end: continue             # <<<<<<<<<<<<<<
 *             offset = domain_ind[sfc - self.sfc_start]
 *             if offset < 0: continue
 */
    __pyx_t_1 = ((__pyx_v_sfc < __pyx_v_self->sfc_start) != 0);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_sfc > __pyx_v_self->sfc_end) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L17_bool_binop_done:;
    if (__pyx_t_2) {
      goto __pyx_L10_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1596
 *             sfc = artio_sfc_index(self.artio_handle.handle, coords)
 *             if sfc < self.sfc_start or sfc > self.sfc_end: continue
 *             offset = domain_ind[sfc - self.sfc_start]             # <<<<<<<<<<<<<<
 *             if offset < 0: continue
 *             # Check that we found the oct ...
 */
    __pyx_t_14 = (__pyx_v_sfc - __pyx_v_self->sfc_start);
    __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_domain_ind.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_domain_ind.diminfo[0].strides));

    /* "yt/frontends/artio/_artio_caller.pyx":1597
 *             if sfc < self.sfc_start or sfc > self.sfc_end: continue
 *             offset = domain_ind[sfc - self.sfc_start]
 *             if offset < 0: continue             # <<<<<<<<<<<<<<
 *             # Check that we found the oct ...
 *             for j in range(3):
 */
    __pyx_t_2 = ((__pyx_v_offset < 0) != 0);
    if (__pyx_t_2) {
      goto __pyx_L10_continue;
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1599
 *             if offset < 0: continue
 *             # Check that we found the oct ...
 *             for j in range(3):             # <<<<<<<<<<<<<<
 *                 left_edge[j] = coords[j] * self.dds[j] + self.DLE[j]
 *             pdeposit.process(dims, left_edge, self.dds,
 */
    for (__pyx_t_18 = 0; __pyx_t_18 < 3; __pyx_t_18+=1) {
      __pyx_v_j = __pyx_t_18;

      /* "yt/frontends/artio/_artio_caller.pyx":1600
 *             # Check that we found the oct ...
 *             for j in range(3):
 *                 left_edge[j] = coords[j] * self.dds[j] + self.DLE[j]             # <<<<<<<<<<<<<<
 *             pdeposit.process(dims, left_edge, self.dds,
 *                          offset, pos, field_vals, sfc)
 */
      (__pyx_v_left_edge[__pyx_v_j]) = (((__pyx_v_coords[__pyx_v_j]) * (__pyx_v_self->dds[__pyx_v_j])) + (__pyx_v_self->DLE[__pyx_v_j]));
    }

    /* "yt/frontends/artio/_artio_caller.pyx":1601
 *             for j in range(3):
 *                 left_edge[j] = coords[j] * self.dds[j] + self.DLE[j]
 *             pdeposit.process(dims, left_edge, self.dds,             # <<<<<<<<<<<<<<
 *                          offset, pos, field_vals, sfc)
 *             if pdeposit.update_values == 1:
 */
    ((struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation *)__pyx_v_pdeposit->__pyx_vtab)->process(__pyx_v_pdeposit, __pyx_v_dims, __pyx_v_left_edge, __pyx_v_self->dds, __pyx_v_offset, __pyx_v_pos, __pyx_v_field_vals, __pyx_v_sfc);

    /* "yt/frontends/artio/_artio_caller.pyx":1603
 *             pdeposit.process(dims, left_edge, self.dds,
 *                          offset, pos, field_vals, sfc)
 *             if pdeposit.update_values == 1:             # <<<<<<<<<<<<<<
 *                 for j in range(nf):
 *                     field_pointers[j][i] = field_vals[j]
 */
    __pyx_t_2 = ((__pyx_v_pdeposit->update_values == 1) != 0);
    if (__pyx_t_2) {

      /* "yt/frontends/artio/_artio_caller.pyx":1604
 *                          offset, pos, field_vals, sfc)
 *             if pdeposit.update_values == 1:
 *                 for j in range(nf):             # <<<<<<<<<<<<<<
 *                     field_pointers[j][i] = field_vals[j]
 * 
 */
      __pyx_t_18 = __pyx_v_nf;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_18; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "yt/frontends/artio/_artio_caller.pyx":1605
 *             if pdeposit.update_values == 1:
 *                 for j in range(nf):
 *                     field_pointers[j][i] = field_vals[j]             # <<<<<<<<<<<<<<
 * 
 * cdef class SFCRangeSelector(SelectorObject):
 */
        ((__pyx_v_field_pointers[__pyx_v_j])[__pyx_v_i]) = (__pyx_v_field_vals[__pyx_v_j]);
      }

      /* "yt/frontends/artio/_artio_caller.pyx":1603
 *             pdeposit.process(dims, left_edge, self.dds,
 *                          offset, pos, field_vals, sfc)
 *             if pdeposit.update_values == 1:             # <<<<<<<<<<<<<<
 *                 for j in range(nf):
 *                     field_pointers[j][i] = field_vals[j]
 */
    }
    __pyx_L10_continue:;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1548
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def deposit(self, ParticleDepositOperation pdeposit,             # <<<<<<<<<<<<<<
 *                 SelectorObject selector,
 *                 np.ndarray[np.float64_t, ndim=2] positions,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_ind.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_positions.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.deposit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_ind.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_positions.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tarr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_domain_ind);
  __Pyx_XDECREF((PyObject *)__pyx_v_tarr);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1258
 * 
 * cdef class ARTIORootMeshContainer:
 *     cdef public artio_fileset artio_handle             # <<<<<<<<<<<<<<
 *     cdef np.float64_t DLE[3]
 *     cdef np.float64_t DRE[3]
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_r = ((PyObject *)__pyx_v_self->artio_handle);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer.artio_handle.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->artio_handle);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->artio_handle));
  __pyx_v_self->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1266
 *     cdef np.uint64_t sfc_start
 *     cdef np.uint64_t sfc_end
 *     cdef public object _last_mask             # <<<<<<<<<<<<<<
 *     cdef public np.int64_t _last_selector_id
 *     cdef np.int64_t _last_mask_sum
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_last_mask);
  __pyx_r = __pyx_v_self->_last_mask;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_last_mask);
  __Pyx_DECREF(__pyx_v_self->_last_mask);
  __pyx_v_self->_last_mask = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_4__del__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_4__del__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_last_mask);
  __Pyx_DECREF(__pyx_v_self->_last_mask);
  __pyx_v_self->_last_mask = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1267
 *     cdef np.uint64_t sfc_end
 *     cdef public object _last_mask
 *     cdef public np.int64_t _last_selector_id             # <<<<<<<<<<<<<<
 *     cdef np.int64_t _last_mask_sum
 *     cdef ARTIOSFCRangeHandler range_handler
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id___get__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id___get__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->_last_selector_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer._last_selector_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_2__set__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_2__set__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_last_selector_id = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.ARTIORootMeshContainer._last_selector_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1614
 *     cdef np.int64_t sfc_start, sfc_end
 * 
 *     def __init__(self, dobj):             # <<<<<<<<<<<<<<
 *         self.base_selector = dobj.base_selector
 *         self.mesh_container = dobj.oct_handler
 */

/* Python wrapper */
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dobj = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobj,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dobj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_dobj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.SFCRangeSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector___init__(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)__pyx_v_self), __pyx_v_dobj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector___init__(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, PyObject *__pyx_v_dobj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __pyx_t_5numpy_uint64_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":1615
 * 
 *     def __init__(self, dobj):
 *         self.base_selector = dobj.base_selector             # <<<<<<<<<<<<<<
 *         self.mesh_container = dobj.oct_handler
 *         self.range_handler = self.mesh_container.range_handler
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_base_selector); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->base_selector);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->base_selector));
  __pyx_v_self->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1616
 *     def __init__(self, dobj):
 *         self.base_selector = dobj.base_selector
 *         self.mesh_container = dobj.oct_handler             # <<<<<<<<<<<<<<
 *         self.range_handler = self.mesh_container.range_handler
 *         self.sfc_start = self.mesh_container.sfc_start
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dobj, __pyx_n_s_oct_handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->mesh_container);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->mesh_container));
  __pyx_v_self->mesh_container = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1617
 *         self.base_selector = dobj.base_selector
 *         self.mesh_container = dobj.oct_handler
 *         self.range_handler = self.mesh_container.range_handler             # <<<<<<<<<<<<<<
 *         self.sfc_start = self.mesh_container.sfc_start
 *         self.sfc_end = self.mesh_container.sfc_end
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->mesh_container->range_handler);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->range_handler);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->range_handler));
  __pyx_v_self->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1618
 *         self.mesh_container = dobj.oct_handler
 *         self.range_handler = self.mesh_container.range_handler
 *         self.sfc_start = self.mesh_container.sfc_start             # <<<<<<<<<<<<<<
 *         self.sfc_end = self.mesh_container.sfc_end
 * 
 */
  __pyx_t_2 = __pyx_v_self->mesh_container->sfc_start;
  __pyx_v_self->sfc_start = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":1619
 *         self.range_handler = self.mesh_container.range_handler
 *         self.sfc_start = self.mesh_container.sfc_start
 *         self.sfc_end = self.mesh_container.sfc_end             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_t_2 = __pyx_v_self->mesh_container->sfc_end;
  __pyx_v_self->sfc_end = __pyx_t_2;

  /* "yt/frontends/artio/_artio_caller.pyx":1614
 *     cdef np.int64_t sfc_start, sfc_end
 * 
 *     def __init__(self, dobj):             # <<<<<<<<<<<<<<
 *         self.base_selector = dobj.base_selector
 *         self.mesh_container = dobj.oct_handler
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.SFCRangeSelector.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1624
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def select_grids(self,             # <<<<<<<<<<<<<<
 *                      np.ndarray[np.float64_t, ndim=2] left_edges,
 *                      np.ndarray[np.float64_t, ndim=2] right_edges,
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_3select_grids(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_3select_grids(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyArrayObject *__pyx_v_left_edges = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_levels = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("select_grids (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left_edges,&__pyx_n_s_right_edges,&__pyx_n_s_levels,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_edges)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_grids") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_left_edges = ((PyArrayObject *)values[0]);
    __pyx_v_right_edges = ((PyArrayObject *)values[1]);
    __pyx_v_levels = ((PyArrayObject *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("select_grids", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.SFCRangeSelector.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edges), __pyx_ptype_5numpy_ndarray, 1, "right_edges", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_2select_grids(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)__pyx_v_self), __pyx_v_left_edges, __pyx_v_right_edges, __pyx_v_levels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_2select_grids(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_left_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_right_edges, CYTHON_UNUSED PyArrayObject *__pyx_v_levels) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_edges;
  __Pyx_Buffer __pyx_pybuffer_left_edges;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_levels;
  __Pyx_Buffer __pyx_pybuffer_levels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_edges;
  __Pyx_Buffer __pyx_pybuffer_right_edges;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("select_grids", 0);
  __pyx_pybuffer_left_edges.pybuffer.buf = NULL;
  __pyx_pybuffer_left_edges.refcount = 0;
  __pyx_pybuffernd_left_edges.data = NULL;
  __pyx_pybuffernd_left_edges.rcbuffer = &__pyx_pybuffer_left_edges;
  __pyx_pybuffer_right_edges.pybuffer.buf = NULL;
  __pyx_pybuffer_right_edges.refcount = 0;
  __pyx_pybuffernd_right_edges.data = NULL;
  __pyx_pybuffernd_right_edges.rcbuffer = &__pyx_pybuffer_right_edges;
  __pyx_pybuffer_levels.pybuffer.buf = NULL;
  __pyx_pybuffer_levels.refcount = 0;
  __pyx_pybuffernd_levels.data = NULL;
  __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edges.diminfo[1].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edges.diminfo[1].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right_edges.diminfo[0].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edges.diminfo[0].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edges.diminfo[1].strides = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edges.diminfo[1].shape = __pyx_pybuffernd_right_edges.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_levels.diminfo[1].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_levels.diminfo[1].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[1];

  /* "yt/frontends/artio/_artio_caller.pyx":1628
 *                      np.ndarray[np.float64_t, ndim=2] right_edges,
 *                      np.ndarray[np.int32_t, ndim=2] levels):
 *         raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "yt/frontends/artio/_artio_caller.pyx":1624
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     def select_grids(self,             # <<<<<<<<<<<<<<
 *                      np.ndarray[np.float64_t, ndim=2] left_edges,
 *                      np.ndarray[np.float64_t, ndim=2] right_edges,
 */

  /* function exit code */
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.SFCRangeSelector.select_grids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edges.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1633
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil:             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */

static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_sphere(CYTHON_UNUSED struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_radius) {
  int __pyx_r;

  /* "yt/frontends/artio/_artio_caller.pyx":1634
 *     @cython.cdivision(True)
 *     cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil:
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1633
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_sphere(self, np.float64_t pos[3], np.float64_t radius) nogil:             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1639
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil:             # <<<<<<<<<<<<<<
 *         return self.select_point(pos)
 * 
 */

static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_cell(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_dds) {
  int __pyx_r;

  /* "yt/frontends/artio/_artio_caller.pyx":1640
 *     @cython.cdivision(True)
 *     cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil:
 *         return self.select_point(pos)             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_r = ((struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.select_point(((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self), __pyx_v_pos);
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1639
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_cell(self, np.float64_t pos[3], np.float64_t dds[3]) nogil:             # <<<<<<<<<<<<<<
 *         return self.select_point(pos)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1645
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_point(self, np.float64_t pos[3]) nogil:             # <<<<<<<<<<<<<<
 *         cdef np.int64_t sfc = self.mesh_container.pos_to_sfc(pos)
 *         if sfc > self.sfc_end: return 0
 */

static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_point(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos) {
  __pyx_t_5numpy_int64_t __pyx_v_sfc;
  __pyx_t_5numpy_int64_t __pyx_v_oc;
  int __pyx_r;
  int __pyx_t_1;

  /* "yt/frontends/artio/_artio_caller.pyx":1646
 *     @cython.cdivision(True)
 *     cdef int select_point(self, np.float64_t pos[3]) nogil:
 *         cdef np.int64_t sfc = self.mesh_container.pos_to_sfc(pos)             # <<<<<<<<<<<<<<
 *         if sfc > self.sfc_end: return 0
 *         cdef np.int64_t oc = self.range_handler.doct_count[
 */
  __pyx_v_sfc = ((struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)__pyx_v_self->mesh_container->__pyx_vtab)->pos_to_sfc(__pyx_v_self->mesh_container, __pyx_v_pos);

  /* "yt/frontends/artio/_artio_caller.pyx":1647
 *     cdef int select_point(self, np.float64_t pos[3]) nogil:
 *         cdef np.int64_t sfc = self.mesh_container.pos_to_sfc(pos)
 *         if sfc > self.sfc_end: return 0             # <<<<<<<<<<<<<<
 *         cdef np.int64_t oc = self.range_handler.doct_count[
 *             sfc - self.sfc_start]
 */
  __pyx_t_1 = ((__pyx_v_sfc > __pyx_v_self->sfc_end) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1648
 *         cdef np.int64_t sfc = self.mesh_container.pos_to_sfc(pos)
 *         if sfc > self.sfc_end: return 0
 *         cdef np.int64_t oc = self.range_handler.doct_count[             # <<<<<<<<<<<<<<
 *             sfc - self.sfc_start]
 *         if oc > 0: return 0
 */
  __pyx_v_oc = (__pyx_v_self->range_handler->doct_count[(__pyx_v_sfc - __pyx_v_self->sfc_start)]);

  /* "yt/frontends/artio/_artio_caller.pyx":1650
 *         cdef np.int64_t oc = self.range_handler.doct_count[
 *             sfc - self.sfc_start]
 *         if oc > 0: return 0             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
  __pyx_t_1 = ((__pyx_v_oc > 0) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1651
 *             sfc - self.sfc_start]
 *         if oc > 0: return 0
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1645
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_point(self, np.float64_t pos[3]) nogil:             # <<<<<<<<<<<<<<
 *         cdef np.int64_t sfc = self.mesh_container.pos_to_sfc(pos)
 *         if sfc > self.sfc_end: return 0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1656
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_bbox(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
 *                                np.float64_t right_edge[3]) nogil:
 *         return self.base_selector.select_bbox(left_edge, right_edge)
 */

static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_bbox(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge) {
  int __pyx_r;

  /* "yt/frontends/artio/_artio_caller.pyx":1658
 *     cdef int select_bbox(self, np.float64_t left_edge[3],
 *                                np.float64_t right_edge[3]) nogil:
 *         return self.base_selector.select_bbox(left_edge, right_edge)             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_r = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->base_selector->__pyx_vtab)->select_bbox(__pyx_v_self->base_selector, __pyx_v_left_edge, __pyx_v_right_edge);
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1656
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_bbox(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
 *                                np.float64_t right_edge[3]) nogil:
 *         return self.base_selector.select_bbox(left_edge, right_edge)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1663
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
 *                          np.float64_t right_edge[3], np.int32_t level,
 *                          Oct *o = NULL) nogil:
 */

static int __pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_left_edge, __pyx_t_5numpy_float64_t *__pyx_v_right_edge, __pyx_t_5numpy_int32_t __pyx_v_level, struct __pyx_opt_args_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid *__pyx_optional_args) {

  /* "yt/frontends/artio/_artio_caller.pyx":1665
 *     cdef int select_grid(self, np.float64_t left_edge[3],
 *                          np.float64_t right_edge[3], np.int32_t level,
 *                          Oct *o = NULL) nogil:             # <<<<<<<<<<<<<<
 *         # Because visitors now use select_grid, we should be explicitly
 *         # checking this.
 */
  struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)NULL);
  int __pyx_r;
  int __pyx_t_1;
  struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid __pyx_t_2;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_o = __pyx_optional_args->o;
    }
  }

  /* "yt/frontends/artio/_artio_caller.pyx":1668
 *         # Because visitors now use select_grid, we should be explicitly
 *         # checking this.
 *         return self.base_selector.select_grid(left_edge, right_edge, level, o)             # <<<<<<<<<<<<<<
 * 
 *     def _hash_vals(self):
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.o = __pyx_v_o;
  __pyx_t_1 = ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_self->base_selector->__pyx_vtab)->select_grid(__pyx_v_self->base_selector, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_level, &__pyx_t_2); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1663
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
 *                          np.float64_t right_edge[3], np.int32_t level,
 *                          Oct *o = NULL) nogil:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/frontends/artio/_artio_caller.pyx":1670
 *         return self.base_selector.select_grid(left_edge, right_edge, level, o)
 * 
 *     def _hash_vals(self):             # <<<<<<<<<<<<<<
 *         return (hash(self.base_selector), self.sfc_start, self.sfc_end)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_5_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_5_hash_vals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_hash_vals (wrapper)", 0);
  __pyx_r = __pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_4_hash_vals(((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_4_hash_vals(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_hash_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_hash_vals", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":1671
 * 
 *     def _hash_vals(self):
 *         return (hash(self.base_selector), self.sfc_start, self.sfc_end)             # <<<<<<<<<<<<<<
 * 
 * sfc_subset_selector = AlwaysSelector
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->base_selector);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->sfc_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->sfc_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "yt/frontends/artio/_artio_caller.pyx":1670
 *         return self.base_selector.select_grid(left_edge, right_edge, level, o)
 * 
 *     def _hash_vals(self):             # <<<<<<<<<<<<<<
 *         return (hash(self.base_selector), self.sfc_start, self.sfc_end)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("yt.frontends.artio._artio_caller.SFCRangeSelector._hash_vals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oct_visitors.pxd":63
 * cdef oct_visitor_function load_octree
 * 
 * cdef inline int cind(int i, int j, int k):             # <<<<<<<<<<<<<<
 *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
 *     return (((i*2)+j)*2+k)
 */

static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cind", 0);

  /* "oct_visitors.pxd":65
 * cdef inline int cind(int i, int j, int k):
 *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
 *     return (((i*2)+j)*2+k)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int oind(OctVisitorData *data):
 */
  __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k);
  goto __pyx_L0;

  /* "oct_visitors.pxd":63
 * cdef oct_visitor_function load_octree
 * 
 * cdef inline int cind(int i, int j, int k):             # <<<<<<<<<<<<<<
 *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
 *     return (((i*2)+j)*2+k)
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oct_visitors.pxd":67
 *     return (((i*2)+j)*2+k)
 * 
 * cdef inline int oind(OctVisitorData *data):             # <<<<<<<<<<<<<<
 *     cdef int d = (1 << data.oref)
 *     return (((data.ind[0]*d)+data.ind[1])*d+data.ind[2])
 */

static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_oind(struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *__pyx_v_data) {
  int __pyx_v_d;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("oind", 0);

  /* "oct_visitors.pxd":68
 * 
 * cdef inline int oind(OctVisitorData *data):
 *     cdef int d = (1 << data.oref)             # <<<<<<<<<<<<<<
 *     return (((data.ind[0]*d)+data.ind[1])*d+data.ind[2])
 * 
 */
  __pyx_v_d = (1 << __pyx_v_data->oref);

  /* "oct_visitors.pxd":69
 * cdef inline int oind(OctVisitorData *data):
 *     cdef int d = (1 << data.oref)
 *     return (((data.ind[0]*d)+data.ind[1])*d+data.ind[2])             # <<<<<<<<<<<<<<
 * 
 * cdef inline int rind(OctVisitorData *data):
 */
  __pyx_r = (((((__pyx_v_data->ind[0]) * __pyx_v_d) + (__pyx_v_data->ind[1])) * __pyx_v_d) + (__pyx_v_data->ind[2]));
  goto __pyx_L0;

  /* "oct_visitors.pxd":67
 *     return (((i*2)+j)*2+k)
 * 
 * cdef inline int oind(OctVisitorData *data):             # <<<<<<<<<<<<<<
 *     cdef int d = (1 << data.oref)
 *     return (((data.ind[0]*d)+data.ind[1])*d+data.ind[2])
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oct_visitors.pxd":71
 *     return (((data.ind[0]*d)+data.ind[1])*d+data.ind[2])
 * 
 * cdef inline int rind(OctVisitorData *data):             # <<<<<<<<<<<<<<
 *     cdef int d = (1 << data.oref)
 *     return (((data.ind[2]*d)+data.ind[1])*d+data.ind[0])
 */

static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_rind(struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *__pyx_v_data) {
  int __pyx_v_d;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rind", 0);

  /* "oct_visitors.pxd":72
 * 
 * cdef inline int rind(OctVisitorData *data):
 *     cdef int d = (1 << data.oref)             # <<<<<<<<<<<<<<
 *     return (((data.ind[2]*d)+data.ind[1])*d+data.ind[0])
 */
  __pyx_v_d = (1 << __pyx_v_data->oref);

  /* "oct_visitors.pxd":73
 * cdef inline int rind(OctVisitorData *data):
 *     cdef int d = (1 << data.oref)
 *     return (((data.ind[2]*d)+data.ind[1])*d+data.ind[0])             # <<<<<<<<<<<<<<
 */
  __pyx_r = (((((__pyx_v_data->ind[2]) * __pyx_v_d) + (__pyx_v_data->ind[1])) * __pyx_v_d) + (__pyx_v_data->ind[0]));
  goto __pyx_L0;

  /* "oct_visitors.pxd":71
 *     return (((data.ind[0]*d)+data.ind[1])*d+data.ind[2])
 * 
 * cdef inline int rind(OctVisitorData *data):             # <<<<<<<<<<<<<<
 *     cdef int d = (1 << data.oref)
 *     return (((data.ind[2]*d)+data.ind[1])*d+data.ind[0])
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/geometry/selection_routines.pxd":27
 *     np.float64_t
 * 
 * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
 *     if hasattr(arr, "units"):
 *         if "code_length" == str(arr.units):
 */

static CYTHON_INLINE PyObject *__pyx_f_2yt_8geometry_18selection_routines__ensure_code(PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_code", 0);

  /* "yt/geometry/selection_routines.pxd":28
 * 
 * cdef inline _ensure_code(arr):
 *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
 *         if "code_length" == str(arr.units):
 *             return arr
 */
  __pyx_t_1 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "yt/geometry/selection_routines.pxd":29
 * cdef inline _ensure_code(arr):
 *     if hasattr(arr, "units"):
 *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
 *             return arr
 *         arr.convert_to_units("code_length")
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "yt/geometry/selection_routines.pxd":30
 *     if hasattr(arr, "units"):
 *         if "code_length" == str(arr.units):
 *             return arr             # <<<<<<<<<<<<<<
 *         arr.convert_to_units("code_length")
 *     return arr
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "yt/geometry/selection_routines.pxd":29
 * cdef inline _ensure_code(arr):
 *     if hasattr(arr, "units"):
 *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
 *             return arr
 *         arr.convert_to_units("code_length")
 */
    }

    /* "yt/geometry/selection_routines.pxd":31
 *         if "code_length" == str(arr.units):
 *             return arr
 *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "yt/geometry/selection_routines.pxd":28
 * 
 * cdef inline _ensure_code(arr):
 *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
 *         if "code_length" == str(arr.units):
 *             return arr
 */
  }

  /* "yt/geometry/selection_routines.pxd":32
 *             return arr
 *         arr.convert_to_units("code_length")
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * cdef class SelectorObject:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  /* "yt/geometry/selection_routines.pxd":27
 *     np.float64_t
 * 
 * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
 *     if hasattr(arr, "units"):
 *         if "code_length" == str(arr.units):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("yt.geometry.selection_routines._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/geometry/selection_routines.pxd":78
 *     cdef public np.int64_t domain_id
 * 
 * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
 *                                         np.float64_t dw, bint periodic) nogil:
 *     cdef np.float64_t rel = x1 - x2
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) {
  __pyx_t_5numpy_float64_t __pyx_v_rel;
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;

  /* "yt/geometry/selection_routines.pxd":80
 * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,
 *                                         np.float64_t dw, bint periodic) nogil:
 *     cdef np.float64_t rel = x1 - x2             # <<<<<<<<<<<<<<
 *     if not periodic: return rel
 *     if rel > dw * 0.5:
 */
  __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2);

  /* "yt/geometry/selection_routines.pxd":81
 *                                         np.float64_t dw, bint periodic) nogil:
 *     cdef np.float64_t rel = x1 - x2
 *     if not periodic: return rel             # <<<<<<<<<<<<<<
 *     if rel > dw * 0.5:
 *         rel -= dw
 */
  __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_rel;
    goto __pyx_L0;
  }

  /* "yt/geometry/selection_routines.pxd":82
 *     cdef np.float64_t rel = x1 - x2
 *     if not periodic: return rel
 *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
 *         rel -= dw
 *     elif rel < -dw * 0.5:
 */
  __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0);
  if (__pyx_t_1) {

    /* "yt/geometry/selection_routines.pxd":83
 *     if not periodic: return rel
 *     if rel > dw * 0.5:
 *         rel -= dw             # <<<<<<<<<<<<<<
 *     elif rel < -dw * 0.5:
 *         rel += dw
 */
    __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw);

    /* "yt/geometry/selection_routines.pxd":82
 *     cdef np.float64_t rel = x1 - x2
 *     if not periodic: return rel
 *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
 *         rel -= dw
 *     elif rel < -dw * 0.5:
 */
    goto __pyx_L4;
  }

  /* "yt/geometry/selection_routines.pxd":84
 *     if rel > dw * 0.5:
 *         rel -= dw
 *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
 *         rel += dw
 *     return rel
 */
  __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0);
  if (__pyx_t_1) {

    /* "yt/geometry/selection_routines.pxd":85
 *         rel -= dw
 *     elif rel < -dw * 0.5:
 *         rel += dw             # <<<<<<<<<<<<<<
 *     return rel
 */
    __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw);

    /* "yt/geometry/selection_routines.pxd":84
 *     if rel > dw * 0.5:
 *         rel -= dw
 *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
 *         rel += dw
 *     return rel
 */
  }
  __pyx_L4:;

  /* "yt/geometry/selection_routines.pxd":86
 *     elif rel < -dw * 0.5:
 *         rel += dw
 *     return rel             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_rel;
  goto __pyx_L0;

  /* "yt/geometry/selection_routines.pxd":78
 *     cdef public np.int64_t domain_id
 * 
 * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
 *                                         np.float64_t dw, bint periodic) nogil:
 *     cdef np.float64_t rel = x1 - x2
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":19
 * cimport cython
 * 
 * cdef inline int imax(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

static CYTHON_INLINE int __pyx_f_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) {
  int __pyx_r;
  int __pyx_t_1;

  /* "fp_utils.pxd":20
 * 
 * cdef inline int imax(int i0, int i1) nogil:
 *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":21
 * cdef inline int imax(int i0, int i1) nogil:
 *     if i0 > i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "fp_utils.pxd":19
 * cimport cython
 * 
 * cdef inline int imax(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":23
 *     return i1
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 > f1: return f0
 *     return f1
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;

  /* "fp_utils.pxd":24
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
 *     return f1
 * 
 */
  __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_f0;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":25
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 > f1: return f0
 *     return f1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int imin(int i0, int i1) nogil:
 */
  __pyx_r = __pyx_v_f1;
  goto __pyx_L0;

  /* "fp_utils.pxd":23
 *     return i1
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 > f1: return f0
 *     return f1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":27
 *     return f1
 * 
 * cdef inline int imin(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

static CYTHON_INLINE int __pyx_f_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) {
  int __pyx_r;
  int __pyx_t_1;

  /* "fp_utils.pxd":28
 * 
 * cdef inline int imin(int i0, int i1) nogil:
 *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":29
 * cdef inline int imin(int i0, int i1) nogil:
 *     if i0 < i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "fp_utils.pxd":27
 *     return f1
 * 
 * cdef inline int imin(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":31
 *     return i1
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < f1: return f0
 *     return f1
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;

  /* "fp_utils.pxd":32
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
 *     return f1
 * 
 */
  __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_f0;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":33
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 < f1: return f0
 *     return f1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
 */
  __pyx_r = __pyx_v_f1;
  goto __pyx_L0;

  /* "fp_utils.pxd":31
 *     return i1
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < f1: return f0
 *     return f1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":35
 *     return f1
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < 0.0: return -f0
 *     return f0
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;

  /* "fp_utils.pxd":36
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
 *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
 *     return f0
 * 
 */
  __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
  if (__pyx_t_1) {
    __pyx_r = (-__pyx_v_f0);
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":37
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
 *     if f0 < 0.0: return -f0
 *     return f0             # <<<<<<<<<<<<<<
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:
 */
  __pyx_r = __pyx_v_f0;
  goto __pyx_L0;

  /* "fp_utils.pxd":35
 *     return f1
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < 0.0: return -f0
 *     return f0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":39
 *     return f0
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

static CYTHON_INLINE int __pyx_f_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  int __pyx_t_1;

  /* "fp_utils.pxd":40
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:
 *     if i < a: return a             # <<<<<<<<<<<<<<
 *     if i > b: return b
 *     return i
 */
  __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_a;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":41
 * cdef inline int iclip(int i, int a, int b) nogil:
 *     if i < a: return a
 *     if i > b: return b             # <<<<<<<<<<<<<<
 *     return i
 * 
 */
  __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_b;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":42
 *     if i < a: return a
 *     if i > b: return b
 *     return i             # <<<<<<<<<<<<<<
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
 */
  __pyx_r = __pyx_v_i;
  goto __pyx_L0;

  /* "fp_utils.pxd":39
 *     return f0
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":44
 *     return i
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

static CYTHON_INLINE int __pyx_f_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
  int __pyx_r;
  int __pyx_t_1;

  /* "fp_utils.pxd":45
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
 *     if i < a: return a             # <<<<<<<<<<<<<<
 *     if i > b: return b
 *     return i
 */
  __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_a;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":46
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
 *     if i < a: return a
 *     if i > b: return b             # <<<<<<<<<<<<<<
 *     return i
 * 
 */
  __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_b;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":47
 *     if i < a: return a
 *     if i > b: return b
 *     return i             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fclip(np.float64_t f,
 */
  __pyx_r = __pyx_v_i;
  goto __pyx_L0;

  /* "fp_utils.pxd":44
 *     return i
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":49
 *     return i
 * 
 * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
 *                       np.float64_t a, np.float64_t b) nogil:
 *     return fmin(fmax(f, a), b)
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;

  /* "fp_utils.pxd":51
 * cdef inline np.float64_t fclip(np.float64_t f,
 *                       np.float64_t a, np.float64_t b) nogil:
 *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
 */
  __pyx_r = __pyx_f_8fp_utils_fmin(__pyx_f_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b);
  goto __pyx_L0;

  /* "fp_utils.pxd":49
 *     return i
 * 
 * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
 *                       np.float64_t a, np.float64_t b) nogil:
 *     return fmin(fmax(f, a), b)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "fp_utils.pxd":53
 *     return fmin(fmax(f, a), b)
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("i64max", 0);

  /* "fp_utils.pxd":54
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
 *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":55
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
 *     if i0 > i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "fp_utils.pxd":53
 *     return fmin(fmax(f, a), b)
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fp_utils.pxd":57
 *     return i1
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("i64min", 0);

  /* "fp_utils.pxd":58
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
 *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "fp_utils.pxd":59
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
 *     if i0 < i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "fp_utils.pxd":57
 *     return i1
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/geometry/particle_deposit.pxd":29
 *     void *alloca(int)
 * 
 * cdef inline int gind(int i, int j, int k, int dims[3]):             # <<<<<<<<<<<<<<
 *     # The ordering is such that we want i to vary the slowest in this instance,
 *     # even though in other instances it varies the fastest.  To see this in
 */

static CYTHON_INLINE int __pyx_f_2yt_8geometry_16particle_deposit_gind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k, int *__pyx_v_dims) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gind", 0);

  /* "yt/geometry/particle_deposit.pxd":34
 *     # action, try looking at the results of an n_ref=256 particle CIC plot,
 *     # which shows it the most clearly.
 *     return ((i*dims[1])+j)*dims[2]+k             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((((__pyx_v_i * (__pyx_v_dims[1])) + __pyx_v_j) * (__pyx_v_dims[2])) + __pyx_v_k);
  goto __pyx_L0;

  /* "yt/geometry/particle_deposit.pxd":29
 *     void *alloca(int)
 * 
 * cdef inline int gind(int i, int j, int k, int dims[3]):             # <<<<<<<<<<<<<<
 *     # The ordering is such that we want i to vary the slowest in this instance,
 *     # even though in other instances it varies the fastest.  To see this in
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/geometry/particle_deposit.pxd":41
 * ####################################################
 * 
 * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
 *     cdef np.float64_t kernel
 *     if x <= 0.5:
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic(__pyx_t_5numpy_float64_t __pyx_v_x) {
  __pyx_t_5numpy_float64_t __pyx_v_kernel;
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "yt/geometry/particle_deposit.pxd":43
 * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil:
 *     cdef np.float64_t kernel
 *     if x <= 0.5:             # <<<<<<<<<<<<<<
 *         kernel = 1.-6.*x*x*(1.-x)
 *     elif x>0.5 and x<=1.0:
 */
  __pyx_t_1 = ((__pyx_v_x <= 0.5) != 0);
  if (__pyx_t_1) {

    /* "yt/geometry/particle_deposit.pxd":44
 *     cdef np.float64_t kernel
 *     if x <= 0.5:
 *         kernel = 1.-6.*x*x*(1.-x)             # <<<<<<<<<<<<<<
 *     elif x>0.5 and x<=1.0:
 *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
 */
    __pyx_v_kernel = (1. - (((6. * __pyx_v_x) * __pyx_v_x) * (1. - __pyx_v_x)));

    /* "yt/geometry/particle_deposit.pxd":43
 * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil:
 *     cdef np.float64_t kernel
 *     if x <= 0.5:             # <<<<<<<<<<<<<<
 *         kernel = 1.-6.*x*x*(1.-x)
 *     elif x>0.5 and x<=1.0:
 */
    goto __pyx_L3;
  }

  /* "yt/geometry/particle_deposit.pxd":45
 *     if x <= 0.5:
 *         kernel = 1.-6.*x*x*(1.-x)
 *     elif x>0.5 and x<=1.0:             # <<<<<<<<<<<<<<
 *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_x > 0.5) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_x <= 1.0) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "yt/geometry/particle_deposit.pxd":46
 *         kernel = 1.-6.*x*x*(1.-x)
 *     elif x>0.5 and x<=1.0:
 *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)             # <<<<<<<<<<<<<<
 *     else:
 *         kernel = 0.
 */
    __pyx_v_kernel = (((2. * (1. - __pyx_v_x)) * (1. - __pyx_v_x)) * (1. - __pyx_v_x));

    /* "yt/geometry/particle_deposit.pxd":45
 *     if x <= 0.5:
 *         kernel = 1.-6.*x*x*(1.-x)
 *     elif x>0.5 and x<=1.0:             # <<<<<<<<<<<<<<
 *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "yt/geometry/particle_deposit.pxd":48
 *         kernel = 2.*(1.-x)*(1.-x)*(1.-x)
 *     else:
 *         kernel = 0.             # <<<<<<<<<<<<<<
 *     return kernel
 * 
 */
  /*else*/ {
    __pyx_v_kernel = 0.;
  }
  __pyx_L3:;

  /* "yt/geometry/particle_deposit.pxd":49
 *     else:
 *         kernel = 0.
 *     return kernel             # <<<<<<<<<<<<<<
 * 
 * ########################################################
 */
  __pyx_r = __pyx_v_kernel;
  goto __pyx_L0;

  /* "yt/geometry/particle_deposit.pxd":41
 * ####################################################
 * 
 * cdef inline np.float64_t sph_kernel_cubic(np.float64_t x) nogil:             # <<<<<<<<<<<<<<
 *     cdef np.float64_t kernel
 *     if x <= 0.5:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/geometry/particle_deposit.pxd":56
 * 
 * # quartic spline
 * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x):             # <<<<<<<<<<<<<<
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 5.**6/512/np.pi
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic(__pyx_t_5numpy_float64_t __pyx_v_x) {
  __pyx_t_5numpy_float64_t __pyx_v_kernel;
  __pyx_t_5numpy_float64_t __pyx_v_C;
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sph_kernel_quartic", 0);

  /* "yt/geometry/particle_deposit.pxd":58
 * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x):
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 5.**6/512/np.pi             # <<<<<<<<<<<<<<
 *     if x < 1:
 *         kernel = (1.-x)**4
 */
  __pyx_t_1 = PyFloat_FromDouble((pow(5., 6.0) / 512.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_C = __pyx_t_4;

  /* "yt/geometry/particle_deposit.pxd":59
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 5.**6/512/np.pi
 *     if x < 1:             # <<<<<<<<<<<<<<
 *         kernel = (1.-x)**4
 *         if x < 3./5:
 */
  __pyx_t_5 = ((__pyx_v_x < 1.0) != 0);
  if (__pyx_t_5) {

    /* "yt/geometry/particle_deposit.pxd":60
 *     cdef np.float64_t C = 5.**6/512/np.pi
 *     if x < 1:
 *         kernel = (1.-x)**4             # <<<<<<<<<<<<<<
 *         if x < 3./5:
 *             kernel -= 5*(3./5-x)**4
 */
    __pyx_v_kernel = pow((1. - __pyx_v_x), 4.0);

    /* "yt/geometry/particle_deposit.pxd":61
 *     if x < 1:
 *         kernel = (1.-x)**4
 *         if x < 3./5:             # <<<<<<<<<<<<<<
 *             kernel -= 5*(3./5-x)**4
 *             if x < 1./5:
 */
    __pyx_t_5 = ((__pyx_v_x < (3. / 5.0)) != 0);
    if (__pyx_t_5) {

      /* "yt/geometry/particle_deposit.pxd":62
 *         kernel = (1.-x)**4
 *         if x < 3./5:
 *             kernel -= 5*(3./5-x)**4             # <<<<<<<<<<<<<<
 *             if x < 1./5:
 *                 kernel += 10*(1./5-x)**4
 */
      __pyx_v_kernel = (__pyx_v_kernel - (5.0 * pow(((3. / 5.0) - __pyx_v_x), 4.0)));

      /* "yt/geometry/particle_deposit.pxd":63
 *         if x < 3./5:
 *             kernel -= 5*(3./5-x)**4
 *             if x < 1./5:             # <<<<<<<<<<<<<<
 *                 kernel += 10*(1./5-x)**4
 *     else:
 */
      __pyx_t_5 = ((__pyx_v_x < (1. / 5.0)) != 0);
      if (__pyx_t_5) {

        /* "yt/geometry/particle_deposit.pxd":64
 *             kernel -= 5*(3./5-x)**4
 *             if x < 1./5:
 *                 kernel += 10*(1./5-x)**4             # <<<<<<<<<<<<<<
 *     else:
 *         kernel = 0.
 */
        __pyx_v_kernel = (__pyx_v_kernel + (10.0 * pow(((1. / 5.0) - __pyx_v_x), 4.0)));

        /* "yt/geometry/particle_deposit.pxd":63
 *         if x < 3./5:
 *             kernel -= 5*(3./5-x)**4
 *             if x < 1./5:             # <<<<<<<<<<<<<<
 *                 kernel += 10*(1./5-x)**4
 *     else:
 */
      }

      /* "yt/geometry/particle_deposit.pxd":61
 *     if x < 1:
 *         kernel = (1.-x)**4
 *         if x < 3./5:             # <<<<<<<<<<<<<<
 *             kernel -= 5*(3./5-x)**4
 *             if x < 1./5:
 */
    }

    /* "yt/geometry/particle_deposit.pxd":59
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 5.**6/512/np.pi
 *     if x < 1:             # <<<<<<<<<<<<<<
 *         kernel = (1.-x)**4
 *         if x < 3./5:
 */
    goto __pyx_L3;
  }

  /* "yt/geometry/particle_deposit.pxd":66
 *                 kernel += 10*(1./5-x)**4
 *     else:
 *         kernel = 0.             # <<<<<<<<<<<<<<
 *     return kernel * C
 * 
 */
  /*else*/ {
    __pyx_v_kernel = 0.;
  }
  __pyx_L3:;

  /* "yt/geometry/particle_deposit.pxd":67
 *     else:
 *         kernel = 0.
 *     return kernel * C             # <<<<<<<<<<<<<<
 * 
 * # quintic spline
 */
  __pyx_r = (__pyx_v_kernel * __pyx_v_C);
  goto __pyx_L0;

  /* "yt/geometry/particle_deposit.pxd":56
 * 
 * # quartic spline
 * cdef inline np.float64_t sph_kernel_quartic(np.float64_t x):             # <<<<<<<<<<<<<<
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 5.**6/512/np.pi
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quartic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/geometry/particle_deposit.pxd":70
 * 
 * # quintic spline
 * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x):             # <<<<<<<<<<<<<<
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 3.**7/40/np.pi
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic(__pyx_t_5numpy_float64_t __pyx_v_x) {
  __pyx_t_5numpy_float64_t __pyx_v_kernel;
  __pyx_t_5numpy_float64_t __pyx_v_C;
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sph_kernel_quintic", 0);

  /* "yt/geometry/particle_deposit.pxd":72
 * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x):
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 3.**7/40/np.pi             # <<<<<<<<<<<<<<
 *     if x < 1:
 *         kernel = (1.-x)**5
 */
  __pyx_t_1 = PyFloat_FromDouble((pow(3., 7.0) / 40.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_C = __pyx_t_4;

  /* "yt/geometry/particle_deposit.pxd":73
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 3.**7/40/np.pi
 *     if x < 1:             # <<<<<<<<<<<<<<
 *         kernel = (1.-x)**5
 *         if x < 2./3:
 */
  __pyx_t_5 = ((__pyx_v_x < 1.0) != 0);
  if (__pyx_t_5) {

    /* "yt/geometry/particle_deposit.pxd":74
 *     cdef np.float64_t C = 3.**7/40/np.pi
 *     if x < 1:
 *         kernel = (1.-x)**5             # <<<<<<<<<<<<<<
 *         if x < 2./3:
 *             kernel -= 6*(2./3-x)**5
 */
    __pyx_v_kernel = pow((1. - __pyx_v_x), 5.0);

    /* "yt/geometry/particle_deposit.pxd":75
 *     if x < 1:
 *         kernel = (1.-x)**5
 *         if x < 2./3:             # <<<<<<<<<<<<<<
 *             kernel -= 6*(2./3-x)**5
 *             if x < 1./3:
 */
    __pyx_t_5 = ((__pyx_v_x < (2. / 3.0)) != 0);
    if (__pyx_t_5) {

      /* "yt/geometry/particle_deposit.pxd":76
 *         kernel = (1.-x)**5
 *         if x < 2./3:
 *             kernel -= 6*(2./3-x)**5             # <<<<<<<<<<<<<<
 *             if x < 1./3:
 *                 kernel += 15*(1./3-x)**5
 */
      __pyx_v_kernel = (__pyx_v_kernel - (6.0 * pow(((2. / 3.0) - __pyx_v_x), 5.0)));

      /* "yt/geometry/particle_deposit.pxd":77
 *         if x < 2./3:
 *             kernel -= 6*(2./3-x)**5
 *             if x < 1./3:             # <<<<<<<<<<<<<<
 *                 kernel += 15*(1./3-x)**5
 *     else:
 */
      __pyx_t_5 = ((__pyx_v_x < (1. / 3.0)) != 0);
      if (__pyx_t_5) {

        /* "yt/geometry/particle_deposit.pxd":78
 *             kernel -= 6*(2./3-x)**5
 *             if x < 1./3:
 *                 kernel += 15*(1./3-x)**5             # <<<<<<<<<<<<<<
 *     else:
 *         kernel = 0.
 */
        __pyx_v_kernel = (__pyx_v_kernel + (15.0 * pow(((1. / 3.0) - __pyx_v_x), 5.0)));

        /* "yt/geometry/particle_deposit.pxd":77
 *         if x < 2./3:
 *             kernel -= 6*(2./3-x)**5
 *             if x < 1./3:             # <<<<<<<<<<<<<<
 *                 kernel += 15*(1./3-x)**5
 *     else:
 */
      }

      /* "yt/geometry/particle_deposit.pxd":75
 *     if x < 1:
 *         kernel = (1.-x)**5
 *         if x < 2./3:             # <<<<<<<<<<<<<<
 *             kernel -= 6*(2./3-x)**5
 *             if x < 1./3:
 */
    }

    /* "yt/geometry/particle_deposit.pxd":73
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 3.**7/40/np.pi
 *     if x < 1:             # <<<<<<<<<<<<<<
 *         kernel = (1.-x)**5
 *         if x < 2./3:
 */
    goto __pyx_L3;
  }

  /* "yt/geometry/particle_deposit.pxd":80
 *                 kernel += 15*(1./3-x)**5
 *     else:
 *         kernel = 0.             # <<<<<<<<<<<<<<
 *     return kernel * C
 * 
 */
  /*else*/ {
    __pyx_v_kernel = 0.;
  }
  __pyx_L3:;

  /* "yt/geometry/particle_deposit.pxd":81
 *     else:
 *         kernel = 0.
 *     return kernel * C             # <<<<<<<<<<<<<<
 * 
 * # I don't know the way to use a dict in a cdef class.
 */
  __pyx_r = (__pyx_v_kernel * __pyx_v_C);
  goto __pyx_L0;

  /* "yt/geometry/particle_deposit.pxd":70
 * 
 * # quintic spline
 * cdef inline np.float64_t sph_kernel_quintic(np.float64_t x):             # <<<<<<<<<<<<<<
 *     cdef np.float64_t kernel
 *     cdef np.float64_t C = 3.**7/40/np.pi
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("yt.geometry.particle_deposit.sph_kernel_quintic", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/geometry/particle_deposit.pxd":87
 * # I manually created a function to lookup the kernel functions.
 * ctypedef np.float64_t (*kernel_func) (np.float64_t)
 * cdef inline kernel_func get_kernel_func(str kernel_name):             # <<<<<<<<<<<<<<
 *     if kernel_name == 'cubic':
 *         return sph_kernel_cubic
 */

static CYTHON_INLINE __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_f_2yt_8geometry_16particle_deposit_get_kernel_func(PyObject *__pyx_v_kernel_name) {
  __pyx_t_2yt_8geometry_16particle_deposit_kernel_func __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_kernel_func", 0);

  /* "yt/geometry/particle_deposit.pxd":88
 * ctypedef np.float64_t (*kernel_func) (np.float64_t)
 * cdef inline kernel_func get_kernel_func(str kernel_name):
 *     if kernel_name == 'cubic':             # <<<<<<<<<<<<<<
 *         return sph_kernel_cubic
 *     elif kernel_name == 'quartic':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_cubic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "yt/geometry/particle_deposit.pxd":89
 * cdef inline kernel_func get_kernel_func(str kernel_name):
 *     if kernel_name == 'cubic':
 *         return sph_kernel_cubic             # <<<<<<<<<<<<<<
 *     elif kernel_name == 'quartic':
 *         return sph_kernel_quartic
 */
    __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_cubic;
    goto __pyx_L0;

    /* "yt/geometry/particle_deposit.pxd":88
 * ctypedef np.float64_t (*kernel_func) (np.float64_t)
 * cdef inline kernel_func get_kernel_func(str kernel_name):
 *     if kernel_name == 'cubic':             # <<<<<<<<<<<<<<
 *         return sph_kernel_cubic
 *     elif kernel_name == 'quartic':
 */
  }

  /* "yt/geometry/particle_deposit.pxd":90
 *     if kernel_name == 'cubic':
 *         return sph_kernel_cubic
 *     elif kernel_name == 'quartic':             # <<<<<<<<<<<<<<
 *         return sph_kernel_quartic
 *     elif kernel_name == 'quintic':
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quartic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "yt/geometry/particle_deposit.pxd":91
 *         return sph_kernel_cubic
 *     elif kernel_name == 'quartic':
 *         return sph_kernel_quartic             # <<<<<<<<<<<<<<
 *     elif kernel_name == 'quintic':
 *         return sph_kernel_quintic
 */
    __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quartic;
    goto __pyx_L0;

    /* "yt/geometry/particle_deposit.pxd":90
 *     if kernel_name == 'cubic':
 *         return sph_kernel_cubic
 *     elif kernel_name == 'quartic':             # <<<<<<<<<<<<<<
 *         return sph_kernel_quartic
 *     elif kernel_name == 'quintic':
 */
  }

  /* "yt/geometry/particle_deposit.pxd":92
 *     elif kernel_name == 'quartic':
 *         return sph_kernel_quartic
 *     elif kernel_name == 'quintic':             # <<<<<<<<<<<<<<
 *         return sph_kernel_quintic
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_kernel_name, __pyx_n_s_quintic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "yt/geometry/particle_deposit.pxd":93
 *         return sph_kernel_quartic
 *     elif kernel_name == 'quintic':
 *         return sph_kernel_quintic             # <<<<<<<<<<<<<<
 *     else:
 *         raise NotImplementedError
 */
    __pyx_r = __pyx_f_2yt_8geometry_16particle_deposit_sph_kernel_quintic;
    goto __pyx_L0;

    /* "yt/geometry/particle_deposit.pxd":92
 *     elif kernel_name == 'quartic':
 *         return sph_kernel_quartic
 *     elif kernel_name == 'quintic':             # <<<<<<<<<<<<<<
 *         return sph_kernel_quintic
 *     else:
 */
  }

  /* "yt/geometry/particle_deposit.pxd":95
 *         return sph_kernel_quintic
 *     else:
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * cdef class ParticleDepositOperation:
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "yt/geometry/particle_deposit.pxd":87
 * # I manually created a function to lookup the kernel functions.
 * ctypedef np.float64_t (*kernel_func) (np.float64_t)
 * cdef inline kernel_func get_kernel_func(str kernel_name):             # <<<<<<<<<<<<<<
 *     if kernel_name == 'cubic':
 *         return sph_kernel_cubic
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("yt.geometry.particle_deposit.get_kernel_func", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # 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.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
    goto __pyx_L4;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  /*else*/ {
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
    goto __pyx_L11;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
 *             else:
 *                 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(__pyx_v_self));
  }
  __pyx_L11:;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
 *                 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;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238
 *                 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(__pyx_v_self);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef int offset
 */
  __pyx_v_f = NULL;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef int offset
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
    goto __pyx_L14;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
  /*else*/ {
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L14:;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_1) {

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 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_b;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      case NPY_UBYTE:
      __pyx_v_f = __pyx_k_B;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
 *                 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"
 */
      case NPY_SHORT:
      __pyx_v_f = __pyx_k_h;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
 *                 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"
 */
      case NPY_USHORT:
      __pyx_v_f = __pyx_k_H;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
 *                 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"
 */
      case NPY_INT:
      __pyx_v_f = __pyx_k_i;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
 *                 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"
 */
      case NPY_UINT:
      __pyx_v_f = __pyx_k_I;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
 *                 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"
 */
      case NPY_LONG:
      __pyx_v_f = __pyx_k_l;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
 *                 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"
 */
      case NPY_ULONG:
      __pyx_v_f = __pyx_k_L;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
 *                 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"
 */
      case NPY_LONGLONG:
      __pyx_v_f = __pyx_k_q;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
 *                 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"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = __pyx_k_Q;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *                 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"
 */
      case NPY_FLOAT:
      __pyx_v_f = __pyx_k_f;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
 *                 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_CFLOAT:      f = "Zf"
 */
      case NPY_DOUBLE:
      __pyx_v_f = __pyx_k_d;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = __pyx_k_g;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      case NPY_CFLOAT:
      __pyx_v_f = __pyx_k_Zf;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = __pyx_k_Zd;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = __pyx_k_Zg;
      break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      case NPY_OBJECT:
      __pyx_v_f = __pyx_k_O;
      break;
      default:

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)malloc(255));

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_7;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # 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.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
 * 
 *     cdef dtype child
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
 *     cdef dtype child
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (__pyx_t_6) {

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_6) {

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
      /*else*/ {
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L15:;

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
    goto __pyx_L3;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
  /*else*/ {
    Py_INCREF(__pyx_v_base);

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":19
 * cimport cython
 * 
 * cdef inline int imax(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(int __pyx_v_i0, int __pyx_v_i1) {
  int __pyx_r;
  int __pyx_t_1;

  /* "yt/utilities/lib/fp_utils.pxd":20
 * 
 * cdef inline int imax(int i0, int i1) nogil:
 *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":21
 * cdef inline int imax(int i0, int i1) nogil:
 *     if i0 > i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":19
 * cimport cython
 * 
 * cdef inline int imax(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":23
 *     return i1
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 > f1: return f0
 *     return f1
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;

  /* "yt/utilities/lib/fp_utils.pxd":24
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
 *     return f1
 * 
 */
  __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_f0;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":25
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 > f1: return f0
 *     return f1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int imin(int i0, int i1) nogil:
 */
  __pyx_r = __pyx_v_f1;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":23
 *     return i1
 * 
 * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 > f1: return f0
 *     return f1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":27
 *     return f1
 * 
 * cdef inline int imin(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(int __pyx_v_i0, int __pyx_v_i1) {
  int __pyx_r;
  int __pyx_t_1;

  /* "yt/utilities/lib/fp_utils.pxd":28
 * 
 * cdef inline int imin(int i0, int i1) nogil:
 *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":29
 * cdef inline int imin(int i0, int i1) nogil:
 *     if i0 < i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":27
 *     return f1
 * 
 * cdef inline int imin(int i0, int i1) nogil:             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":31
 *     return i1
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < f1: return f0
 *     return f1
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;

  /* "yt/utilities/lib/fp_utils.pxd":32
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
 *     return f1
 * 
 */
  __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_f0;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":33
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
 *     if f0 < f1: return f0
 *     return f1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
 */
  __pyx_r = __pyx_v_f1;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":31
 *     return i1
 * 
 * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < f1: return f0
 *     return f1
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":35
 *     return f1
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < 0.0: return -f0
 *     return f0
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
  __pyx_t_5numpy_float64_t __pyx_r;
  int __pyx_t_1;

  /* "yt/utilities/lib/fp_utils.pxd":36
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
 *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
 *     return f0
 * 
 */
  __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
  if (__pyx_t_1) {
    __pyx_r = (-__pyx_v_f0);
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":37
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
 *     if f0 < 0.0: return -f0
 *     return f0             # <<<<<<<<<<<<<<
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:
 */
  __pyx_r = __pyx_v_f0;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":35
 *     return f1
 * 
 * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
 *     if f0 < 0.0: return -f0
 *     return f0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":39
 *     return f0
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(int __pyx_v_i, int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  int __pyx_t_1;

  /* "yt/utilities/lib/fp_utils.pxd":40
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:
 *     if i < a: return a             # <<<<<<<<<<<<<<
 *     if i > b: return b
 *     return i
 */
  __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_a;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":41
 * cdef inline int iclip(int i, int a, int b) nogil:
 *     if i < a: return a
 *     if i > b: return b             # <<<<<<<<<<<<<<
 *     return i
 * 
 */
  __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_b;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":42
 *     if i < a: return a
 *     if i > b: return b
 *     return i             # <<<<<<<<<<<<<<
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
 */
  __pyx_r = __pyx_v_i;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":39
 *     return f0
 * 
 * cdef inline int iclip(int i, int a, int b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":44
 *     return i
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
  int __pyx_r;
  int __pyx_t_1;

  /* "yt/utilities/lib/fp_utils.pxd":45
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
 *     if i < a: return a             # <<<<<<<<<<<<<<
 *     if i > b: return b
 *     return i
 */
  __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_a;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":46
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
 *     if i < a: return a
 *     if i > b: return b             # <<<<<<<<<<<<<<
 *     return i
 * 
 */
  __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_b;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":47
 *     if i < a: return a
 *     if i > b: return b
 *     return i             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.float64_t fclip(np.float64_t f,
 */
  __pyx_r = __pyx_v_i;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":44
 *     return i
 * 
 * cdef inline int i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
 *     if i < a: return a
 *     if i > b: return b
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":49
 *     return i
 * 
 * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
 *                       np.float64_t a, np.float64_t b) nogil:
 *     return fmin(fmax(f, a), b)
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;

  /* "yt/utilities/lib/fp_utils.pxd":51
 * cdef inline np.float64_t fclip(np.float64_t f,
 *                       np.float64_t a, np.float64_t b) nogil:
 *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
 */
  __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b);
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":49
 *     return i
 * 
 * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
 *                       np.float64_t a, np.float64_t b) nogil:
 *     return fmin(fmax(f, a), b)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":53
 *     return fmin(fmax(f, a), b)
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("i64max", 0);

  /* "yt/utilities/lib/fp_utils.pxd":54
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
 *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":55
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
 *     if i0 > i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":53
 *     return fmin(fmax(f, a), b)
 * 
 * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 > i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "yt/utilities/lib/fp_utils.pxd":57
 *     return i1
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("i64min", 0);

  /* "yt/utilities/lib/fp_utils.pxd":58
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
 *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
 *     return i1
 * 
 */
  __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
  if (__pyx_t_1) {
    __pyx_r = __pyx_v_i0;
    goto __pyx_L0;
  }

  /* "yt/utilities/lib/fp_utils.pxd":59
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
 *     if i0 < i1: return i0
 *     return i1             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_r = __pyx_v_i1;
  goto __pyx_L0;

  /* "yt/utilities/lib/fp_utils.pxd":57
 *     return i1
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)o);
  p->parameters = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyObject *o) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->parameters);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)o;
  if (p->parameters) {
    e = (*v)(p->parameters, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_artio_fileset(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)o;
  tmp = ((PyObject*)p->parameters);
  p->parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_parameters(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_parameters(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_10parameters_5__del__(o);
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8num_grid_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_grid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_grid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_8has_grid_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_min_level(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_min_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9min_level_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_max_level(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_max_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9max_level_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid_variables(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid_variables(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_18num_grid_variables_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_particles(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_particles(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13has_particles_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_species(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_species(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11num_species_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_artio_fileset[] = {
  {"read_parameters", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_5read_parameters, METH_NOARGS, 0},
  {"abox_from_auni", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_7abox_from_auni, METH_O, 0},
  {"tcode_from_auni", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_9tcode_from_auni, METH_O, 0},
  {"tphys_from_auni", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_11tphys_from_auni, METH_O, 0},
  {"auni_from_abox", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_13auni_from_abox, METH_O, 0},
  {"auni_from_tcode", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_15auni_from_tcode, METH_O, 0},
  {"auni_from_tcode_array", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_17auni_from_tcode_array, METH_O, 0},
  {"auni_from_tphys", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_19auni_from_tphys, METH_O, 0},
  {"abox_from_tcode", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_21abox_from_tcode, METH_O, 0},
  {"tcode_from_abox", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_23tcode_from_abox, METH_O, 0},
  {"tphys_from_abox", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_25tphys_from_abox, METH_O, 0},
  {"tphys_from_tcode", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_27tphys_from_tcode, METH_O, 0},
  {"tphys_from_tcode_array", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_29tphys_from_tcode_array, METH_O, 0},
  {"read_particle_chunk", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_31read_particle_chunk, METH_VARARGS|METH_KEYWORDS, 0},
  {"read_grid_chunk", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_33read_grid_chunk, METH_VARARGS|METH_KEYWORDS, 0},
  {"root_sfc_ranges_all", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_35root_sfc_ranges_all, METH_VARARGS|METH_KEYWORDS, 0},
  {"root_sfc_ranges", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_37root_sfc_ranges, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_artio_fileset[] = {
  {(char *)"parameters", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_parameters, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_parameters, 0, 0},
  {(char *)"num_grid", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid, 0, 0},
  {(char *)"has_grid", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_grid, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_grid, 0, 0},
  {(char *)"min_level", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_min_level, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_min_level, 0, 0},
  {(char *)"max_level", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_max_level, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_max_level, 0, 0},
  {(char *)"num_grid_variables", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid_variables, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_grid_variables, 0, 0},
  {(char *)"has_particles", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_particles, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_has_particles, 0, 0},
  {(char *)"num_species", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_species, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_num_species, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset = {
  PyVarObject_HEAD_INIT(0, 0)
  "yt.frontends.artio._artio_caller.artio_fileset", /*tp_name*/
  sizeof(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_artio_fileset, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_artio_fileset, /*tp_traverse*/
  __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_artio_fileset, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_2yt_9frontends_5artio_13_artio_caller_artio_fileset, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_artio_fileset, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_2yt_9frontends_5artio_13_artio_caller_13artio_fileset_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_artio_fileset, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)o);
  p->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None); Py_INCREF(Py_None);
  p->root_mesh_handler = Py_None; Py_INCREF(Py_None);
  p->oct_count = Py_None; Py_INCREF(Py_None);
  p->octree_handler = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler(PyObject *o) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->artio_handle);
  Py_CLEAR(p->root_mesh_handler);
  Py_CLEAR(p->oct_count);
  Py_CLEAR(p->octree_handler);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)o;
  if (p->artio_handle) {
    e = (*v)(((PyObject*)p->artio_handle), a); if (e) return e;
  }
  if (p->root_mesh_handler) {
    e = (*v)(p->root_mesh_handler, a); if (e) return e;
  }
  if (p->oct_count) {
    e = (*v)(p->oct_count, a); if (e) return e;
  }
  if (p->octree_handler) {
    e = (*v)(p->octree_handler, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)o;
  tmp = ((PyObject*)p->artio_handle);
  p->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->root_mesh_handler);
  p->root_mesh_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->oct_count);
  p->oct_count = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->octree_handler);
  p->octree_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_start(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9sfc_start_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_end(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7sfc_end_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_artio_handle(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_artio_handle(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_12artio_handle_5__del__(o);
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_root_mesh_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_root_mesh_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_17root_mesh_handler_5__del__(o);
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_oct_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_oct_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_9oct_count_5__del__(o);
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_octree_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_octree_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_14octree_handler_5__del__(o);
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_total_octs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_total_octs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_10total_octs_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler[] = {
  {"construct_mesh", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_5construct_mesh, METH_NOARGS, 0},
  {"free_mesh", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_7free_mesh, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler[] = {
  {(char *)"sfc_start", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_start, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_start, 0, 0},
  {(char *)"sfc_end", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_end, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_sfc_end, 0, 0},
  {(char *)"artio_handle", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_artio_handle, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_artio_handle, 0, 0},
  {(char *)"root_mesh_handler", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_root_mesh_handler, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_root_mesh_handler, 0, 0},
  {(char *)"oct_count", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_oct_count, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_oct_count, 0, 0},
  {(char *)"octree_handler", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_octree_handler, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_octree_handler, 0, 0},
  {(char *)"total_octs", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_total_octs, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_total_octs, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler = {
  PyVarObject_HEAD_INIT(0, 0)
  "yt.frontends.artio._artio_caller.ARTIOSFCRangeHandler", /*tp_name*/
  sizeof(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, /*tp_traverse*/
  __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOSFCRangeHandler_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer;

static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *p;
  PyObject *o = __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_new(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer;
  p->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None); Py_INCREF(Py_None);
  p->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer(PyObject *o) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->artio_handle);
  Py_CLEAR(p->range_handler);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  if (likely(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer);
}

static int __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)o;
  e = ((likely(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) ? ((__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_traverse) ? __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer)); if (e) return e;
  if (p->artio_handle) {
    e = (*v)(((PyObject*)p->artio_handle), a); if (e) return e;
  }
  if (p->range_handler) {
    e = (*v)(((PyObject*)p->range_handler), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *)o;
  if (likely(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) { if (__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_clear) __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer);
  tmp = ((PyObject*)p->artio_handle);
  p->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->range_handler);
  p->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_artio_handle(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_artio_handle(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_12artio_handle_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer[] = {
  {"fill_sfc", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_3fill_sfc, METH_VARARGS|METH_KEYWORDS, 0},
  {"fill_sfc_particles", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_5fill_sfc_particles, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer[] = {
  {(char *)"artio_handle", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_artio_handle, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_artio_handle, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer = {
  PyVarObject_HEAD_INIT(0, 0)
  "yt.frontends.artio._artio_caller.ARTIOOctreeContainer", /*tp_name*/
  sizeof(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer, /*tp_traverse*/
  __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer;

static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)o);
  p->__pyx_vtab = __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer;
  p->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None); Py_INCREF(Py_None);
  p->_last_mask = Py_None; Py_INCREF(Py_None);
  p->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer(PyObject *o) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->artio_handle);
  Py_CLEAR(p->_last_mask);
  Py_CLEAR(p->range_handler);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)o;
  if (p->artio_handle) {
    e = (*v)(((PyObject*)p->artio_handle), a); if (e) return e;
  }
  if (p->_last_mask) {
    e = (*v)(p->_last_mask, a); if (e) return e;
  }
  if (p->range_handler) {
    e = (*v)(((PyObject*)p->range_handler), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)o;
  tmp = ((PyObject*)p->artio_handle);
  p->artio_handle = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_artio_fileset *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_last_mask);
  p->_last_mask = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->range_handler);
  p->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_artio_handle(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_artio_handle(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_12artio_handle_5__del__(o);
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_mask(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_mask(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_3__set__(o, v);
  }
  else {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_10_last_mask_5__del__(o);
  }
}

static PyObject *__pyx_getprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_selector_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_1__get__(o);
}

static int __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_selector_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17_last_selector_id_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer[] = {
  {"icoords", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_5icoords, METH_VARARGS|METH_KEYWORDS, 0},
  {"fcoords", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_7fcoords, METH_VARARGS|METH_KEYWORDS, 0},
  {"fwidth", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_9fwidth, METH_VARARGS|METH_KEYWORDS, 0},
  {"ires", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_11ires, METH_VARARGS|METH_KEYWORDS, 0},
  {"selector_fill", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_13selector_fill, METH_VARARGS|METH_KEYWORDS, 0},
  {"mask", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_15mask, METH_VARARGS|METH_KEYWORDS, 0},
  {"fill_sfc_particles", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_17fill_sfc_particles, METH_O, 0},
  {"fill_sfc", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_19fill_sfc, METH_VARARGS|METH_KEYWORDS, 0},
  {"deposit", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_21deposit, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer[] = {
  {(char *)"artio_handle", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_artio_handle, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_artio_handle, 0, 0},
  {(char *)"_last_mask", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_mask, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_mask, 0, 0},
  {(char *)"_last_selector_id", __pyx_getprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_selector_id, __pyx_setprop_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer__last_selector_id, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer = {
  PyVarObject_HEAD_INIT(0, 0)
  "yt.frontends.artio._artio_caller.ARTIORootMeshContainer", /*tp_name*/
  sizeof(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer, /*tp_traverse*/
  __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector;

static PyObject *__pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *p;
  PyObject *o = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_new(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector;
  p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None);
  p->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)Py_None); Py_INCREF(Py_None);
  p->mesh_container = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector(PyObject *o) {
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->base_selector);
  Py_CLEAR(p->range_handler);
  Py_CLEAR(p->mesh_container);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector);
}

static int __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)o;
  e = ((likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) ? ((__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse) ? __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector)); if (e) return e;
  if (p->base_selector) {
    e = (*v)(((PyObject*)p->base_selector), a); if (e) return e;
  }
  if (p->range_handler) {
    e = (*v)(((PyObject*)p->range_handler), a); if (e) return e;
  }
  if (p->mesh_container) {
    e = (*v)(((PyObject*)p->mesh_container), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *p = (struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector *)o;
  if (likely(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) { if (__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear) __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector);
  tmp = ((PyObject*)p->base_selector);
  p->base_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->range_handler);
  p->range_handler = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mesh_container);
  p->mesh_container = ((struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector[] = {
  {"select_grids", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_3select_grids, METH_VARARGS|METH_KEYWORDS, 0},
  {"_hash_vals", (PyCFunction)__pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_5_hash_vals, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector = {
  PyVarObject_HEAD_INIT(0, 0)
  "yt.frontends.artio._artio_caller.SFCRangeSelector", /*tp_name*/
  sizeof(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector, /*tp_traverse*/
  __pyx_tp_clear_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "_artio_caller",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_ARTIO_file_corruption_detected_i, __pyx_k_ARTIO_file_corruption_detected_i, sizeof(__pyx_k_ARTIO_file_corruption_detected_i), 0, 0, 1, 0},
  {&__pyx_kp_s_Attempted_to_read_non_existent_p, __pyx_k_Attempted_to_read_non_existent_p, sizeof(__pyx_k_Attempted_to_read_non_existent_p), 0, 0, 1, 0},
  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  {&__pyx_n_s_DeltaDC, __pyx_k_DeltaDC, sizeof(__pyx_k_DeltaDC), 0, 0, 1, 1},
  {&__pyx_n_s_Field, __pyx_k_Field, sizeof(__pyx_k_Field), 0, 0, 1, 1},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_kp_s_Invalid_species_provided_to_read, __pyx_k_Invalid_species_provided_to_read, sizeof(__pyx_k_Invalid_species_provided_to_read), 0, 0, 1, 0},
  {&__pyx_n_s_MASS, __pyx_k_MASS, sizeof(__pyx_k_MASS), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_OmegaB, __pyx_k_OmegaB, sizeof(__pyx_k_OmegaB), 0, 0, 1, 1},
  {&__pyx_n_s_OmegaL, __pyx_k_OmegaL, sizeof(__pyx_k_OmegaL), 0, 0, 1, 1},
  {&__pyx_n_s_OmegaM, __pyx_k_OmegaM, sizeof(__pyx_k_OmegaM), 0, 0, 1, 1},
  {&__pyx_n_s_PID, __pyx_k_PID, sizeof(__pyx_k_PID), 0, 0, 1, 1},
  {&__pyx_n_s_POSITION_X, __pyx_k_POSITION_X, sizeof(__pyx_k_POSITION_X), 0, 0, 1, 1},
  {&__pyx_n_s_POSITION_Y, __pyx_k_POSITION_Y, sizeof(__pyx_k_POSITION_Y), 0, 0, 1, 1},
  {&__pyx_n_s_POSITION_Z, __pyx_k_POSITION_Z, sizeof(__pyx_k_POSITION_Z), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_SPECIES, __pyx_k_SPECIES, sizeof(__pyx_k_SPECIES), 0, 0, 1, 1},
  {&__pyx_kp_s_Unable_to_locate_particle_header, __pyx_k_Unable_to_locate_particle_header, sizeof(__pyx_k_Unable_to_locate_particle_header), 0, 0, 1, 0},
  {&__pyx_kp_s_Unable_to_locate_position_inform, __pyx_k_Unable_to_locate_position_inform, sizeof(__pyx_k_Unable_to_locate_position_inform), 0, 0, 1, 0},
  {&__pyx_kp_s_Unable_to_locate_variable_labels, __pyx_k_Unable_to_locate_variable_labels, sizeof(__pyx_k_Unable_to_locate_variable_labels), 0, 0, 1, 0},
  {&__pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_k_Users_goldbaum_Documents_yt_hg, sizeof(__pyx_k_Users_goldbaum_Documents_yt_hg), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_abox, __pyx_k_abox, sizeof(__pyx_k_abox), 0, 0, 1, 1},
  {&__pyx_kp_s_abox_from_auni_called_for_non_co, __pyx_k_abox_from_auni_called_for_non_co, sizeof(__pyx_k_abox_from_auni_called_for_non_co), 0, 0, 1, 0},
  {&__pyx_kp_s_abox_from_tcode_called_for_non_c, __pyx_k_abox_from_tcode_called_for_non_c, sizeof(__pyx_k_abox_from_tcode_called_for_non_c), 0, 0, 1, 0},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_allocate_domains, __pyx_k_allocate_domains, sizeof(__pyx_k_allocate_domains), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_artio_handle, __pyx_k_artio_handle, sizeof(__pyx_k_artio_handle), 0, 0, 1, 1},
  {&__pyx_n_s_artio_is_valid, __pyx_k_artio_is_valid, sizeof(__pyx_k_artio_is_valid), 0, 0, 1, 1},
  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
  {&__pyx_kp_s_auni_from_abox_called_for_non_co, __pyx_k_auni_from_abox_called_for_non_co, sizeof(__pyx_k_auni_from_abox_called_for_non_co), 0, 0, 1, 0},
  {&__pyx_kp_s_auni_from_tcode_array_called_for, __pyx_k_auni_from_tcode_array_called_for, sizeof(__pyx_k_auni_from_tcode_array_called_for), 0, 0, 1, 0},
  {&__pyx_kp_s_auni_from_tcode_called_for_non_c, __pyx_k_auni_from_tcode_called_for_non_c, sizeof(__pyx_k_auni_from_tcode_called_for_non_c), 0, 0, 1, 0},
  {&__pyx_kp_s_auni_from_tphys_called_for_non_c, __pyx_k_auni_from_tphys_called_for_non_c, sizeof(__pyx_k_auni_from_tphys_called_for_non_c), 0, 0, 1, 0},
  {&__pyx_n_s_base_selector, __pyx_k_base_selector, sizeof(__pyx_k_base_selector), 0, 0, 1, 1},
  {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
  {&__pyx_n_s_cell_inds, __pyx_k_cell_inds, sizeof(__pyx_k_cell_inds), 0, 0, 1, 1},
  {&__pyx_n_s_co_name, __pyx_k_co_name, sizeof(__pyx_k_co_name), 0, 0, 1, 1},
  {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1},
  {&__pyx_n_s_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1},
  {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  {&__pyx_n_s_cubic, __pyx_k_cubic, sizeof(__pyx_k_cubic), 0, 0, 1, 1},
  {&__pyx_n_s_data_structures, __pyx_k_data_structures, sizeof(__pyx_k_data_structures), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
  {&__pyx_n_s_dest_fields, __pyx_k_dest_fields, sizeof(__pyx_k_dest_fields), 0, 0, 1, 1},
  {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1},
  {&__pyx_n_s_dobj, __pyx_k_dobj, sizeof(__pyx_k_dobj), 0, 0, 1, 1},
  {&__pyx_n_s_domain_counts, __pyx_k_domain_counts, sizeof(__pyx_k_domain_counts), 0, 0, 1, 1},
  {&__pyx_n_s_domain_dimensions, __pyx_k_domain_dimensions, sizeof(__pyx_k_domain_dimensions), 0, 0, 1, 1},
  {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1},
  {&__pyx_n_s_domain_left_edge, __pyx_k_domain_left_edge, sizeof(__pyx_k_domain_left_edge), 0, 0, 1, 1},
  {&__pyx_n_s_domain_right_edge, __pyx_k_domain_right_edge, sizeof(__pyx_k_domain_right_edge), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_empty_like, __pyx_k_empty_like, sizeof(__pyx_k_empty_like), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_f_code, __pyx_k_f_code, sizeof(__pyx_k_f_code), 0, 0, 1, 1},
  {&__pyx_n_s_f_lineno, __pyx_k_f_lineno, sizeof(__pyx_k_f_lineno), 0, 0, 1, 1},
  {&__pyx_kp_s_failure_with_status, __pyx_k_failure_with_status, sizeof(__pyx_k_failure_with_status), 0, 0, 1, 0},
  {&__pyx_n_s_field_indices, __pyx_k_field_indices, sizeof(__pyx_k_field_indices), 0, 0, 1, 1},
  {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
  {&__pyx_n_s_file_inds, __pyx_k_file_inds, sizeof(__pyx_k_file_inds), 0, 0, 1, 1},
  {&__pyx_n_s_file_prefix, __pyx_k_file_prefix, sizeof(__pyx_k_file_prefix), 0, 0, 1, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_kp_s_from_caller, __pyx_k_from_caller, sizeof(__pyx_k_from_caller), 0, 0, 1, 0},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_coords, __pyx_k_get_coords, sizeof(__pyx_k_get_coords), 0, 0, 1, 1},
  {&__pyx_n_s_getframe, __pyx_k_getframe, sizeof(__pyx_k_getframe), 0, 0, 1, 1},
  {&__pyx_n_s_grid_max_level, __pyx_k_grid_max_level, sizeof(__pyx_k_grid_max_level), 0, 0, 1, 1},
  {&__pyx_n_s_grid_variable_labels, __pyx_k_grid_variable_labels, sizeof(__pyx_k_grid_variable_labels), 0, 0, 1, 1},
  {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1},
  {&__pyx_n_s_hubble, __pyx_k_hubble, sizeof(__pyx_k_hubble), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_kp_s_in_function, __pyx_k_in_function, sizeof(__pyx_k_in_function), 0, 0, 1, 0},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_kp_s_invalid_field_name_provided_to_r, __pyx_k_invalid_field_name_provided_to_r, sizeof(__pyx_k_invalid_field_name_provided_to_r), 0, 0, 1, 0},
  {&__pyx_kp_s_is_not_known_to_ARTIO, __pyx_k_is_not_known_to_ARTIO, sizeof(__pyx_k_is_not_known_to_ARTIO), 0, 0, 1, 0},
  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
  {&__pyx_n_s_left_edges, __pyx_k_left_edges, sizeof(__pyx_k_left_edges), 0, 0, 1, 1},
  {&__pyx_n_s_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_max_range_size, __pyx_k_max_range_size, sizeof(__pyx_k_max_range_size), 0, 0, 1, 1},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_num_cells, __pyx_k_num_cells, sizeof(__pyx_k_num_cells), 0, 0, 1, 1},
  {&__pyx_n_s_num_grid_variables, __pyx_k_num_grid_variables, sizeof(__pyx_k_num_grid_variables), 0, 0, 1, 1},
  {&__pyx_n_s_num_particle_species, __pyx_k_num_particle_species, sizeof(__pyx_k_num_particle_species), 0, 0, 1, 1},
  {&__pyx_n_s_num_primary_variables, __pyx_k_num_primary_variables, sizeof(__pyx_k_num_primary_variables), 0, 0, 1, 1},
  {&__pyx_n_s_num_root_cells, __pyx_k_num_root_cells, sizeof(__pyx_k_num_root_cells), 0, 0, 1, 1},
  {&__pyx_n_s_num_secondary_variables, __pyx_k_num_secondary_variables, sizeof(__pyx_k_num_secondary_variables), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_oct_handler, __pyx_k_oct_handler, sizeof(__pyx_k_oct_handler), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
  {&__pyx_n_s_particle_species_mass, __pyx_k_particle_species_mass, sizeof(__pyx_k_particle_species_mass), 0, 0, 1, 1},
  {&__pyx_n_s_pdeposit, __pyx_k_pdeposit, sizeof(__pyx_k_pdeposit), 0, 0, 1, 1},
  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
  {&__pyx_n_s_positions, __pyx_k_positions, sizeof(__pyx_k_positions), 0, 0, 1, 1},
  {&__pyx_n_s_print_stack, __pyx_k_print_stack, sizeof(__pyx_k_print_stack), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_quartic, __pyx_k_quartic, sizeof(__pyx_k_quartic), 0, 0, 1, 1},
  {&__pyx_n_s_quintic, __pyx_k_quintic, sizeof(__pyx_k_quintic), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_range_handler, __pyx_k_range_handler, sizeof(__pyx_k_range_handler), 0, 0, 1, 1},
  {&__pyx_n_s_read_parameters, __pyx_k_read_parameters, sizeof(__pyx_k_read_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
  {&__pyx_n_s_right_edges, __pyx_k_right_edges, sizeof(__pyx_k_right_edges), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_n_s_selector, __pyx_k_selector, sizeof(__pyx_k_selector), 0, 0, 1, 1},
  {&__pyx_n_s_sfc_end, __pyx_k_sfc_end, sizeof(__pyx_k_sfc_end), 0, 0, 1, 1},
  {&__pyx_n_s_sfc_start, __pyx_k_sfc_start, sizeof(__pyx_k_sfc_start), 0, 0, 1, 1},
  {&__pyx_n_s_sfc_subset_selector, __pyx_k_sfc_subset_selector, sizeof(__pyx_k_sfc_subset_selector), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_kp_s_species__02d_primary_variable_la, __pyx_k_species__02d_primary_variable_la, sizeof(__pyx_k_species__02d_primary_variable_la), 0, 0, 1, 0},
  {&__pyx_kp_s_species__02u_primary_variable_la, __pyx_k_species__02u_primary_variable_la, sizeof(__pyx_k_species__02u_primary_variable_la), 0, 0, 1, 0},
  {&__pyx_kp_s_species__02u_secondary_variable, __pyx_k_species__02u_secondary_variable, sizeof(__pyx_k_species__02u_secondary_variable), 0, 0, 1, 0},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_kp_s_tcode_from_abox_called_for_non_c, __pyx_k_tcode_from_abox_called_for_non_c, sizeof(__pyx_k_tcode_from_abox_called_for_non_c), 0, 0, 1, 0},
  {&__pyx_kp_s_tcode_from_auni_called_for_non_c, __pyx_k_tcode_from_auni_called_for_non_c, sizeof(__pyx_k_tcode_from_auni_called_for_non_c), 0, 0, 1, 0},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_time_unit, __pyx_k_time_unit, sizeof(__pyx_k_time_unit), 0, 0, 1, 1},
  {&__pyx_kp_s_tphys_from_abox_called_for_non_c, __pyx_k_tphys_from_abox_called_for_non_c, sizeof(__pyx_k_tphys_from_abox_called_for_non_c), 0, 0, 1, 0},
  {&__pyx_kp_s_tphys_from_auni_called_for_non_c, __pyx_k_tphys_from_auni_called_for_non_c, sizeof(__pyx_k_tphys_from_auni_called_for_non_c), 0, 0, 1, 0},
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_yt_frontends_artio__artio_caller, __pyx_k_yt_frontends_artio__artio_caller, sizeof(__pyx_k_yt_frontends_artio__artio_caller), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "yt/frontends/artio/_artio_caller.pyx":244
 *             self.has_particles = 1
 * 
 *             for v in ["num_particle_species","num_primary_variables","num_secondary_variables"]:             # <<<<<<<<<<<<<<
 *                 if v not in self.parameters:
 *                     raise RuntimeError("Unable to locate particle header information in artio header: key=", v)
 */
  __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_num_particle_species, __pyx_n_s_num_primary_variables, __pyx_n_s_num_secondary_variables); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "yt/frontends/artio/_artio_caller.pyx":259
 *                 labels = self.parameters[species_labels]
 *                 try :
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')             # <<<<<<<<<<<<<<
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_POSITION_X); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "yt/frontends/artio/_artio_caller.pyx":260
 *                 try :
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')             # <<<<<<<<<<<<<<
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')
 *                 except ValueError :
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_POSITION_Y); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "yt/frontends/artio/_artio_caller.pyx":261
 *                     self.particle_position_index[3*ispec+0] = labels.index('POSITION_X')
 *                     self.particle_position_index[3*ispec+1] = labels.index('POSITION_Y')
 *                     self.particle_position_index[3*ispec+2] = labels.index('POSITION_Z')             # <<<<<<<<<<<<<<
 *                 except ValueError :
 *                     raise RuntimeError("Unable to locate position information for particle species", ispec)
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_POSITION_Z); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "yt/frontends/artio/_artio_caller.pyx":312
 *                 if version[0] == '3':
 *                     for i in range(0,len(parameter)):
 *                         parameter[i] = parameter[i].decode('utf-8')             # <<<<<<<<<<<<<<
 *             elif type == ARTIO_TYPE_INT :
 *                 int_values = <int32_t *>malloc(length*sizeof(int32_t))
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "yt/frontends/artio/_artio_caller.pyx":334
 *                 free(double_values)
 *             else :
 *                 raise RuntimeError("ARTIO file corruption detected: invalid type!")             # <<<<<<<<<<<<<<
 * 
 *             if version[0] == '3':
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_ARTIO_file_corruption_detected_i); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "yt/frontends/artio/_artio_caller.pyx":345
 *             return abox_from_auni(self.cosmology, a)
 *         else:
 *             raise RuntimeError("abox_from_auni called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tcode_from_auni(self, np.float64_t a):
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_abox_from_auni_called_for_non_co); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "yt/frontends/artio/_artio_caller.pyx":351
 *             return tcode_from_auni(self.cosmology, a)
 *         else:
 *             raise RuntimeError("tcode_from_auni called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tphys_from_auni(self, np.float64_t a):
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_tcode_from_auni_called_for_non_c); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "yt/frontends/artio/_artio_caller.pyx":357
 *             return tphys_from_auni(self.cosmology, a)
 *         else:
 *             raise RuntimeError("tphys_from_auni called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def auni_from_abox(self, np.float64_t v):
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_tphys_from_auni_called_for_non_c); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "yt/frontends/artio/_artio_caller.pyx":363
 *             return auni_from_abox(self.cosmology, v)
 *         else:
 *             raise RuntimeError("auni_from_abox called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def auni_from_tcode(self, np.float64_t v):
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_auni_from_abox_called_for_non_co); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "yt/frontends/artio/_artio_caller.pyx":369
 *             return auni_from_tcode(self.cosmology, v)
 *         else:
 *             raise RuntimeError("auni_from_tcode called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     @cython.wraparound(False)
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_auni_from_tcode_called_for_non_c); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "yt/frontends/artio/_artio_caller.pyx":378
 *         cdef CosmologyParameters *cosmology = self.cosmology
 *         if not cosmology:
 *             raise RuntimeError("auni_from_tcode_array called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 *         auni = np.empty_like(tcode)
 *         nauni = auni.shape[0]
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_auni_from_tcode_array_called_for); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "yt/frontends/artio/_artio_caller.pyx":390
 *             return auni_from_tphys(self.cosmology, v)
 *         else:
 *             raise RuntimeError("auni_from_tphys called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def abox_from_tcode(self, np.float64_t abox):
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_auni_from_tphys_called_for_non_c); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "yt/frontends/artio/_artio_caller.pyx":396
 *             return abox_from_tcode(self.cosmology, abox)
 *         else:
 *             raise RuntimeError("abox_from_tcode called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tcode_from_abox(self, np.float64_t abox):
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_abox_from_tcode_called_for_non_c); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "yt/frontends/artio/_artio_caller.pyx":402
 *             return tcode_from_abox(self.cosmology, abox)
 *         else:
 *             raise RuntimeError("tcode_from_abox called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tphys_from_abox(self, np.float64_t abox):
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_tcode_from_abox_called_for_non_c); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "yt/frontends/artio/_artio_caller.pyx":408
 *             return tphys_from_abox(self.cosmology, abox)
 *         else:
 *             raise RuntimeError("tphys_from_abox called for non-cosmological ARTIO fileset!")             # <<<<<<<<<<<<<<
 * 
 *     def tphys_from_tcode(self, np.float64_t tcode):
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_tphys_from_abox_called_for_non_c); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "yt/frontends/artio/_artio_caller.pyx":461
 *         for species,field in fields :
 *             if species < 0 or species > self.num_species :
 *                 raise RuntimeError("Invalid species provided to read_particle_chunk")             # <<<<<<<<<<<<<<
 *             accessed_species[species] = 1
 * 
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Invalid_species_provided_to_read); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "yt/frontends/artio/_artio_caller.pyx":467
 *                     field in self.parameters["species_%02u_primary_variable_labels"%(species,)] :
 *                 selected_primary[species].append((self.parameters["species_%02u_primary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")             # <<<<<<<<<<<<<<
 *             elif self.parameters["num_secondary_variables"][species] > 0 and \
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "yt/frontends/artio/_artio_caller.pyx":471
 *                     field in self.parameters["species_%02u_secondary_variable_labels"%(species,)] :
 *                 selected_secondary[species].append((self.parameters["species_%02u_secondary_variable_labels"%(species,)].index(field),(species,field)))
 *                 data[(species,field)] = np.empty(0,dtype="float64")             # <<<<<<<<<<<<<<
 *             elif field == "MASS" :
 *                 selected_mass[species] = (species,field)
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "yt/frontends/artio/_artio_caller.pyx":474
 *             elif field == "MASS" :
 *                 selected_mass[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="float64")             # <<<<<<<<<<<<<<
 *             elif field == "PID" :
 *                 selected_pid[species] = (species,field)
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "yt/frontends/artio/_artio_caller.pyx":477
 *             elif field == "PID" :
 *                 selected_pid[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int64")             # <<<<<<<<<<<<<<
 *             elif field == "SPECIES" :
 *                 selected_species[species] = (species,field)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "yt/frontends/artio/_artio_caller.pyx":480
 *             elif field == "SPECIES" :
 *                 selected_species[species] = (species,field)
 *                 data[(species,field)] = np.empty(0,dtype="int8")             # <<<<<<<<<<<<<<
 *             else :
 *                 raise RuntimeError("invalid field name provided to read_particle_chunk")
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "yt/frontends/artio/_artio_caller.pyx":482
 *                 data[(species,field)] = np.empty(0,dtype="int8")
 *             else :
 *                 raise RuntimeError("invalid field name provided to read_particle_chunk")             # <<<<<<<<<<<<<<
 * 
 *         # cache the range
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_invalid_field_name_provided_to_r); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "yt/frontends/artio/_artio_caller.pyx":579
 *         #fcoords = np.empty((max_cells, 3), dtype="float64")
 *         #ires = np.empty(max_cells, dtype="int64")
 *         fcoords = np.empty((0, 3), dtype="float64")             # <<<<<<<<<<<<<<
 *         ires = np.empty(0, dtype="int64")
 * 
 */
  __pyx_tuple__24 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_3); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_tuple__24); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "yt/frontends/artio/_artio_caller.pyx":580
 *         #ires = np.empty(max_cells, dtype="int64")
 *         fcoords = np.empty((0, 3), dtype="float64")
 *         ires = np.empty(0, dtype="int64")             # <<<<<<<<<<<<<<
 * 
 *         #data = [ np.empty(max_cells, dtype="float32") for i in range(num_fields) ]
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "yt/frontends/artio/_artio_caller.pyx":583
 * 
 *         #data = [ np.empty(max_cells, dtype="float32") for i in range(num_fields) ]
 *         data = [ np.empty(0,dtype="float64") for i in range(num_fields)]             # <<<<<<<<<<<<<<
 * 
 *         count = 0
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "yt/frontends/artio/_artio_caller.pyx":613
 *                     check_artio_status(status)
 * 
 *                     for child in range(8) :             # <<<<<<<<<<<<<<
 *                         if not refined[child] :
 *                             for i in range(3) :
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "yt/frontends/artio/_artio_caller.pyx":973
 *             status = artio_grid_read_level_end(handle)
 *             check_artio_status(status)
 *             nadded = self.add(self.num_domains, level, pos[:num_octs_per_level[level],:])             # <<<<<<<<<<<<<<
 *             if nadded != num_octs_per_level[level]:
 *                 raise RuntimeError
 */
  __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__29);
  __Pyx_GIVEREF(__pyx_slice__29);

  /* "yt/frontends/artio/_artio_caller.pyx":1116
 * 
 *     if not artio_handle.has_particles:
 *         raise RuntimeError("Attempted to read non-existent particles in ARTIO")             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_read_non_existent_p); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "yt/frontends/artio/_artio_caller.pyx":1403
 *         width = np.zeros((num_cells, 3), dtype="float64")
 *         for i in range(3):
 *             width[:,i] = self.dds[i]             # <<<<<<<<<<<<<<
 *         return width
 * 
 */
  __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__31);
  __Pyx_GIVEREF(__pyx_slice__31);

  /* "yt/frontends/artio/_artio_caller.pyx":1488
 *             mask[sfci] = 1
 *             self._last_mask_sum += 1
 *         self._last_mask = mask.astype("bool")             # <<<<<<<<<<<<<<
 *         self._last_selector_id = hash(selector)
 *         return self._last_mask
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_bool); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "yt/geometry/selection_routines.pxd":31
 *         if "code_length" == str(arr.units):
 *             return arr
 *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_code_length); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "../../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "yt/frontends/artio/_artio_caller.pyx":696
 * 
 * ###################################################
 * def artio_is_valid( char *file_prefix ) :             # <<<<<<<<<<<<<<
 *     cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix,
 *             ARTIO_OPEN_HEADER, artio_context_global )
 */
  __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_file_prefix, __pyx_n_s_file_prefix, __pyx_n_s_handle); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_artio_is_valid, 696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "yt/frontends/artio/_artio_caller.pyx":866
 *         self.oct_count = None
 * 
 * def get_coords(artio_fileset handle, np.int64_t s):             # <<<<<<<<<<<<<<
 *     cdef int coords[3]
 *     artio_sfc_coords(handle.handle, s, coords)
 */
  __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_handle, __pyx_n_s_s, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_goldbaum_Documents_yt_hg, __pyx_n_s_get_coords, 866, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__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;}
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__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;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_artio_caller(void); /*proto*/
PyMODINIT_FUNC init_artio_caller(void)
#else
PyMODINIT_FUNC PyInit__artio_caller(void); /*proto*/
PyMODINIT_FUNC PyInit__artio_caller(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__artio_caller(void)", 0);
  if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_artio_caller", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_yt__frontends__artio___artio_caller) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "yt.frontends.artio._artio_caller")) {
      if (unlikely(PyDict_SetItemString(modules, "yt.frontends.artio._artio_caller", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "artio_fileset", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_artio_fileset = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_artio_fileset;
  if (PyType_Ready(&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "ARTIOSFCRangeHandler", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOSFCRangeHandler;
  __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer = &__pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer.__pyx_base = *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer.initialize_local_mesh = (void (*)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer *, __pyx_t_5numpy_int64_t, int, int *, __pyx_t_5numpy_int64_t))__pyx_f_2yt_9frontends_5artio_13_artio_caller_20ARTIOOctreeContainer_initialize_local_mesh;
  __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer;
  if (PyType_Ready(&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer.tp_dict, __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "ARTIOOctreeContainer", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIOOctreeContainer;
  __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer = &__pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.pos_to_sfc = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_pos_to_sfc;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.sfc_to_pos = (void (*)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_sfc_to_pos;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.count_cells = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *))__pyx_f_2yt_9frontends_5artio_13_artio_caller_22ARTIORootMeshContainer_count_cells;
  if (PyType_Ready(&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer.tp_dict, __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "ARTIORootMeshContainer", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_ARTIORootMeshContainer;
  __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType("yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector = &__pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.__pyx_base = *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.__pyx_base.select_grid = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args))__pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_grid;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.__pyx_base.select_cell = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_cell;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.__pyx_base.select_point = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_point;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.__pyx_base.select_sphere = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t))__pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_sphere;
  __pyx_vtable_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.__pyx_base.select_bbox = (int (*)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9frontends_5artio_13_artio_caller_16SFCRangeSelector_select_bbox;
  __pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.tp_base = __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject;
  if (PyType_Ready(&__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector.tp_dict, __pyx_vtabptr_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "SFCRangeSelector", (PyObject *)&__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector = &__pyx_type_2yt_9frontends_5artio_13_artio_caller_SFCRangeSelector;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType("yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType("yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType("yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation = __Pyx_ImportType("yt.geometry.particle_deposit", "ParticleDepositOperation", sizeof(struct __pyx_obj_2yt_8geometry_16particle_deposit_ParticleDepositOperation), 1); if (unlikely(!__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation = (struct __pyx_vtabstruct_2yt_8geometry_16particle_deposit_ParticleDepositOperation*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_16particle_deposit_ParticleDepositOperation->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_16particle_deposit_ParticleDepositOperation)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Function import code ---*/
  __pyx_t_2 = __Pyx_ImportModule("yt.geometry.oct_visitors"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "fill_file_indices_oind", (void (**)(void))&__pyx_f_2yt_8geometry_12oct_visitors_fill_file_indices_oind, "void (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "fill_file_indices_rind", (void (**)(void))&__pyx_f_2yt_8geometry_12oct_visitors_fill_file_indices_rind, "void (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_3, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "yt/frontends/artio/_artio_caller.pyx":2
 * cimport cython
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * import sys
 */
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":4
 * import numpy as np
 * cimport numpy as np
 * import sys             # <<<<<<<<<<<<<<
 * 
 * from yt.geometry.selection_routines cimport \
 */
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":19
 * from libc.stdlib cimport malloc, free
 * from libc.string cimport memcpy
 * import data_structures             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "platform_dep.h":
 */
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_data_structures, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_data_structures, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":696
 * 
 * ###################################################
 * def artio_is_valid( char *file_prefix ) :             # <<<<<<<<<<<<<<
 *     cdef artio_fileset_handle *handle = artio_fileset_open( file_prefix,
 *             ARTIO_OPEN_HEADER, artio_context_global )
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_5artio_13_artio_caller_1artio_is_valid, NULL, __pyx_n_s_yt_frontends_artio__artio_caller); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_artio_is_valid, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":866
 *         self.oct_count = None
 * 
 * def get_coords(artio_fileset handle, np.int64_t s):             # <<<<<<<<<<<<<<
 *     cdef int coords[3]
 *     artio_sfc_coords(handle.handle, s, coords)
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_5artio_13_artio_caller_3get_coords, NULL, __pyx_n_s_yt_frontends_artio__artio_caller); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_coords, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/frontends/artio/_artio_caller.pyx":1673
 *         return (hash(self.base_selector), self.sfc_start, self.sfc_end)
 * 
 * sfc_subset_selector = AlwaysSelector             # <<<<<<<<<<<<<<
 * #sfc_subset_selector = SFCRangeSelector
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sfc_subset_selector, ((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "yt/frontends/artio/_artio_caller.pyx":1
 * cimport cython             # <<<<<<<<<<<<<<
 * import numpy as np
 * cimport numpy as np
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "yt/utilities/lib/fp_utils.pxd":57
 *     return i1
 * 
 * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):             # <<<<<<<<<<<<<<
 *     if i0 < i1: return i0
 *     return i1
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init yt.frontends.artio._artio_caller", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init yt.frontends.artio._artio_caller");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#endif
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        length = strlen(cstring);
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_dealloc != current_tp_dealloc)
        type = type->tp_base;
    while (type && type->tp_dealloc == current_tp_dealloc)
        type = type->tp_base;
    if (type)
        type->tp_dealloc(obj);
}

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif


            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int64_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) -(((((int64_t)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) -(((((((int64_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) -(((((((((int64_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
            } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int64_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int64_t) -1;
        }
    } else {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyInt_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -1;
}

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) -(((((int)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) -(((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) -(((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
    const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_int64) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (npy_int64) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_int64) 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
                case 2:
                    if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
                            return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
                            return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
                            return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (npy_int64) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(npy_int64) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_int64) 0;
                case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
                            return (npy_int64) -(((((npy_int64)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
                            return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
                            return (npy_int64) -(((((((npy_int64)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
                            return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
                            return (npy_int64) -(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
                            return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(npy_int64) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
            } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_int64 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (npy_int64) -1;
        }
    } else {
        npy_int64 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_int64) -1;
        val = __Pyx_PyInt_As_npy_int64(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int64");
    return (npy_int64) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int64");
    return (npy_int64) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) -(((((size_t)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) -(((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) -(((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
    const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int64) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(npy_int64) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) -(((((long)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) -(((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) -(((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
    const npy_uint64 neg_one = (npy_uint64) -1, const_zero = (npy_uint64) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_uint64) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(npy_uint64) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

#ifndef __PYX_HAVE_RT_ImportVoidPtr
#define __PYX_HAVE_RT_ImportVoidPtr
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, name);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C variable %.200s",
                PyModule_GetName(module), name);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), name, sig, desc);
        goto bad;
    }
    *p = PyCObject_AsVoidPtr(cobj);}
#endif
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
