/* Generated by Cython 0.12.1 on Fri Apr  1 21:17:07 2011 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyString_Type                PyUnicode_Type
  #define PyString_CheckExact          PyUnicode_CheckExact
#else
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_CheckExact           PyString_CheckExact
#endif

#if PY_MAJOR_VERSION >= 3
  #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 __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

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#else
  #define _USE_MATH_DEFINES
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#define __PYX_HAVE_API__epr
#include "string.h"
#include "epr_api.h"
#include "stdlib.h"
#include "stdio.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #else
    #define CYTHON_INLINE 
  #endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_FromString          PyString_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyString_AsString
#else
#define __Pyx_PyBytes_FromString          PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyBytes_AsString
#endif

#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

#if !defined(T_PYSSIZET)
#if PY_VERSION_HEX < 0x02050000
#define T_PYSSIZET T_INT
#elif !defined(T_LONGLONG)
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
#else
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
#endif
#endif


#if !defined(T_ULONGLONG)
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
#else
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
#endif
#if !defined(T_LONGLONG)
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
#else
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
#endif

#define __Pyx_T_FLOATING(x) \
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))

#if !defined(T_SIZET)
#if !defined(T_ULONGLONG)
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
#else
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
#endif
#endif

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
#define likely(x)   __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
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;
static const char **__pyx_f;


#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

typedef npy_int8 __pyx_t_5numpy_int8_t;

typedef npy_int16 __pyx_t_5numpy_int16_t;

typedef npy_int32 __pyx_t_5numpy_int32_t;

typedef npy_int64 __pyx_t_5numpy_int64_t;

typedef npy_uint8 __pyx_t_5numpy_uint8_t;

typedef npy_uint16 __pyx_t_5numpy_uint16_t;

typedef npy_uint32 __pyx_t_5numpy_uint32_t;

typedef npy_uint64 __pyx_t_5numpy_uint64_t;

typedef npy_float32 __pyx_t_5numpy_float32_t;

typedef npy_float64 __pyx_t_5numpy_float64_t;

typedef npy_long __pyx_t_5numpy_int_t;

typedef npy_longlong __pyx_t_5numpy_long_t;

typedef npy_intp __pyx_t_5numpy_intp_t;

typedef npy_uintp __pyx_t_5numpy_uintp_t;

typedef npy_ulong __pyx_t_5numpy_uint_t;

typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

typedef npy_double __pyx_t_5numpy_float_t;

typedef npy_double __pyx_t_5numpy_double_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 */

typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

typedef npy_cdouble __pyx_t_5numpy_complex_t;

/* "/home/antonio/projects/pyepr/src/epr.pyx":460
 *     return 0
 * 
 * cdef int pyepr_null_ptr_error(msg='null pointer') except -1:             # <<<<<<<<<<<<<<
 *     cdef int code
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()
 */

struct __pyx_opt_args_3epr_pyepr_null_ptr_error {
  int __pyx_n;
  PyObject *msg;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":653
 * 
 * 
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

struct __pyx_opt_args_3epr_new_dsd {
  int __pyx_n;
  PyObject *parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":992
 * 
 * 
 * cdef new_field(EPR_SField* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

struct __pyx_opt_args_3epr_new_field {
  int __pyx_n;
  PyObject *parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1177
 * 
 * 
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

struct __pyx_opt_args_3epr_new_record {
  int __pyx_n;
  PyObject *parent;
  int dealloc;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1336
 * 
 * 
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

struct __pyx_opt_args_3epr_new_raster {
  int __pyx_n;
  PyObject *parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1666
 *         return new_raster(raster_ptr, self)
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):             # <<<<<<<<<<<<<<
 *         '''Reads (geo-)physical values of the band of the specified
 *         source-region
 */

struct __pyx_opt_args_3epr_4Band_read_raster {
  int __pyx_n;
  int xoffset;
  int yoffset;
  struct __pyx_obj_3epr_Raster *raster;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1778
 * 
 * 
 * cdef new_band(EPR_SBandId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

struct __pyx_opt_args_3epr_new_band {
  int __pyx_n;
  PyObject *parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1932
 * 
 * 
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

struct __pyx_opt_args_3epr_new_dataset {
  int __pyx_n;
  PyObject *parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":498
 * 
 * 
 * cdef class EprObject:             # <<<<<<<<<<<<<<
 *     cdef object epr_c_lib
 *     def __cinit__(self, *ars, **kargs):
 */

struct __pyx_obj_3epr_EprObject {
  PyObject_HEAD
  PyObject *epr_c_lib;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1790
 * 
 * 
 * cdef class Dataset(EprObject):             # <<<<<<<<<<<<<<
 *     '''ENVISAT dataset
 * 
 */

struct __pyx_obj_3epr_Dataset {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SDatasetId *_ptr;
  PyObject *_parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":473
 * 
 * 
 * cdef class CLib:             # <<<<<<<<<<<<<<
 *     '''Library object to handle C API initialization/finalization'''
 * 
 */

struct __pyx_obj_3epr_CLib {
  PyObject_HEAD
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1004
 * 
 * 
 * cdef class Record(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a record read from an ENVISAT dataset
 * 
 */

struct __pyx_obj_3epr_Record {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SRecord *_ptr;
  PyObject *_parent;
  int _dealloc;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1944
 * 
 * 
 * cdef class Product(EprObject):             # <<<<<<<<<<<<<<
 *     '''ENVISAT product
 * 
 */

struct __pyx_obj_3epr_Product {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SProductId *_ptr;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1190
 * 
 * 
 * cdef class Raster(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a raster in which data will be stored
 * 
 */

struct __pyx_obj_3epr_Raster {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  struct __pyx_vtabstruct_3epr_Raster *__pyx_vtab;
  EPR_SRaster *_ptr;
  PyObject *_parent;
  PyObject *_data;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":553
 * 
 * 
 * cdef class DSD(EprObject):             # <<<<<<<<<<<<<<
 *     '''Dataset descriptor
 * 
 */

struct __pyx_obj_3epr_DSD {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SDSD *_ptr;
  PyObject *_parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":665
 * 
 * 
 * cdef class Field(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a field within a record
 * 
 */

struct __pyx_obj_3epr_Field {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  EPR_SField *_ptr;
  PyObject *_parent;
};

/* "/home/antonio/projects/pyepr/src/epr.pyx":1428
 * 
 * 
 * cdef class Band(EprObject):             # <<<<<<<<<<<<<<
 *     '''The band of an ENVISAT product
 * 
 */

struct __pyx_obj_3epr_Band {
  struct __pyx_obj_3epr_EprObject __pyx_base;
  struct __pyx_vtabstruct_3epr_Band *__pyx_vtab;
  EPR_SBandId *_ptr;
  PyObject *_parent;
};


/* "/home/antonio/projects/pyepr/src/epr.pyx":1190
 * 
 * 
 * cdef class Raster(EprObject):             # <<<<<<<<<<<<<<
 *     '''Represents a raster in which data will be stored
 * 
 */

struct __pyx_vtabstruct_3epr_Raster {
  PyArrayObject *(*toarray)(struct __pyx_obj_3epr_Raster *);
};
static struct __pyx_vtabstruct_3epr_Raster *__pyx_vtabptr_3epr_Raster;


/* "/home/antonio/projects/pyepr/src/epr.pyx":1428
 * 
 * 
 * cdef class Band(EprObject):             # <<<<<<<<<<<<<<
 *     '''The band of an ENVISAT product
 * 
 */

struct __pyx_vtabstruct_3epr_Band {
  PyObject *(*read_raster)(struct __pyx_obj_3epr_Band *, int __pyx_skip_dispatch, struct __pyx_opt_args_3epr_4Band_read_raster *__pyx_optional_args);
};
static struct __pyx_vtabstruct_3epr_Band *__pyx_vtabptr_3epr_Band;

#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) {
    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;
  }
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #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_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
  #define __Pyx_RefNannySetupContext(name)
  #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_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)

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

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); /*proto*/

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

static PyObject* __Pyx_PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*); /*proto*/

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
    const char* function_name, int kw_allowed); /*proto*/

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

static CYTHON_INLINE PyObject* __Pyx_tp_new(PyObject* type_obj) {
    return (PyObject*) (((PyTypeObject*)(type_obj))->tp_new(
        (PyTypeObject*)(type_obj), __pyx_empty_tuple, NULL));
}

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

#define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))

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 fits_long) {
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        Py_INCREF(v);
        Py_DECREF(PyList_GET_ITEM(o, i));
        PyList_SET_ITEM(o, i, v);
        return 1;
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
        return PySequence_SetItem(o, i, v);
    else {
        PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i);
        return __Pyx_SetItemInt_Generic(o, j, v);
    }
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);

static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (PyList_Append(L, x) < 0) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    }
    else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/

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

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

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/

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

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

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint(uint);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uchar(uchar);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ushort(ushort);

#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(__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))
    /*#define __Pyx_c_absf(z)     (::std::abs(z))*/
  #else
    #define __Pyx_c_is_zerof(z) ((z)==0)
    #define __Pyx_c_conjf(z)    (conjf(z))
    /*#define __Pyx_c_absf(z)     (cabsf(z))*/
 #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);
    /*static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/
#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))
    /*#define __Pyx_c_abs(z)     (::std::abs(z))*/
  #else
    #define __Pyx_c_is_zero(z) ((z)==0)
    #define __Pyx_c_conj(z)    (conj(z))
    /*#define __Pyx_c_abs(z)     (cabs(z))*/
 #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);
    /*static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name); /*proto*/

static CYTHON_INLINE uint __Pyx_PyInt_from_py_uint(PyObject *);

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

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from python_buffer */

/* Module declarations from python_ref */

/* Module declarations from stdlib */

/* Module declarations from stdio */

/* 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 PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/
/* Module declarations from epr */

static PyTypeObject *__pyx_ptype_3epr_CLib = 0;
static PyTypeObject *__pyx_ptype_3epr_EprObject = 0;
static PyTypeObject *__pyx_ptype_3epr_DSD = 0;
static PyTypeObject *__pyx_ptype_3epr_Field = 0;
static PyTypeObject *__pyx_ptype_3epr_Record = 0;
static PyTypeObject *__pyx_ptype_3epr_Raster = 0;
static PyTypeObject *__pyx_ptype_3epr_Band = 0;
static PyTypeObject *__pyx_ptype_3epr_Dataset = 0;
static PyTypeObject *__pyx_ptype_3epr_Product = 0;
static struct __pyx_obj_3epr_CLib *__pyx_v_3epr__EPR_C_LIB = 0;
static enum NPY_TYPES __pyx_f_3epr__epr_to_numpy_type_id(enum EPR_DataTypeId); /*proto*/
static int __pyx_f_3epr_pyepr_check_errors(void); /*proto*/
static int __pyx_f_3epr_pyepr_null_ptr_error(struct __pyx_opt_args_3epr_pyepr_null_ptr_error *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_dsd(EPR_SDSD *, struct __pyx_opt_args_3epr_new_dsd *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_field(EPR_SField *, struct __pyx_opt_args_3epr_new_field *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_record(EPR_SRecord *, struct __pyx_opt_args_3epr_new_record *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_raster(EPR_SRaster *, struct __pyx_opt_args_3epr_new_raster *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_band(EPR_SBandId *, struct __pyx_opt_args_3epr_new_band *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3epr_new_dataset(EPR_SDatasetId *, struct __pyx_opt_args_3epr_new_dataset *__pyx_optional_args); /*proto*/
#define __Pyx_MODULE_NAME "epr"
int __pyx_module_is_main_epr = 0;

/* Implementation of epr */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_repr;
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k_1[] = "";
static char __pyx_k_2[] = "null pointer";
static char __pyx_k_3[] = "%s: %s";
static char __pyx_k_4[] = "unable to inizialize EPR API library: %s";
static char __pyx_k_5[] = "\"%s\" class cannot be instantiated from Python";
static char __pyx_k_6[] = "invalid scaling method: \"%s\"";
static char __pyx_k_7[] = "invalid sample model: \"%s\"";
static char __pyx_k_8[] = "epr.DSD(\"%s\")";
static char __pyx_k_9[] = "invalid ostream";
static char __pyx_k_10[] = "invalid index: %d";
static char __pyx_k_11[] = "invalid field type";
static char __pyx_k_12[] = "epr.Field(\"%s\") %d %s elements";
static char __pyx_k_13[] = "%s = \"%s\"";
static char __pyx_k_14[] = "%s = {d=%d, j=%d, m=%d}";
static char __pyx_k_15[] = "%u";
static char __pyx_k_16[] = "%d";
static char __pyx_k_17[] = "%f";
static char __pyx_k_18[] = "<<unknown data type>>";
static char __pyx_k_19[] = ", ";
static char __pyx_k_20[] = "%s = {%s}";
static char __pyx_k_21[] = "%s = <<unknown data type>>";
static char __pyx_k_22[] = "%s = %s";
static char __pyx_k_23[] = "unable to get field \"%s\"";
static char __pyx_k_24[] = "unable to get field at index %d";
static char __pyx_k_25[] = "\n";
static char __pyx_k_26[] = "%s %d fields";
static char __pyx_k_27[] = "index out of range: x=%d, y=%d";
static char __pyx_k_28[] = "invalid data type: \"%s\"";
static char __pyx_k_29[] = "invalid data type";
static char __pyx_k_30[] = "%s %s (%dL x %dP)";
static char __pyx_k_31[] = "invalid step: xspet=%d, ystep=%d";
static char __pyx_k_32[] = "unable to create a new raster";
static char __pyx_k_33[] = "unable to create compatible raster with width=%d, height=%d xstep=%d, ystep=%d";
static char __pyx_k_34[] = "create_compatible_raster";
static char __pyx_k_35[] = "xoffset os larger that he scene width";
static char __pyx_k_36[] = "yoffset os larger that he scene height";
static char __pyx_k_37[] = "epr.Band(%s) of %s";
static char __pyx_k_38[] = "unable to read record at index %d";
static char __pyx_k_39[] = "epr.Dataset(%s) %d records";
static char __pyx_k_40[] = "unable to open %s";
static char __pyx_k_41[] = "unable to get dataset at index %d";
static char __pyx_k_42[] = "unable to get dataset \"%s\"";
static char __pyx_k_43[] = "unable to get DSD at index \"%d\"";
static char __pyx_k_44[] = "unable to get MPH record";
static char __pyx_k_45[] = "unable to get SPH record";
static char __pyx_k_46[] = "unable to get band \"%s\"";
static char __pyx_k_47[] = "unable to get band at index \"%d\"";
static char __pyx_k_48[] = "epr.Product(%s) %d datasets, %d bands";
static char __pyx_k_49[] = "ndarray is not C contiguous";
static char __pyx_k_50[] = "ndarray is not Fortran contiguous";
static char __pyx_k_51[] = "Non-native byte order not supported";
static char __pyx_k_52[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_53[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_54[] = "Format string allocated too short.";
static char __pyx_k_55[] = "The index of this DSD (zero-based)";
static char __pyx_k_56[] = "The dataset name";
static char __pyx_k_57[] = "The dataset type descriptor";
static char __pyx_k_58[] = "The filename in the DDDB with the description of this dataset";
static char __pyx_k_59[] = "The offset of dataset-information the product file";
static char __pyx_k_60[] = "The size of dataset-information in dataset product file";
static char __pyx_k_61[] = "The number of dataset records for the given dataset name";
static char __pyx_k_62[] = "The size of dataset record for the given dataset name";
static char __pyx_k_63[] = "The data type of the band's pixels\n\n        All ``E_TID_*`` types are possible\n\n        ";
static char __pyx_k_64[] = "The width of the source";
static char __pyx_k_65[] = "The height of the source";
static char __pyx_k_66[] = "The sub-sampling for the across-track direction in pixel";
static char __pyx_k_67[] = "The sub-sampling for the along-track direction in pixel";
static char __pyx_k_68[] = "Raster data exposed as :class:`numpy.ndarray` object\n\n        .. note:: this property shares the data buffer with the\n                  :class:`Raster` object so any change in its contents\n                  is also reflected to the :class:`Raster` object\n\n        ";
static char __pyx_k_69[] = "The :class:`Product` instance to which this band belongs to";
static char __pyx_k_70[] = "The (zero-based) spectral band index\n\n        -1 if this is not a spectral band\n\n        ";
static char __pyx_k_71[] = "The sample model operation\n\n        The sample model operation applied to the source dataset for\n        getting the correct samples from the MDS (for example MERIS L2).\n\n        Possible values are:\n\n        * ``*``     --> no operation (direct copy)\n        * ``1OF2``  --> first byte of 2-byte interleaved MDS\n        * ``2OF2``  --> second byte of 2-byte interleaved MDS\n        * ``0123``  --> combine 3-bytes interleaved to 4-byte integer\n\n        ";
static char __pyx_k_72[] = "The data type of the band's pixels\n\n        Possible values are:\n\n        * ``*``         --> the datatype remains unchanged.\n        * ``uint8_t``   --> 8-bit unsigned integer\n        * ``uint32_t``  --> 32-bit unsigned integer\n        * ``Float``     --> 32-bit IEEE floating point\n\n        ";
static char __pyx_k_73[] = "Scaling method\n\n        The scaling method which must be applied to the raw source data\n        in order to get the 'real' pixel values in geo-physical units.\n\n        Possible values are:\n\n        * ``*``            --> no scaling applied\n        * ``Linear_Scale`` --> linear scaling applied::\n\n            y = offset + scale * x\n\n        * ``Log_Scale``    --> logarithmic scaling applied::\n\n            y = log10(offset + scale * x)\n\n        ";
static char __pyx_k_74[] = "The scaling offset\n\n        Possible values are:\n\n        * ``*`` --> no offset provided (implies scaling_method=*)\n        * ``const`` --> a floating point constant\n        * ``GADS.field[.field2]` --> value is provided in global\n          annotation dataset with name ``GADS`` in field ``field``.\n          Optionally a second element index for multiple-element fields\n          can be given too\n\n        ";
static char __pyx_k_75[] = "The scaling factor\n\n        Possible values are:\n\n        * ``*`` --> no factor provided (implies scaling_method=*)\n        * ``const`` --> a floating point constant\n        * ``GADS.field[.field2]`` --> value is provided in global\n          annotation dataset with name `GADS` in field `field``.\n          Optionally a second element index for multiple-element fields\n          can be given too\n\n        ";
static char __pyx_k_76[] = "A bit-mask expression used to filter valid pixels\n\n        All others are set to zero\n\n        ";
static char __pyx_k_77[] = "The geophysical unit for the band's pixel values";
static char __pyx_k_78[] = "A short description of the band's contents";
static char __pyx_k_79[] = "Mirrored lines flag\n\n        If true (=1) lines will be mirrored (flipped) after read into a\n        raster in order to ensure a pixel ordering in raster X direction\n        from WEST to EAST.\n\n        ";
static char __pyx_k_80[] = "The :class:`Product` instance to which this dataset belongs to";
static char __pyx_k_81[] = "The file's path including the file name";
static char __pyx_k_82[] = "The total size in bytes of the product file";
static char __pyx_k_83[] = "The product identifier string obtained from the MPH parameter\n        'PRODUCT'\n\n        The first 10 characters of this string identify the product type,\n        e.g. \"MER_1P__FR\" for a MERIS Level 1b full resolution product.\n        The rest of the string decodes product instance properties.\n\n        ";
static char __pyx_k_84[] = "For MERIS L1b and RR and FR to provide backward compatibility";
static char __pyx_k_85[] = "Python bindings for ENVISAT Product Reader C API\n\nPyEPR_ provides Python_ bindings for the ENVISAT Product Reader C API\n(`EPR API`_) for reading satellite data from ENVISAT_ ESA_ (European\nSpace Agency) mission.\n\nPyEPR_ is fully object oriented and, as well as the `EPR API`_ for C,\nsupports ENVISAT_ MERIS, AATSR Level 1B and Level 2 and also ASAR data\nproducts. It provides access to the data either on a geophysical\n(decoded, ready-to-use pixel samples) or on a raw data layer.\nThe raw data access makes it possible to read any data field contained\nin a product file.\n\n.. _PyEPR: http://avalentino.github.com/pyepr\n.. _Python: http://www.python.org\n.. _`EPR API`: https://github.com/bcdev/epr-api\n.. _ENVISAT: http://envisat.esa.int\n.. _ESA: http://earth.esa.int\n\n";
static char __pyx_k_86[] = "$Id: e4dc1f8c3a4e817448126dc5e2846c90517e728a $";
static char __pyx_k_87[] = "0.3";
static char __pyx_k_88[] = "EPR API error";
static char __pyx_k_89[] = "get_data_type_size (line 511)";
static char __pyx_k_90[] = "data_type_id_to_str (line 516)";
static char __pyx_k_91[] = "get_scaling_method_name (line 521)";
static char __pyx_k_92[] = "get_scaling_method_name";
static char __pyx_k_93[] = "get_sample_model_name (line 536)";
static char __pyx_k_94[] = "get_sample_model_name";
static char __pyx_k_95[] = "Field.print_ (line 678)";
static char __pyx_k_96[] = "Field.get_unit (line 712)";
static char __pyx_k_97[] = "Field.get_description (line 717)";
static char __pyx_k_98[] = "Field.get_num_elems (line 722)";
static char __pyx_k_99[] = "Field.get_name (line 727)";
static char __pyx_k__B[] = "B";
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__x[] = "x";
static char __pyx_k__y[] = "y";
static char __pyx_k_100[] = "Field.get_type (line 732)";
static char __pyx_k_101[] = "Field.get_elem (line 737)";
static char __pyx_k_102[] = "Field.get_elems (line 788)";
static char __pyx_k_103[] = "Record.get_num_fields (line 1025)";
static char __pyx_k_104[] = "Record.print_ (line 1030)";
static char __pyx_k_105[] = "Record.print_element (line 1061)";
static char __pyx_k_106[] = "Record.get_field (line 1096)";
static char __pyx_k_107[] = "Record.get_field_at (line 1117)";
static char __pyx_k_108[] = "Record.get_field_names (line 1136)";
static char __pyx_k_109[] = "Record.fields (line 1154)";
static char __pyx_k_110[] = "Raster.get_width (line 1239)";
static char __pyx_k_111[] = "Raster.get_height (line 1244)";
static char __pyx_k_112[] = "Raster.get_elem_size (line 1249)";
static char __pyx_k_113[] = "Raster.get_pixel (line 1255)";
static char __pyx_k_114[] = "create_raster (line 1349)";
static char __pyx_k_115[] = "create_bitmask_raster (line 1391)";
static char __pyx_k_116[] = "create_bitmask_raster";
static char __pyx_k_117[] = "Band.get_name (line 1590)";
static char __pyx_k_118[] = "Band.create_compatible_raster (line 1596)";
static char __pyx_k_119[] = "Band.read_raster (line 1666)";
static char __pyx_k_120[] = "Band.read_as_array (line 1714)";
static char __pyx_k_121[] = "Dataset.get_name (line 1820)";
static char __pyx_k_122[] = "Dataset.get_dsd_name (line 1827)";
static char __pyx_k_123[] = "Dataset.get_num_records (line 1834)";
static char __pyx_k_124[] = "Dataset.get_dsd (line 1841)";
static char __pyx_k_125[] = "Dataset.create_record (line 1846)";
static char __pyx_k_126[] = "Dataset.read_record (line 1861)";
static char __pyx_k_127[] = "Dataset.records (line 1907)";
static char __pyx_k_128[] = "Product.get_scene_width (line 2025)";
static char __pyx_k_129[] = "Product.get_scene_height (line 2030)";
static char __pyx_k_130[] = "Product.get_num_datasets (line 2035)";
static char __pyx_k_131[] = "Product.get_num_dsds (line 2040)";
static char __pyx_k_132[] = "Product.get_num_bands (line 2046)";
static char __pyx_k_133[] = "Product.get_dataset_at (line 2051)";
static char __pyx_k_134[] = "Product.get_dataset (line 2069)";
static char __pyx_k_135[] = "Product.get_dsd_at (line 2086)";
static char __pyx_k_136[] = "Product.get_mph (line 2107)";
static char __pyx_k_137[] = "Product.get_sph (line 2117)";
static char __pyx_k_138[] = "Product.get_band (line 2127)";
static char __pyx_k_139[] = "Product.get_band_at (line 2145)";
static char __pyx_k_140[] = "Product.get_dataset_names (line 2212)";
static char __pyx_k_141[] = "Product.get_band_names (line 2228)";
static char __pyx_k_142[] = "Product.datasets (line 2246)";
static char __pyx_k_143[] = "Product.bands (line 2253)";
static char __pyx_k_144[] = "open (line 2275)";
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__LIN[] = "LIN";
static char __pyx_k__LOG[] = "LOG";
static char __pyx_k__buf[] = "buf";
static char __pyx_k__int[] = "int";
static char __pyx_k__map[] = "map";
static char __pyx_k__obj[] = "obj";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__1OF1[] = "1OF1";
static char __pyx_k__1OF2[] = "1OF2";
static char __pyx_k__2OF2[] = "2OF2";
static char __pyx_k__2TOF[] = "2TOF";
static char __pyx_k__3TOI[] = "3TOI";
static char __pyx_k__Band[] = "Band";
static char __pyx_k__NONE[] = "NONE";
static char __pyx_k___ptr[] = "_ptr";
static char __pyx_k__base[] = "base";
static char __pyx_k__char[] = "char";
static char __pyx_k__code[] = "code";
static char __pyx_k__data[] = "data";
static char __pyx_k__days[] = "days";
static char __pyx_k__join[] = "join";
static char __pyx_k__ndim[] = "ndim";
static char __pyx_k__open[] = "open";
static char __pyx_k__repr[] = "repr";
static char __pyx_k__self[] = "self";
static char __pyx_k__uint[] = "uint";
static char __pyx_k__unit[] = "unit";
static char __pyx_k__Field[] = "Field";
static char __pyx_k___data[] = "_data";
static char __pyx_k__bands[] = "bands";
static char __pyx_k__descr[] = "descr";
static char __pyx_k__elems[] = "elems";
static char __pyx_k__index[] = "index";
static char __pyx_k__names[] = "names";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__range[] = "range";
static char __pyx_k__shape[] = "shape";
static char __pyx_k__short[] = "short";
static char __pyx_k__super[] = "super";
static char __pyx_k__uchar[] = "uchar";
static char __pyx_k__width[] = "width";
static char __pyx_k__xstep[] = "xstep";
static char __pyx_k__ystep[] = "ystep";
static char __pyx_k__Raster[] = "Raster";
static char __pyx_k__Record[] = "Record";
static char __pyx_k__atexit[] = "atexit";
static char __pyx_k__buffer[] = "buffer";
static char __pyx_k__double[] = "double";
static char __pyx_k__extend[] = "extend";
static char __pyx_k__fields[] = "fields";
static char __pyx_k__format[] = "format";
static char __pyx_k__height[] = "height";
static char __pyx_k__print_[] = "print_";
static char __pyx_k__raster[] = "raster";
static char __pyx_k__record[] = "record";
static char __pyx_k__stdout[] = "stdout";
static char __pyx_k__ushort[] = "ushort";
static char __pyx_k__Dataset[] = "Dataset";
static char __pyx_k__EPRTime[] = "EPRTime";
static char __pyx_k__Product[] = "Product";
static char __pyx_k___parent[] = "_parent";
static char __pyx_k__bm_expr[] = "bm_expr";
static char __pyx_k__ds_name[] = "ds_name";
static char __pyx_k__ds_size[] = "ds_size";
static char __pyx_k__ds_type[] = "ds_type";
static char __pyx_k__float32[] = "float32";
static char __pyx_k__get_dsd[] = "get_dsd";
static char __pyx_k__get_mph[] = "get_mph";
static char __pyx_k__get_sph[] = "get_sph";
static char __pyx_k__message[] = "message";
static char __pyx_k__num_dsr[] = "num_dsr";
static char __pyx_k__ostream[] = "ostream";
static char __pyx_k__product[] = "product";
static char __pyx_k__records[] = "records";
static char __pyx_k__seconds[] = "seconds";
static char __pyx_k__strides[] = "strides";
static char __pyx_k__toarray[] = "toarray";
static char __pyx_k__xoffset[] = "xoffset";
static char __pyx_k__yoffset[] = "yoffset";
static char __pyx_k__EPRError[] = "EPRError";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____repr__[] = "__repr__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k___dealloc[] = "_dealloc";
static char __pyx_k__datasets[] = "datasets";
static char __pyx_k__dsr_size[] = "dsr_size";
static char __pyx_k__filename[] = "filename";
static char __pyx_k__get_band[] = "get_band";
static char __pyx_k__get_elem[] = "get_elem";
static char __pyx_k__get_name[] = "get_name";
static char __pyx_k__get_type[] = "get_type";
static char __pyx_k__get_unit[] = "get_unit";
static char __pyx_k__itemsize[] = "itemsize";
static char __pyx_k__readonly[] = "readonly";
static char __pyx_k__register[] = "register";
static char __pyx_k__tot_size[] = "tot_size";
static char __pyx_k__type_num[] = "type_num";
static char __pyx_k__E_TID_INT[] = "E_TID_INT";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k____class__[] = "__class__";
static char __pyx_k__byteorder[] = "byteorder";
static char __pyx_k__data_type[] = "data_type";
static char __pyx_k__ds_offset[] = "ds_offset";
static char __pyx_k__epr_c_lib[] = "epr_c_lib";
static char __pyx_k__file_path[] = "file_path";
static char __pyx_k__get_elems[] = "get_elems";
static char __pyx_k__get_field[] = "get_field";
static char __pyx_k__get_pixel[] = "get_pixel";
static char __pyx_k__get_width[] = "get_width";
static char __pyx_k__id_string[] = "id_string";
static char __pyx_k__src_width[] = "src_width";
static char __pyx_k__E_SMID_LIN[] = "E_SMID_LIN";
static char __pyx_k__E_SMID_LOG[] = "E_SMID_LOG";
static char __pyx_k__E_SMID_NON[] = "E_SMID_NON";
static char __pyx_k__E_TID_CHAR[] = "E_TID_CHAR";
static char __pyx_k__E_TID_TIME[] = "E_TID_TIME";
static char __pyx_k__E_TID_UINT[] = "E_TID_UINT";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k___close_api[] = "_close_api";
static char __pyx_k__get_dsd_at[] = "get_dsd_at";
static char __pyx_k__get_height[] = "get_height";
static char __pyx_k__namedtuple[] = "namedtuple";
static char __pyx_k__src_height[] = "src_height";
static char __pyx_k__suboffsets[] = "suboffsets";
static char __pyx_k__E_SMOD_1OF1[] = "E_SMOD_1OF1";
static char __pyx_k__E_SMOD_1OF2[] = "E_SMOD_1OF2";
static char __pyx_k__E_SMOD_2OF2[] = "E_SMOD_2OF2";
static char __pyx_k__E_SMOD_2TOF[] = "E_SMOD_2TOF";
static char __pyx_k__E_SMOD_3TOI[] = "E_SMOD_3TOI";
static char __pyx_k__E_TID_FLOAT[] = "E_TID_FLOAT";
static char __pyx_k__E_TID_SHORT[] = "E_TID_SHORT";
static char __pyx_k__E_TID_SPARE[] = "E_TID_SPARE";
static char __pyx_k__E_TID_UCHAR[] = "E_TID_UCHAR";
static char __pyx_k__ImportError[] = "ImportError";
static char __pyx_k____version__[] = "__version__";
static char __pyx_k__collections[] = "collections";
static char __pyx_k__description[] = "description";
static char __pyx_k__field_index[] = "field_index";
static char __pyx_k__get_band_at[] = "get_band_at";
static char __pyx_k__get_dataset[] = "get_dataset";
static char __pyx_k__read_raster[] = "read_raster";
static char __pyx_k__read_record[] = "read_record";
static char __pyx_k__E_TID_DOUBLE[] = "E_TID_DOUBLE";
static char __pyx_k__E_TID_STRING[] = "E_TID_STRING";
static char __pyx_k__E_TID_USHORT[] = "E_TID_USHORT";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k____revision__[] = "__revision__";
static char __pyx_k__get_dsd_name[] = "get_dsd_name";
static char __pyx_k__get_field_at[] = "get_field_at";
static char __pyx_k__get_num_dsds[] = "get_num_dsds";
static char __pyx_k__microseconds[] = "microseconds";
static char __pyx_k__raster_width[] = "raster_width";
static char __pyx_k__sample_model[] = "sample_model";
static char __pyx_k__source_width[] = "source_width";
static char __pyx_k__EPRValueError[] = "EPRValueError";
static char __pyx_k__E_TID_UNKNOWN[] = "E_TID_UNKNOWN";
static char __pyx_k__create_raster[] = "create_raster";
static char __pyx_k__create_record[] = "create_record";
static char __pyx_k__element_index[] = "element_index";
static char __pyx_k__get_elem_size[] = "get_elem_size";
static char __pyx_k__get_num_bands[] = "get_num_bands";
static char __pyx_k__get_num_elems[] = "get_num_elems";
static char __pyx_k__print_element[] = "print_element";
static char __pyx_k__raster_height[] = "raster_height";
static char __pyx_k__read_as_array[] = "read_as_array";
static char __pyx_k__source_height[] = "source_height";
static char __pyx_k__source_step_x[] = "source_step_x";
static char __pyx_k__source_step_y[] = "source_step_y";
static char __pyx_k__NotImplemented[] = "NotImplemented";
static char __pyx_k__get_band_names[] = "get_band_names";
static char __pyx_k__get_dataset_at[] = "get_dataset_at";
static char __pyx_k__get_num_fields[] = "get_num_fields";
static char __pyx_k__lines_mirrored[] = "lines_mirrored";
static char __pyx_k__scaling_factor[] = "scaling_factor";
static char __pyx_k__scaling_method[] = "scaling_method";
static char __pyx_k__scaling_offset[] = "scaling_offset";
static char __pyx_k__get_description[] = "get_description";
static char __pyx_k__get_field_names[] = "get_field_names";
static char __pyx_k__get_num_records[] = "get_num_records";
static char __pyx_k__get_scene_width[] = "get_scene_width";
static char __pyx_k__get_num_datasets[] = "get_num_datasets";
static char __pyx_k__get_scene_height[] = "get_scene_height";
static char __pyx_k__EPR_C_API_VERSION[] = "EPR_C_API_VERSION";
static char __pyx_k__get_dataset_names[] = "get_dataset_names";
static char __pyx_k__spectr_band_index[] = "spectr_band_index";
static char __pyx_k__get_data_type_size[] = "get_data_type_size";
static char __pyx_k__meris_iodd_version[] = "meris_iodd_version";
static char __pyx_k__data_type_id_to_str[] = "data_type_id_to_str";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_u_100;
static PyObject *__pyx_kp_u_101;
static PyObject *__pyx_kp_u_102;
static PyObject *__pyx_kp_u_103;
static PyObject *__pyx_kp_u_104;
static PyObject *__pyx_kp_u_105;
static PyObject *__pyx_kp_u_106;
static PyObject *__pyx_kp_u_107;
static PyObject *__pyx_kp_u_108;
static PyObject *__pyx_kp_u_109;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_u_110;
static PyObject *__pyx_kp_u_111;
static PyObject *__pyx_kp_u_112;
static PyObject *__pyx_kp_u_113;
static PyObject *__pyx_kp_u_114;
static PyObject *__pyx_kp_u_115;
static PyObject *__pyx_n_s_116;
static PyObject *__pyx_kp_u_117;
static PyObject *__pyx_kp_u_118;
static PyObject *__pyx_kp_u_119;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_u_120;
static PyObject *__pyx_kp_u_121;
static PyObject *__pyx_kp_u_122;
static PyObject *__pyx_kp_u_123;
static PyObject *__pyx_kp_u_124;
static PyObject *__pyx_kp_u_125;
static PyObject *__pyx_kp_u_126;
static PyObject *__pyx_kp_u_127;
static PyObject *__pyx_kp_u_128;
static PyObject *__pyx_kp_u_129;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_u_130;
static PyObject *__pyx_kp_u_131;
static PyObject *__pyx_kp_u_132;
static PyObject *__pyx_kp_u_133;
static PyObject *__pyx_kp_u_134;
static PyObject *__pyx_kp_u_135;
static PyObject *__pyx_kp_u_136;
static PyObject *__pyx_kp_u_137;
static PyObject *__pyx_kp_u_138;
static PyObject *__pyx_kp_u_139;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_u_140;
static PyObject *__pyx_kp_u_141;
static PyObject *__pyx_kp_u_142;
static PyObject *__pyx_kp_u_143;
static PyObject *__pyx_kp_u_144;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_n_s_34;
static PyObject *__pyx_kp_s_35;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_47;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_u_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_u_50;
static PyObject *__pyx_kp_u_51;
static PyObject *__pyx_kp_u_52;
static PyObject *__pyx_kp_u_53;
static PyObject *__pyx_kp_u_54;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_kp_s_86;
static PyObject *__pyx_kp_s_87;
static PyObject *__pyx_kp_s_88;
static PyObject *__pyx_kp_u_89;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_kp_u_90;
static PyObject *__pyx_kp_u_91;
static PyObject *__pyx_n_s_92;
static PyObject *__pyx_kp_u_93;
static PyObject *__pyx_n_s_94;
static PyObject *__pyx_kp_u_95;
static PyObject *__pyx_kp_u_96;
static PyObject *__pyx_kp_u_97;
static PyObject *__pyx_kp_u_98;
static PyObject *__pyx_kp_u_99;
static PyObject *__pyx_kp_s__1OF1;
static PyObject *__pyx_kp_s__1OF2;
static PyObject *__pyx_kp_s__2OF2;
static PyObject *__pyx_kp_s__2TOF;
static PyObject *__pyx_kp_s__3TOI;
static PyObject *__pyx_n_s__Band;
static PyObject *__pyx_n_s__Dataset;
static PyObject *__pyx_n_s__EPRError;
static PyObject *__pyx_n_s__EPRTime;
static PyObject *__pyx_n_s__EPRValueError;
static PyObject *__pyx_n_s__EPR_C_API_VERSION;
static PyObject *__pyx_n_s__E_SMID_LIN;
static PyObject *__pyx_n_s__E_SMID_LOG;
static PyObject *__pyx_n_s__E_SMID_NON;
static PyObject *__pyx_n_s__E_SMOD_1OF1;
static PyObject *__pyx_n_s__E_SMOD_1OF2;
static PyObject *__pyx_n_s__E_SMOD_2OF2;
static PyObject *__pyx_n_s__E_SMOD_2TOF;
static PyObject *__pyx_n_s__E_SMOD_3TOI;
static PyObject *__pyx_n_s__E_TID_CHAR;
static PyObject *__pyx_n_s__E_TID_DOUBLE;
static PyObject *__pyx_n_s__E_TID_FLOAT;
static PyObject *__pyx_n_s__E_TID_INT;
static PyObject *__pyx_n_s__E_TID_SHORT;
static PyObject *__pyx_n_s__E_TID_SPARE;
static PyObject *__pyx_n_s__E_TID_STRING;
static PyObject *__pyx_n_s__E_TID_TIME;
static PyObject *__pyx_n_s__E_TID_UCHAR;
static PyObject *__pyx_n_s__E_TID_UINT;
static PyObject *__pyx_n_s__E_TID_UNKNOWN;
static PyObject *__pyx_n_s__E_TID_USHORT;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__Field;
static PyObject *__pyx_n_s__ImportError;
static PyObject *__pyx_n_s__KeyError;
static PyObject *__pyx_n_s__LIN;
static PyObject *__pyx_n_s__LOG;
static PyObject *__pyx_n_s__NONE;
static PyObject *__pyx_n_s__NotImplemented;
static PyObject *__pyx_n_s__Product;
static PyObject *__pyx_n_s__Raster;
static PyObject *__pyx_n_s__Record;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____class__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____repr__;
static PyObject *__pyx_n_s____revision__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s____version__;
static PyObject *__pyx_n_s___close_api;
static PyObject *__pyx_n_s___data;
static PyObject *__pyx_n_s___dealloc;
static PyObject *__pyx_n_s___parent;
static PyObject *__pyx_n_s___ptr;
static PyObject *__pyx_n_s__atexit;
static PyObject *__pyx_n_s__bands;
static PyObject *__pyx_n_s__base;
static PyObject *__pyx_n_s__bm_expr;
static PyObject *__pyx_n_s__buf;
static PyObject *__pyx_n_s__buffer;
static PyObject *__pyx_n_s__byteorder;
static PyObject *__pyx_n_s__char;
static PyObject *__pyx_n_s__code;
static PyObject *__pyx_n_s__collections;
static PyObject *__pyx_n_s__create_raster;
static PyObject *__pyx_n_s__create_record;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__data_type;
static PyObject *__pyx_n_s__data_type_id_to_str;
static PyObject *__pyx_n_s__datasets;
static PyObject *__pyx_n_s__days;
static PyObject *__pyx_n_s__descr;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__double;
static PyObject *__pyx_n_s__ds_name;
static PyObject *__pyx_n_s__ds_offset;
static PyObject *__pyx_n_s__ds_size;
static PyObject *__pyx_n_s__ds_type;
static PyObject *__pyx_n_s__dsr_size;
static PyObject *__pyx_n_s__element_index;
static PyObject *__pyx_n_s__elems;
static PyObject *__pyx_n_s__epr_c_lib;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__field_index;
static PyObject *__pyx_n_s__fields;
static PyObject *__pyx_n_s__file_path;
static PyObject *__pyx_n_s__filename;
static PyObject *__pyx_n_s__float32;
static PyObject *__pyx_n_s__format;
static PyObject *__pyx_n_s__get_band;
static PyObject *__pyx_n_s__get_band_at;
static PyObject *__pyx_n_s__get_band_names;
static PyObject *__pyx_n_s__get_data_type_size;
static PyObject *__pyx_n_s__get_dataset;
static PyObject *__pyx_n_s__get_dataset_at;
static PyObject *__pyx_n_s__get_dataset_names;
static PyObject *__pyx_n_s__get_description;
static PyObject *__pyx_n_s__get_dsd;
static PyObject *__pyx_n_s__get_dsd_at;
static PyObject *__pyx_n_s__get_dsd_name;
static PyObject *__pyx_n_s__get_elem;
static PyObject *__pyx_n_s__get_elem_size;
static PyObject *__pyx_n_s__get_elems;
static PyObject *__pyx_n_s__get_field;
static PyObject *__pyx_n_s__get_field_at;
static PyObject *__pyx_n_s__get_field_names;
static PyObject *__pyx_n_s__get_height;
static PyObject *__pyx_n_s__get_mph;
static PyObject *__pyx_n_s__get_name;
static PyObject *__pyx_n_s__get_num_bands;
static PyObject *__pyx_n_s__get_num_datasets;
static PyObject *__pyx_n_s__get_num_dsds;
static PyObject *__pyx_n_s__get_num_elems;
static PyObject *__pyx_n_s__get_num_fields;
static PyObject *__pyx_n_s__get_num_records;
static PyObject *__pyx_n_s__get_pixel;
static PyObject *__pyx_n_s__get_scene_height;
static PyObject *__pyx_n_s__get_scene_width;
static PyObject *__pyx_n_s__get_sph;
static PyObject *__pyx_n_s__get_type;
static PyObject *__pyx_n_s__get_unit;
static PyObject *__pyx_n_s__get_width;
static PyObject *__pyx_n_s__height;
static PyObject *__pyx_n_s__id_string;
static PyObject *__pyx_n_s__index;
static PyObject *__pyx_n_s__int;
static PyObject *__pyx_n_s__itemsize;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__lines_mirrored;
static PyObject *__pyx_n_s__map;
static PyObject *__pyx_n_s__meris_iodd_version;
static PyObject *__pyx_n_s__message;
static PyObject *__pyx_n_s__microseconds;
static PyObject *__pyx_n_s__namedtuple;
static PyObject *__pyx_n_s__names;
static PyObject *__pyx_n_s__ndim;
static PyObject *__pyx_n_s__np;
static PyObject *__pyx_n_s__num_dsr;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__obj;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__ostream;
static PyObject *__pyx_n_s__print_;
static PyObject *__pyx_n_s__print_element;
static PyObject *__pyx_n_s__product;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__raster;
static PyObject *__pyx_n_s__raster_height;
static PyObject *__pyx_n_s__raster_width;
static PyObject *__pyx_n_s__read_as_array;
static PyObject *__pyx_n_s__read_raster;
static PyObject *__pyx_n_s__read_record;
static PyObject *__pyx_n_s__readonly;
static PyObject *__pyx_n_s__record;
static PyObject *__pyx_n_s__records;
static PyObject *__pyx_n_s__register;
static PyObject *__pyx_n_s__repr;
static PyObject *__pyx_n_s__sample_model;
static PyObject *__pyx_n_s__scaling_factor;
static PyObject *__pyx_n_s__scaling_method;
static PyObject *__pyx_n_s__scaling_offset;
static PyObject *__pyx_n_s__seconds;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__shape;
static PyObject *__pyx_n_s__short;
static PyObject *__pyx_n_s__source_height;
static PyObject *__pyx_n_s__source_step_x;
static PyObject *__pyx_n_s__source_step_y;
static PyObject *__pyx_n_s__source_width;
static PyObject *__pyx_n_s__spectr_band_index;
static PyObject *__pyx_n_s__src_height;
static PyObject *__pyx_n_s__src_width;
static PyObject *__pyx_n_s__stdout;
static PyObject *__pyx_n_s__strides;
static PyObject *__pyx_n_s__suboffsets;
static PyObject *__pyx_n_s__super;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__toarray;
static PyObject *__pyx_n_s__tot_size;
static PyObject *__pyx_n_s__type_num;
static PyObject *__pyx_n_s__uchar;
static PyObject *__pyx_n_s__uint;
static PyObject *__pyx_n_s__unit;
static PyObject *__pyx_n_s__ushort;
static PyObject *__pyx_n_s__width;
static PyObject *__pyx_n_s__x;
static PyObject *__pyx_n_s__xoffset;
static PyObject *__pyx_n_s__xstep;
static PyObject *__pyx_n_s__y;
static PyObject *__pyx_n_s__yoffset;
static PyObject *__pyx_n_s__ystep;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_15;

/* "/home/antonio/projects/pyepr/src/epr.pyx":403
 * 
 * 
 * cdef np.NPY_TYPES _epr_to_numpy_type_id(EPR_DataTypeId epr_type):             # <<<<<<<<<<<<<<
 *     cdef np.NPY_TYPES result = np.NPY_NOTYPE
 * 
 */

static  enum NPY_TYPES __pyx_f_3epr__epr_to_numpy_type_id(enum EPR_DataTypeId __pyx_v_epr_type) {
  enum NPY_TYPES __pyx_v_result;
  enum NPY_TYPES __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_epr_to_numpy_type_id");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":404
 * 
 * cdef np.NPY_TYPES _epr_to_numpy_type_id(EPR_DataTypeId epr_type):
 *     cdef np.NPY_TYPES result = np.NPY_NOTYPE             # <<<<<<<<<<<<<<
 * 
 *     if epr_type == E_TID_UCHAR:
 */
  __pyx_v_result = NPY_NOTYPE;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":406
 *     cdef np.NPY_TYPES result = np.NPY_NOTYPE
 * 
 *     if epr_type == E_TID_UCHAR:             # <<<<<<<<<<<<<<
 *         result = np.NPY_UBYTE
 *     if epr_type == E_TID_CHAR:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_UCHAR); 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_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":407
 * 
 *     if epr_type == E_TID_UCHAR:
 *         result = np.NPY_UBYTE             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_CHAR:
 *         result = np.NPY_BYTE
 */
    __pyx_v_result = NPY_UBYTE;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":408
 *     if epr_type == E_TID_UCHAR:
 *         result = np.NPY_UBYTE
 *     if epr_type == E_TID_CHAR:             # <<<<<<<<<<<<<<
 *         result = np.NPY_BYTE
 *     if epr_type == E_TID_USHORT:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_CHAR); 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_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":409
 *         result = np.NPY_UBYTE
 *     if epr_type == E_TID_CHAR:
 *         result = np.NPY_BYTE             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_USHORT:
 *         result = np.NPY_USHORT
 */
    __pyx_v_result = NPY_BYTE;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":410
 *     if epr_type == E_TID_CHAR:
 *         result = np.NPY_BYTE
 *     if epr_type == E_TID_USHORT:             # <<<<<<<<<<<<<<
 *         result = np.NPY_USHORT
 *     if epr_type == E_TID_SHORT:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_USHORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":411
 *         result = np.NPY_BYTE
 *     if epr_type == E_TID_USHORT:
 *         result = np.NPY_USHORT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_SHORT:
 *         result = np.NPY_SHORT
 */
    __pyx_v_result = NPY_USHORT;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":412
 *     if epr_type == E_TID_USHORT:
 *         result = np.NPY_USHORT
 *     if epr_type == E_TID_SHORT:             # <<<<<<<<<<<<<<
 *         result = np.NPY_SHORT
 *     if epr_type == E_TID_UINT:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_SHORT); 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_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":413
 *         result = np.NPY_USHORT
 *     if epr_type == E_TID_SHORT:
 *         result = np.NPY_SHORT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_UINT:
 *         result = np.NPY_UINT
 */
    __pyx_v_result = NPY_SHORT;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":414
 *     if epr_type == E_TID_SHORT:
 *         result = np.NPY_SHORT
 *     if epr_type == E_TID_UINT:             # <<<<<<<<<<<<<<
 *         result = np.NPY_UINT
 *     if epr_type == E_TID_INT:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_UINT); 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_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":415
 *         result = np.NPY_SHORT
 *     if epr_type == E_TID_UINT:
 *         result = np.NPY_UINT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_INT:
 *         result = np.NPY_INT
 */
    __pyx_v_result = NPY_UINT;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":416
 *     if epr_type == E_TID_UINT:
 *         result = np.NPY_UINT
 *     if epr_type == E_TID_INT:             # <<<<<<<<<<<<<<
 *         result = np.NPY_INT
 *     if epr_type == E_TID_FLOAT:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_INT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":417
 *         result = np.NPY_UINT
 *     if epr_type == E_TID_INT:
 *         result = np.NPY_INT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_FLOAT:
 *         result = np.NPY_FLOAT
 */
    __pyx_v_result = NPY_INT;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":418
 *     if epr_type == E_TID_INT:
 *         result = np.NPY_INT
 *     if epr_type == E_TID_FLOAT:             # <<<<<<<<<<<<<<
 *         result = np.NPY_FLOAT
 *     if epr_type == E_TID_DOUBLE:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_FLOAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":419
 *         result = np.NPY_INT
 *     if epr_type == E_TID_FLOAT:
 *         result = np.NPY_FLOAT             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_DOUBLE:
 *         result = np.NPY_DOUBLE
 */
    __pyx_v_result = NPY_FLOAT;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":420
 *     if epr_type == E_TID_FLOAT:
 *         result = np.NPY_FLOAT
 *     if epr_type == E_TID_DOUBLE:             # <<<<<<<<<<<<<<
 *         result = np.NPY_DOUBLE
 *     if epr_type == E_TID_STRING:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":421
 *         result = np.NPY_FLOAT
 *     if epr_type == E_TID_DOUBLE:
 *         result = np.NPY_DOUBLE             # <<<<<<<<<<<<<<
 *     if epr_type == E_TID_STRING:
 *         result = np.NPY_STRING
 */
    __pyx_v_result = NPY_DOUBLE;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":422
 *     if epr_type == E_TID_DOUBLE:
 *         result = np.NPY_DOUBLE
 *     if epr_type == E_TID_STRING:             # <<<<<<<<<<<<<<
 *         result = np.NPY_STRING
 * 
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_epr_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_TID_STRING); 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_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":423
 *         result = np.NPY_DOUBLE
 *     if epr_type == E_TID_STRING:
 *         result = np.NPY_STRING             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_v_result = NPY_STRING;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":425
 *         result = np.NPY_STRING
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("epr._epr_to_numpy_type_id");
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":431
 *     '''EPR API error'''
 * 
 *     def __init__(self, message='', code=None, *args, **kargs):             # <<<<<<<<<<<<<<
 *         super(EPRError, self).__init__(message, code, *args, **kargs)
 * 
 */

static PyObject *__pyx_pf_3epr_8EPRError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3epr_8EPRError___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_3epr_8EPRError___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_3epr_8EPRError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kargs = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__message,&__pyx_n_s__code,0};
  __Pyx_RefNannySetupContext("__init__");
  __pyx_self = __pyx_self;
  __pyx_v_kargs = PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 3) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_args);

    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kargs);
      return NULL;
    }
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_1);
    values[2] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      default:
      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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__message);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__code);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 3) ? PyTuple_GET_SIZE(__pyx_args) : 3;
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_code = values[2];
  } else {
    __pyx_v_message = ((PyObject *)__pyx_kp_s_1);
    __pyx_v_code = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      default:
      case  3: __pyx_v_code = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_message = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      case  0:
      goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kargs);
  __Pyx_AddTraceback("epr.EPRError.__init__");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":432
 * 
 *     def __init__(self, message='', code=None, *args, **kargs):
 *         super(EPRError, self).__init__(message, code, *args, **kargs)             # <<<<<<<<<<<<<<
 * 
 *         #: EPR API error code
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message);
  __Pyx_GIVEREF(__pyx_v_message);
  __Pyx_INCREF(__pyx_v_code);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_code);
  __Pyx_GIVEREF(__pyx_v_code);
  __pyx_t_3 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, __pyx_v_kargs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __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_3); __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":435
 * 
 *         #: EPR API error code
 *         self.code = code             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__code, __pyx_v_code) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr.EPRError.__init__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":442
 * 
 * 
 * cdef int pyepr_check_errors() except -1:             # <<<<<<<<<<<<<<
 *     cdef int code
 *     cdef char* msg
 */

static  int __pyx_f_3epr_pyepr_check_errors(void) {
  int __pyx_v_code;
  char *__pyx_v_msg;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("pyepr_check_errors");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":445
 *     cdef int code
 *     cdef char* msg
 *     code = epr_get_last_err_code()             # <<<<<<<<<<<<<<
 *     if code != e_err_none:
 *         msg = <char*>epr_get_last_err_message()
 */
  __pyx_v_code = epr_get_last_err_code();

  /* "/home/antonio/projects/pyepr/src/epr.pyx":446
 *     cdef char* msg
 *     code = epr_get_last_err_code()
 *     if code != e_err_none:             # <<<<<<<<<<<<<<
 *         msg = <char*>epr_get_last_err_message()
 *         # @TODO: if not msg: msg = EPR_ERR_MSG[code]
 */
  __pyx_t_1 = (__pyx_v_code != e_err_none);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":447
 *     code = epr_get_last_err_code()
 *     if code != e_err_none:
 *         msg = <char*>epr_get_last_err_message()             # <<<<<<<<<<<<<<
 *         # @TODO: if not msg: msg = EPR_ERR_MSG[code]
 *         if (e_err_invalid_product_id <= code <= e_err_invalid_keyword_name or
 */
    __pyx_v_msg = ((char *)epr_get_last_err_message());

    /* "/home/antonio/projects/pyepr/src/epr.pyx":449
 *         msg = <char*>epr_get_last_err_message()
 *         # @TODO: if not msg: msg = EPR_ERR_MSG[code]
 *         if (e_err_invalid_product_id <= code <= e_err_invalid_keyword_name or             # <<<<<<<<<<<<<<
 *             code in (e_err_null_pointer,
 *                      e_err_illegal_arg,
 */
    __pyx_t_1 = (e_err_invalid_product_id <= ((enum EPR_ErrCode)__pyx_v_code));
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_code <= e_err_invalid_keyword_name);
    }
    if (!__pyx_t_1) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":450
 *         # @TODO: if not msg: msg = EPR_ERR_MSG[code]
 *         if (e_err_invalid_product_id <= code <= e_err_invalid_keyword_name or
 *             code in (e_err_null_pointer,             # <<<<<<<<<<<<<<
 *                      e_err_illegal_arg,
 *                      e_err_index_out_of_range)):
 */
      __pyx_t_2 = __pyx_v_code;
      __pyx_t_3 = ((int)(__pyx_t_2 == e_err_null_pointer));
      if (!__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":451
 *         if (e_err_invalid_product_id <= code <= e_err_invalid_keyword_name or
 *             code in (e_err_null_pointer,
 *                      e_err_illegal_arg,             # <<<<<<<<<<<<<<
 *                      e_err_index_out_of_range)):
 *             raise EPRValueError(msg, code)
 */
        __pyx_t_4 = ((int)(__pyx_t_2 == e_err_illegal_arg));
        __pyx_t_5 = __pyx_t_4;
      } else {
        __pyx_t_5 = __pyx_t_3;
      }
      if (!__pyx_t_5) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":452
 *             code in (e_err_null_pointer,
 *                      e_err_illegal_arg,
 *                      e_err_index_out_of_range)):             # <<<<<<<<<<<<<<
 *             raise EPRValueError(msg, code)
 *         else:
 */
        __pyx_t_3 = ((int)(__pyx_t_2 == e_err_index_out_of_range));
        __pyx_t_4 = __pyx_t_3;
      } else {
        __pyx_t_4 = __pyx_t_5;
      }
      __pyx_t_5 = __pyx_t_4;
      __pyx_t_4 = __pyx_t_5;
    } else {
      __pyx_t_4 = __pyx_t_1;
    }
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":453
 *                      e_err_illegal_arg,
 *                      e_err_index_out_of_range)):
 *             raise EPRValueError(msg, code)             # <<<<<<<<<<<<<<
 *         else:
 *             raise EPRError(msg, code)
 */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRValueError); 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_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __pyx_t_8 = PyInt_FromLong(__pyx_v_code); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":455
 *             raise EPRValueError(msg, code)
 *         else:
 *             raise EPRError(msg, code)             # <<<<<<<<<<<<<<
 *         epr_clear_err()
 *         return -1
 */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      __pyx_t_6 = PyInt_FromLong(__pyx_v_code); 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 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_9));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_9 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); 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_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":456
 *         else:
 *             raise EPRError(msg, code)
 *         epr_clear_err()             # <<<<<<<<<<<<<<
 *         return -1
 *     return 0
 */
    epr_clear_err();

    /* "/home/antonio/projects/pyepr/src/epr.pyx":457
 *             raise EPRError(msg, code)
 *         epr_clear_err()
 *         return -1             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":458
 *         epr_clear_err()
 *         return -1
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef int pyepr_null_ptr_error(msg='null pointer') except -1:
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("epr.pyepr_check_errors");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":460
 *     return 0
 * 
 * cdef int pyepr_null_ptr_error(msg='null pointer') except -1:             # <<<<<<<<<<<<<<
 *     cdef int code
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()
 */

static  int __pyx_f_3epr_pyepr_null_ptr_error(struct __pyx_opt_args_3epr_pyepr_null_ptr_error *__pyx_optional_args) {
  PyObject *__pyx_v_msg = ((PyObject *)__pyx_kp_s_2);
  int __pyx_v_code;
  char *__pyx_v_eprmsg;
  int __pyx_r;
  int __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;
  __Pyx_RefNannySetupContext("pyepr_null_ptr_error");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_msg = __pyx_optional_args->msg;
    }
  }
  __Pyx_INCREF(__pyx_v_msg);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":462
 * cdef int pyepr_null_ptr_error(msg='null pointer') except -1:
 *     cdef int code
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()             # <<<<<<<<<<<<<<
 * 
 *     code = epr_get_last_err_code()
 */
  __pyx_v_eprmsg = ((char *)epr_get_last_err_message());

  /* "/home/antonio/projects/pyepr/src/epr.pyx":464
 *     cdef char* eprmsg = <char*>epr_get_last_err_message()
 * 
 *     code = epr_get_last_err_code()             # <<<<<<<<<<<<<<
 *     if not code:
 *         code = None
 */
  __pyx_v_code = epr_get_last_err_code();

  /* "/home/antonio/projects/pyepr/src/epr.pyx":465
 * 
 *     code = epr_get_last_err_code()
 *     if not code:             # <<<<<<<<<<<<<<
 *         code = None
 * 
 */
  __pyx_t_1 = (!__pyx_v_code);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":466
 *     code = epr_get_last_err_code()
 *     if not code:
 *         code = None             # <<<<<<<<<<<<<<
 * 
 *     epr_clear_err()
 */
    __pyx_t_2 = __Pyx_PyInt_AsInt(Py_None); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_code = __pyx_t_2;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":468
 *         code = None
 * 
 *     epr_clear_err()             # <<<<<<<<<<<<<<
 *     raise EPRValueError('%s: %s' % (msg, eprmsg), code=code)
 *     return -1
 */
  epr_clear_err();

  /* "/home/antonio/projects/pyepr/src/epr.pyx":469
 * 
 *     epr_clear_err()
 *     raise EPRValueError('%s: %s' % (msg, eprmsg), code=code)             # <<<<<<<<<<<<<<
 *     return -1
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRValueError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_eprmsg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_msg);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg);
  __Pyx_GIVEREF(__pyx_v_msg);
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_6 = PyInt_FromLong(__pyx_v_code); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__code), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_5, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_6, 0, 0);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/antonio/projects/pyepr/src/epr.pyx":470
 *     epr_clear_err()
 *     raise EPRValueError('%s: %s' % (msg, eprmsg), code=code)
 *     return -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = -1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.pyepr_null_ptr_error");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":476
 *     '''Library object to handle C API initialization/finalization'''
 * 
 *     def __cinit__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef char* msg
 * 
 */

static int __pyx_pf_3epr_4CLib___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_3epr_4CLib___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  char *__pyx_v_msg;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":485
 * 
 *         #if epr_init_api(e_log_warning, epr_log_message, NULL):
 *         if epr_init_api(e_log_warning, NULL, NULL):             # <<<<<<<<<<<<<<
 *             msg = <char*>epr_get_last_err_message()
 *             epr_clear_err()
 */
  __pyx_t_1 = epr_init_api(e_log_warning, NULL, NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":486
 *         #if epr_init_api(e_log_warning, epr_log_message, NULL):
 *         if epr_init_api(e_log_warning, NULL, NULL):
 *             msg = <char*>epr_get_last_err_message()             # <<<<<<<<<<<<<<
 *             epr_clear_err()
 *             raise ImportError('unable to inizialize EPR API library: %s' % msg)
 */
    __pyx_v_msg = ((char *)epr_get_last_err_message());

    /* "/home/antonio/projects/pyepr/src/epr.pyx":487
 *         if epr_init_api(e_log_warning, NULL, NULL):
 *             msg = <char*>epr_get_last_err_message()
 *             epr_clear_err()             # <<<<<<<<<<<<<<
 *             raise ImportError('unable to inizialize EPR API library: %s' % msg)
 * 
 */
    epr_clear_err();

    /* "/home/antonio/projects/pyepr/src/epr.pyx":488
 *             msg = <char*>epr_get_last_err_message()
 *             epr_clear_err()
 *             raise ImportError('unable to inizialize EPR API library: %s' % msg)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ImportError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __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);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.CLib.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":490
 *             raise ImportError('unable to inizialize EPR API library: %s' % msg)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         epr_close_api()
 * 
 */

static void __pyx_pf_3epr_4CLib___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_3epr_4CLib___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":491
 * 
 *     def __dealloc__(self):
 *         epr_close_api()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  epr_close_api();

  __Pyx_RefNannyFinishContext();
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":500
 * cdef class EprObject:
 *     cdef object epr_c_lib
 *     def __cinit__(self, *ars, **kargs):             # <<<<<<<<<<<<<<
 *         self.epr_c_lib = _EPR_C_LIB
 * 
 */

static int __pyx_pf_3epr_9EprObject___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_3epr_9EprObject___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ars = 0;
  PyObject *__pyx_v_kargs = 0;
  int __pyx_r;
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
  __pyx_v_kargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_ars = __pyx_args;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":501
 *     cdef object epr_c_lib
 *     def __cinit__(self, *ars, **kargs):
 *         self.epr_c_lib = _EPR_C_LIB             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GOTREF(((struct __pyx_obj_3epr_EprObject *)__pyx_v_self)->epr_c_lib);
  __Pyx_DECREF(((struct __pyx_obj_3epr_EprObject *)__pyx_v_self)->epr_c_lib);
  ((struct __pyx_obj_3epr_EprObject *)__pyx_v_self)->epr_c_lib = ((PyObject *)__pyx_v_3epr__EPR_C_LIB);

  __pyx_r = 0;
  __Pyx_DECREF(__pyx_v_ars);
  __Pyx_DECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":503
 *         self.epr_c_lib = _EPR_C_LIB
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.epr_c_lib = None
 * 
 */

static void __pyx_pf_3epr_9EprObject___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_3epr_9EprObject___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":504
 * 
 *     def __dealloc__(self):
 *         self.epr_c_lib = None             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_3epr_EprObject *)__pyx_v_self)->epr_c_lib);
  __Pyx_DECREF(((struct __pyx_obj_3epr_EprObject *)__pyx_v_self)->epr_c_lib);
  ((struct __pyx_obj_3epr_EprObject *)__pyx_v_self)->epr_c_lib = Py_None;

  __Pyx_RefNannyFinishContext();
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":506
 *         self.epr_c_lib = None
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError('"%s" class cannot be instantiated from Python' %
 *                                                     self.__class__.__name__)
 */

static int __pyx_pf_3epr_9EprObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_3epr_9EprObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":508
 *     def __init__(self):
 *         raise TypeError('"%s" class cannot be instantiated from Python' %
 *                                                     self.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.EprObject.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":511
 * 
 * 
 * def get_data_type_size(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''Gets the size in bytes for an element of the given data type'''
 * 
 */

static PyObject *__pyx_pf_3epr_get_data_type_size(PyObject *__pyx_self, PyObject *__pyx_arg_type_id); /*proto*/
static char __pyx_doc_3epr_get_data_type_size[] = "Gets the size in bytes for an element of the given data type";
static PyObject *__pyx_pf_3epr_get_data_type_size(PyObject *__pyx_self, PyObject *__pyx_arg_type_id) {
  EPR_EDataTypeId __pyx_v_type_id;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_data_type_size");
  __pyx_self = __pyx_self;
  assert(__pyx_arg_type_id); {
    __pyx_v_type_id = PyInt_AsLong(__pyx_arg_type_id); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.get_data_type_size");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":514
 *     '''Gets the size in bytes for an element of the given data type'''
 * 
 *     return epr_get_data_type_size(type_id)             # <<<<<<<<<<<<<<
 * 
 * def data_type_id_to_str(EPR_EDataTypeId type_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_data_type_size(__pyx_v_type_id)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.get_data_type_size");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":516
 *     return epr_get_data_type_size(type_id)
 * 
 * def data_type_id_to_str(EPR_EDataTypeId type_id):             # <<<<<<<<<<<<<<
 *     '''Gets the 'C' data type string for the given data type'''
 * 
 */

static PyObject *__pyx_pf_3epr_data_type_id_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_type_id); /*proto*/
static char __pyx_doc_3epr_data_type_id_to_str[] = "Gets the 'C' data type string for the given data type";
static PyObject *__pyx_pf_3epr_data_type_id_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_type_id) {
  EPR_EDataTypeId __pyx_v_type_id;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("data_type_id_to_str");
  __pyx_self = __pyx_self;
  assert(__pyx_arg_type_id); {
    __pyx_v_type_id = PyInt_AsLong(__pyx_arg_type_id); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.data_type_id_to_str");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":519
 *     '''Gets the 'C' data type string for the given data type'''
 * 
 *     return epr_data_type_id_to_str(type_id)             # <<<<<<<<<<<<<<
 * 
 * def get_scaling_method_name(method):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(epr_data_type_id_to_str(__pyx_v_type_id)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.data_type_id_to_str");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":521
 *     return epr_data_type_id_to_str(type_id)
 * 
 * def get_scaling_method_name(method):             # <<<<<<<<<<<<<<
 *     '''Return the name of the specified scaling method'''
 * 
 */

static PyObject *__pyx_pf_3epr_get_scaling_method_name(PyObject *__pyx_self, PyObject *__pyx_v_method); /*proto*/
static char __pyx_doc_3epr_get_scaling_method_name[] = "Return the name of the specified scaling method";
static PyObject *__pyx_pf_3epr_get_scaling_method_name(PyObject *__pyx_self, PyObject *__pyx_v_method) {
  PyObject *__pyx_v_mmap;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("get_scaling_method_name");
  __pyx_self = __pyx_self;
  __Pyx_INCREF(__pyx_v_method);
  __pyx_v_mmap = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":524
 *     '''Return the name of the specified scaling method'''
 * 
 *     mmap = {             # <<<<<<<<<<<<<<
 *         E_SMID_NON: 'NONE',
 *         E_SMID_LIN: 'LIN',
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":525
 * 
 *     mmap = {
 *         E_SMID_NON: 'NONE',             # <<<<<<<<<<<<<<
 *         E_SMID_LIN: 'LIN',
 *         E_SMID_LOG: 'LOG',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMID_NON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__NONE)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":526
 *     mmap = {
 *         E_SMID_NON: 'NONE',
 *         E_SMID_LIN: 'LIN',             # <<<<<<<<<<<<<<
 *         E_SMID_LOG: 'LOG',
 *     }
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMID_LIN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__LIN)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":527
 *         E_SMID_NON: 'NONE',
 *         E_SMID_LIN: 'LIN',
 *         E_SMID_LOG: 'LOG',             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMID_LOG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__LOG)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_mmap);
  __pyx_v_mmap = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":530
 *     }
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return mmap[method]
 *     except KeyError:
 */
  {
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
    __Pyx_XGOTREF(__pyx_save_exc_type);
    __Pyx_XGOTREF(__pyx_save_exc_value);
    __Pyx_XGOTREF(__pyx_save_exc_tb);
    /*try:*/ {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":531
 * 
 *     try:
 *         return mmap[method]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError('invalid scaling method: "%s"' % method)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyObject_GetItem(__pyx_v_mmap, __pyx_v_method); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L9_try_return;
    }
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L12_try_end;
    __pyx_L9_try_return:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L0;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":532
 *     try:
 *         return mmap[method]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid scaling method: "%s"' % method)
 * 
 */
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("epr.get_scaling_method_name");
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_4);

      /* "/home/antonio/projects/pyepr/src/epr.pyx":533
 *         return mmap[method]
 *     except KeyError:
 *         raise ValueError('invalid scaling method: "%s"' % method)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_method); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L12_try_end:;
  }

  __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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.get_scaling_method_name");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_mmap);
  __Pyx_DECREF(__pyx_v_method);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":536
 * 
 * 
 * def get_sample_model_name(model):             # <<<<<<<<<<<<<<
 *     '''Return the name of the specified sample model'''
 * 
 */

static PyObject *__pyx_pf_3epr_get_sample_model_name(PyObject *__pyx_self, PyObject *__pyx_v_model); /*proto*/
static char __pyx_doc_3epr_get_sample_model_name[] = "Return the name of the specified sample model";
static PyObject *__pyx_pf_3epr_get_sample_model_name(PyObject *__pyx_self, PyObject *__pyx_v_model) {
  PyObject *__pyx_v_mmap;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("get_sample_model_name");
  __pyx_self = __pyx_self;
  __Pyx_INCREF(__pyx_v_model);
  __pyx_v_mmap = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":539
 *     '''Return the name of the specified sample model'''
 * 
 *     mmap = {             # <<<<<<<<<<<<<<
 *         E_SMOD_1OF1: '1OF1',
 *         E_SMOD_1OF2: '1OF2',
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":540
 * 
 *     mmap = {
 *         E_SMOD_1OF1: '1OF1',             # <<<<<<<<<<<<<<
 *         E_SMOD_1OF2: '1OF2',
 *         E_SMOD_2OF2: '2OF2',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_1OF1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__1OF1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":541
 *     mmap = {
 *         E_SMOD_1OF1: '1OF1',
 *         E_SMOD_1OF2: '1OF2',             # <<<<<<<<<<<<<<
 *         E_SMOD_2OF2: '2OF2',
 *         E_SMOD_3TOI: '3TOI',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_1OF2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__1OF2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":542
 *         E_SMOD_1OF1: '1OF1',
 *         E_SMOD_1OF2: '1OF2',
 *         E_SMOD_2OF2: '2OF2',             # <<<<<<<<<<<<<<
 *         E_SMOD_3TOI: '3TOI',
 *         E_SMOD_2TOF: '2TOF',
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_2OF2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__2OF2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":543
 *         E_SMOD_1OF2: '1OF2',
 *         E_SMOD_2OF2: '2OF2',
 *         E_SMOD_3TOI: '3TOI',             # <<<<<<<<<<<<<<
 *         E_SMOD_2TOF: '2TOF',
 *     }
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_3TOI); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__3TOI)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":544
 *         E_SMOD_2OF2: '2OF2',
 *         E_SMOD_3TOI: '3TOI',
 *         E_SMOD_2TOF: '2TOF',             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__E_SMOD_2TOF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s__2TOF)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_mmap);
  __pyx_v_mmap = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":547
 *     }
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return mmap[model]
 *     except KeyError:
 */
  {
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
    __Pyx_XGOTREF(__pyx_save_exc_type);
    __Pyx_XGOTREF(__pyx_save_exc_value);
    __Pyx_XGOTREF(__pyx_save_exc_tb);
    /*try:*/ {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":548
 * 
 *     try:
 *         return mmap[model]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError('invalid sample model: "%s"' % model)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyObject_GetItem(__pyx_v_mmap, __pyx_v_model); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L9_try_return;
    }
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L12_try_end;
    __pyx_L9_try_return:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L0;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":549
 *     try:
 *         return mmap[model]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid sample model: "%s"' % model)
 * 
 */
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("epr.get_sample_model_name");
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_4);

      /* "/home/antonio/projects/pyepr/src/epr.pyx":550
 *         return mmap[model]
 *     except KeyError:
 *         raise ValueError('invalid sample model: "%s"' % model)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_v_model); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L12_try_end:;
  }

  __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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.get_sample_model_name");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_mmap);
  __Pyx_DECREF(__pyx_v_model);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":567
 *         '''The index of this DSD (zero-based)'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.index
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_5index___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_5index___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":568
 * 
 *         def __get__(self):
 *             return self._ptr.index             # <<<<<<<<<<<<<<
 * 
 *     property ds_name:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.index.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":573
 *         '''The dataset name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.ds_name
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7ds_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_7ds_name___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":574
 * 
 *         def __get__(self):
 *             return self._ptr.ds_name             # <<<<<<<<<<<<<<
 * 
 *     property ds_type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->ds_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.ds_name.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":579
 *         '''The dataset type descriptor'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.ds_type
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7ds_type___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_7ds_type___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":580
 * 
 *         def __get__(self):
 *             return self._ptr.ds_type             # <<<<<<<<<<<<<<
 * 
 *     property filename:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->ds_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.ds_type.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":585
 *         '''The filename in the DDDB with the description of this dataset'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.filename
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_8filename___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_8filename___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":586
 * 
 *         def __get__(self):
 *             return self._ptr.filename             # <<<<<<<<<<<<<<
 * 
 *     property ds_offset:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.filename.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":591
 *         '''The offset of dataset-information the product file'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.ds_offset
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_9ds_offset___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_9ds_offset___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":592
 * 
 *         def __get__(self):
 *             return self._ptr.ds_offset             # <<<<<<<<<<<<<<
 * 
 *     property ds_size:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->ds_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.ds_offset.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":597
 *         '''The size of dataset-information in dataset product file'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.ds_size
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7ds_size___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_7ds_size___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":598
 * 
 *         def __get__(self):
 *             return self._ptr.ds_size             # <<<<<<<<<<<<<<
 * 
 *     property num_dsr:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->ds_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.ds_size.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":603
 *         '''The number of dataset records for the given dataset name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.num_dsr
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_7num_dsr___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_7num_dsr___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":604
 * 
 *         def __get__(self):
 *             return self._ptr.num_dsr             # <<<<<<<<<<<<<<
 * 
 *     property dsr_size:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->num_dsr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.num_dsr.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":609
 *         '''The size of dataset record for the given dataset name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.dsr_size
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD_8dsr_size___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD_8dsr_size___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":610
 * 
 *         def __get__(self):
 *             return self._ptr.dsr_size             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr->dsr_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.DSD.dsr_size.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":613
 * 
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.DSD("%s")' % self.ds_name
 * 
 */

static PyObject *__pyx_pf_3epr_3DSD___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":614
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):
 *         return 'epr.DSD("%s")' % self.ds_name             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(self, other, int op):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ds_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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("epr.DSD.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":616
 *         return 'epr.DSD("%s")' % self.ds_name
 * 
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         cdef EPR_SDSD* p1 = (<DSD>self)._ptr
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr
 */

static PyObject *__pyx_pf_3epr_3DSD___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_3epr_3DSD___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  EPR_SDSD *__pyx_v_p1;
  EPR_SDSD *__pyx_v_p2;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__richcmp__");
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_other);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":617
 * 
 *     def __richcmp__(self, other, int op):
 *         cdef EPR_SDSD* p1 = (<DSD>self)._ptr             # <<<<<<<<<<<<<<
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr
 * 
 */
  __pyx_v_p1 = ((struct __pyx_obj_3epr_DSD *)__pyx_v_self)->_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":618
 *     def __richcmp__(self, other, int op):
 *         cdef EPR_SDSD* p1 = (<DSD>self)._ptr
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self, DSD) and isinstance(other, DSD):
 */
  __pyx_v_p2 = ((struct __pyx_obj_3epr_DSD *)__pyx_v_other)->_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":620
 *         cdef EPR_SDSD* p2 = (<DSD>other)._ptr
 * 
 *         if isinstance(self, DSD) and isinstance(other, DSD):             # <<<<<<<<<<<<<<
 *             if op == 2:         # eq
 *                 if p1 == p2:
 */
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_self, ((PyTypeObject *)((PyObject*)__pyx_ptype_3epr_DSD))); 
  if (__pyx_t_1) {
    __pyx_t_2 = PyObject_TypeCheck(__pyx_v_other, ((PyTypeObject *)((PyObject*)__pyx_ptype_3epr_DSD))); 
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":621
 * 
 *         if isinstance(self, DSD) and isinstance(other, DSD):
 *             if op == 2:         # eq             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return True
 */
    switch (__pyx_v_op) {
      case 2:

      /* "/home/antonio/projects/pyepr/src/epr.pyx":622
 *         if isinstance(self, DSD) and isinstance(other, DSD):
 *             if op == 2:         # eq
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return True
 * 
 */
      __pyx_t_3 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":623
 *             if op == 2:         # eq
 *                 if p1 == p2:
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 return ((p1.index     == p2.index) and
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":625
 *                     return True
 * 
 *                 return ((p1.index     == p2.index) and             # <<<<<<<<<<<<<<
 *                         (p1.ds_offset == p2.ds_offset) and
 *                         (p1.ds_size   == p2.ds_size) and
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = (__pyx_v_p1->index == __pyx_v_p2->index);
      if (__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":626
 * 
 *                 return ((p1.index     == p2.index) and
 *                         (p1.ds_offset == p2.ds_offset) and             # <<<<<<<<<<<<<<
 *                         (p1.ds_size   == p2.ds_size) and
 *                         (p1.num_dsr   == p2.num_dsr) and
 */
        __pyx_t_1 = (__pyx_v_p1->ds_offset == __pyx_v_p2->ds_offset);
        if (__pyx_t_1) {

          /* "/home/antonio/projects/pyepr/src/epr.pyx":627
 *                 return ((p1.index     == p2.index) and
 *                         (p1.ds_offset == p2.ds_offset) and
 *                         (p1.ds_size   == p2.ds_size) and             # <<<<<<<<<<<<<<
 *                         (p1.num_dsr   == p2.num_dsr) and
 *                         (p1.dsr_size  == p2.dsr_size)and
 */
          __pyx_t_2 = (__pyx_v_p1->ds_size == __pyx_v_p2->ds_size);
          if (__pyx_t_2) {

            /* "/home/antonio/projects/pyepr/src/epr.pyx":628
 *                         (p1.ds_offset == p2.ds_offset) and
 *                         (p1.ds_size   == p2.ds_size) and
 *                         (p1.num_dsr   == p2.num_dsr) and             # <<<<<<<<<<<<<<
 *                         (p1.dsr_size  == p2.dsr_size)and
 *                         (strcmp(p1.ds_name, p2.ds_name) == 0) and
 */
            __pyx_t_5 = (__pyx_v_p1->num_dsr == __pyx_v_p2->num_dsr);
            if (__pyx_t_5) {

              /* "/home/antonio/projects/pyepr/src/epr.pyx":629
 *                         (p1.ds_size   == p2.ds_size) and
 *                         (p1.num_dsr   == p2.num_dsr) and
 *                         (p1.dsr_size  == p2.dsr_size)and             # <<<<<<<<<<<<<<
 *                         (strcmp(p1.ds_name, p2.ds_name) == 0) and
 *                         (strcmp(p1.ds_type, p2.ds_type) == 0) and
 */
              __pyx_t_6 = (__pyx_v_p1->dsr_size == __pyx_v_p2->dsr_size);
              if (__pyx_t_6) {

                /* "/home/antonio/projects/pyepr/src/epr.pyx":630
 *                         (p1.num_dsr   == p2.num_dsr) and
 *                         (p1.dsr_size  == p2.dsr_size)and
 *                         (strcmp(p1.ds_name, p2.ds_name) == 0) and             # <<<<<<<<<<<<<<
 *                         (strcmp(p1.ds_type, p2.ds_type) == 0) and
 *                         (strcmp(p1.filename, p2.filename) == 0))
 */
                __pyx_t_7 = (strcmp(__pyx_v_p1->ds_name, __pyx_v_p2->ds_name) == 0);
                if (__pyx_t_7) {

                  /* "/home/antonio/projects/pyepr/src/epr.pyx":631
 *                         (p1.dsr_size  == p2.dsr_size)and
 *                         (strcmp(p1.ds_name, p2.ds_name) == 0) and
 *                         (strcmp(p1.ds_type, p2.ds_type) == 0) and             # <<<<<<<<<<<<<<
 *                         (strcmp(p1.filename, p2.filename) == 0))
 * 
 */
                  __pyx_t_8 = (strcmp(__pyx_v_p1->ds_type, __pyx_v_p2->ds_type) == 0);
                  if (__pyx_t_8) {

                    /* "/home/antonio/projects/pyepr/src/epr.pyx":632
 *                         (strcmp(p1.ds_name, p2.ds_name) == 0) and
 *                         (strcmp(p1.ds_type, p2.ds_type) == 0) and
 *                         (strcmp(p1.filename, p2.filename) == 0))             # <<<<<<<<<<<<<<
 * 
 *             elif op == 3:       # ne
 */
                    __pyx_t_9 = (strcmp(__pyx_v_p1->filename, __pyx_v_p2->filename) == 0);
                    __pyx_t_10 = __pyx_t_9;
                  } else {
                    __pyx_t_10 = __pyx_t_8;
                  }
                  __pyx_t_8 = __pyx_t_10;
                } else {
                  __pyx_t_8 = __pyx_t_7;
                }
                __pyx_t_7 = __pyx_t_8;
              } else {
                __pyx_t_7 = __pyx_t_6;
              }
              __pyx_t_6 = __pyx_t_7;
            } else {
              __pyx_t_6 = __pyx_t_5;
            }
            __pyx_t_5 = __pyx_t_6;
          } else {
            __pyx_t_5 = __pyx_t_2;
          }
          __pyx_t_2 = __pyx_t_5;
        } else {
          __pyx_t_2 = __pyx_t_1;
        }
        __pyx_t_1 = __pyx_t_2;
      } else {
        __pyx_t_1 = __pyx_t_3;
      }
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
      break;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":634
 *                         (strcmp(p1.filename, p2.filename) == 0))
 * 
 *             elif op == 3:       # ne             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return False
 */
      case 3:

      /* "/home/antonio/projects/pyepr/src/epr.pyx":635
 * 
 *             elif op == 3:       # ne
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return False
 * 
 */
      __pyx_t_1 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_1) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":636
 *             elif op == 3:       # ne
 *                 if p1 == p2:
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 return ((p1.index     != p2.index) or
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":638
 *                     return False
 * 
 *                 return ((p1.index     != p2.index) or             # <<<<<<<<<<<<<<
 *                         (p1.ds_offset != p2.ds_offset) or
 *                         (p1.ds_size   != p2.ds_size) or
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = (__pyx_v_p1->index != __pyx_v_p2->index);
      if (!__pyx_t_1) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":639
 * 
 *                 return ((p1.index     != p2.index) or
 *                         (p1.ds_offset != p2.ds_offset) or             # <<<<<<<<<<<<<<
 *                         (p1.ds_size   != p2.ds_size) or
 *                         (p1.num_dsr   != p2.num_dsr) or
 */
        __pyx_t_3 = (__pyx_v_p1->ds_offset != __pyx_v_p2->ds_offset);
        if (!__pyx_t_3) {

          /* "/home/antonio/projects/pyepr/src/epr.pyx":640
 *                 return ((p1.index     != p2.index) or
 *                         (p1.ds_offset != p2.ds_offset) or
 *                         (p1.ds_size   != p2.ds_size) or             # <<<<<<<<<<<<<<
 *                         (p1.num_dsr   != p2.num_dsr) or
 *                         (p1.dsr_size  != p2.dsr_size) or
 */
          __pyx_t_2 = (__pyx_v_p1->ds_size != __pyx_v_p2->ds_size);
          if (!__pyx_t_2) {

            /* "/home/antonio/projects/pyepr/src/epr.pyx":641
 *                         (p1.ds_offset != p2.ds_offset) or
 *                         (p1.ds_size   != p2.ds_size) or
 *                         (p1.num_dsr   != p2.num_dsr) or             # <<<<<<<<<<<<<<
 *                         (p1.dsr_size  != p2.dsr_size) or
 *                         (strcmp(p1.ds_name, p2.ds_name) != 0) or
 */
            __pyx_t_5 = (__pyx_v_p1->num_dsr != __pyx_v_p2->num_dsr);
            if (!__pyx_t_5) {

              /* "/home/antonio/projects/pyepr/src/epr.pyx":642
 *                         (p1.ds_size   != p2.ds_size) or
 *                         (p1.num_dsr   != p2.num_dsr) or
 *                         (p1.dsr_size  != p2.dsr_size) or             # <<<<<<<<<<<<<<
 *                         (strcmp(p1.ds_name, p2.ds_name) != 0) or
 *                         (strcmp(p1.ds_type, p2.ds_type) != 0) or
 */
              __pyx_t_6 = (__pyx_v_p1->dsr_size != __pyx_v_p2->dsr_size);
              if (!__pyx_t_6) {

                /* "/home/antonio/projects/pyepr/src/epr.pyx":643
 *                         (p1.num_dsr   != p2.num_dsr) or
 *                         (p1.dsr_size  != p2.dsr_size) or
 *                         (strcmp(p1.ds_name, p2.ds_name) != 0) or             # <<<<<<<<<<<<<<
 *                         (strcmp(p1.ds_type, p2.ds_type) != 0) or
 *                         (strcmp(p1.filename, p2.filename) != 0))
 */
                __pyx_t_7 = (strcmp(__pyx_v_p1->ds_name, __pyx_v_p2->ds_name) != 0);
                if (!__pyx_t_7) {

                  /* "/home/antonio/projects/pyepr/src/epr.pyx":644
 *                         (p1.dsr_size  != p2.dsr_size) or
 *                         (strcmp(p1.ds_name, p2.ds_name) != 0) or
 *                         (strcmp(p1.ds_type, p2.ds_type) != 0) or             # <<<<<<<<<<<<<<
 *                         (strcmp(p1.filename, p2.filename) != 0))
 * 
 */
                  __pyx_t_8 = (strcmp(__pyx_v_p1->ds_type, __pyx_v_p2->ds_type) != 0);
                  if (!__pyx_t_8) {

                    /* "/home/antonio/projects/pyepr/src/epr.pyx":645
 *                         (strcmp(p1.ds_name, p2.ds_name) != 0) or
 *                         (strcmp(p1.ds_type, p2.ds_type) != 0) or
 *                         (strcmp(p1.filename, p2.filename) != 0))             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
                    __pyx_t_10 = (strcmp(__pyx_v_p1->filename, __pyx_v_p2->filename) != 0);
                    __pyx_t_9 = __pyx_t_10;
                  } else {
                    __pyx_t_9 = __pyx_t_8;
                  }
                  __pyx_t_8 = __pyx_t_9;
                } else {
                  __pyx_t_8 = __pyx_t_7;
                }
                __pyx_t_7 = __pyx_t_8;
              } else {
                __pyx_t_7 = __pyx_t_6;
              }
              __pyx_t_6 = __pyx_t_7;
            } else {
              __pyx_t_6 = __pyx_t_5;
            }
            __pyx_t_5 = __pyx_t_6;
          } else {
            __pyx_t_5 = __pyx_t_2;
          }
          __pyx_t_2 = __pyx_t_5;
        } else {
          __pyx_t_2 = __pyx_t_3;
        }
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_1;
      }
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
      break;
      default:

      /* "/home/antonio/projects/pyepr/src/epr.pyx":648
 * 
 *             else:
 *                 raise TypeError # only == and !=             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
      __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":650
 *                 raise TypeError # only == and !=
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr.DSD.__richcmp__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_self);
  __Pyx_DECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":653
 * 
 * 
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static  PyObject *__pyx_f_3epr_new_dsd(EPR_SDSD *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_dsd *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_DSD *__pyx_v_instance = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("new_dsd");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }
  __Pyx_INCREF(__pyx_v_parent);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":654
 * 
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":655
 * cdef new_dsd(EPR_SDSD* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef DSD instance = DSD.__new__(DSD)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":657
 *         pyepr_null_ptr_error()
 * 
 *     cdef DSD instance = DSD.__new__(DSD)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_DSD)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __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_3epr_DSD))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_DSD *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":659
 *     cdef DSD instance = DSD.__new__(DSD)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":660
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":662
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_dsd");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_DECREF(__pyx_v_parent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":678
 *     cdef object _parent
 * 
 *     def print_(self, ostream=None):             # <<<<<<<<<<<<<<
 *         '''Write the field to specified file (default: :data:`sys.stdout`)
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_5Field_print_[] = "Write the field to specified file (default: :data:`sys.stdout`)\n\n        This method writes formatted contents of the field to\n        specified *ostream* text file or (default) the ASCII output\n        is be printed to standard output (:data:`sys.stdout`)\n\n        :param ostream:\n            the (opened) output file object\n\n        .. note:: the *ostream* parameter have to be a *real* file not\n                  a generic stream object like :class:`StringIO` instances\n\n        ";
static PyObject *__pyx_pf_3epr_5Field_print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ostream = 0;
  FILE *__pyx_v_fd;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ostream,0};
  __Pyx_RefNannySetupContext("print_");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ostream);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "print_") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_ostream = values[0];
  } else {
    __pyx_v_ostream = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_ostream = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Field.print_");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_ostream);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":695
 *         cdef FILE* fd
 * 
 *         if ostream is None:             # <<<<<<<<<<<<<<
 *             ostream = sys.stdout
 * 
 */
  __pyx_t_1 = (__pyx_v_ostream == Py_None);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":696
 * 
 *         if ostream is None:
 *             ostream = sys.stdout             # <<<<<<<<<<<<<<
 * 
 *         fd = PyFile_AsFile(ostream)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_ostream);
    __pyx_v_ostream = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":698
 *             ostream = sys.stdout
 * 
 *         fd = PyFile_AsFile(ostream)             # <<<<<<<<<<<<<<
 *         if fd is NULL:
 *             raise TypeError('invalid ostream')
 */
  __pyx_v_fd = PyFile_AsFile(__pyx_v_ostream);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":699
 * 
 *         fd = PyFile_AsFile(ostream)
 *         if fd is NULL:             # <<<<<<<<<<<<<<
 *             raise TypeError('invalid ostream')
 * 
 */
  __pyx_t_1 = (__pyx_v_fd == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":700
 *         fd = PyFile_AsFile(ostream)
 *         if fd is NULL:
 *             raise TypeError('invalid ostream')             # <<<<<<<<<<<<<<
 * 
 *         Py_BEGIN_ALLOW_THREADS
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":702
 *             raise TypeError('invalid ostream')
 * 
 *         Py_BEGIN_ALLOW_THREADS             # <<<<<<<<<<<<<<
 *         epr_print_field(self._ptr, fd)
 *         Py_END_ALLOW_THREADS
 */
  Py_BEGIN_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":703
 * 
 *         Py_BEGIN_ALLOW_THREADS
 *         epr_print_field(self._ptr, fd)             # <<<<<<<<<<<<<<
 *         Py_END_ALLOW_THREADS
 * 
 */
  epr_print_field(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_fd);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":704
 *         Py_BEGIN_ALLOW_THREADS
 *         epr_print_field(self._ptr, fd)
 *         Py_END_ALLOW_THREADS             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
  Py_END_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":706
 *         Py_END_ALLOW_THREADS
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     #def dump_field(self):
 */
  __pyx_t_4 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __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_AddTraceback("epr.Field.print_");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_ostream);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":712
 *     #    pyepr_check_errors()
 * 
 *     def get_unit(self):             # <<<<<<<<<<<<<<
 *         '''Gets the unit of the field'''
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_get_unit(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_get_unit[] = "Gets the unit of the field";
static PyObject *__pyx_pf_3epr_5Field_get_unit(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_unit");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":715
 *         '''Gets the unit of the field'''
 * 
 *         return epr_get_field_unit(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_description(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(epr_get_field_unit(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Field.get_unit");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":717
 *         return epr_get_field_unit(self._ptr)
 * 
 *     def get_description(self):             # <<<<<<<<<<<<<<
 *         '''Gets the description of the field'''
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_get_description(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_get_description[] = "Gets the description of the field";
static PyObject *__pyx_pf_3epr_5Field_get_description(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_description");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":720
 *         '''Gets the description of the field'''
 * 
 *         return epr_get_field_description(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_num_elems(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(epr_get_field_description(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Field.get_description");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":722
 *         return epr_get_field_description(self._ptr)
 * 
 *     def get_num_elems(self):             # <<<<<<<<<<<<<<
 *         '''Gets the number of elements of the field'''
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_get_num_elems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_get_num_elems[] = "Gets the number of elements of the field";
static PyObject *__pyx_pf_3epr_5Field_get_num_elems(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_num_elems");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":725
 *         '''Gets the number of elements of the field'''
 * 
 *         return epr_get_field_num_elems(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_field_num_elems(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Field.get_num_elems");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":727
 *         return epr_get_field_num_elems(self._ptr)
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         '''Gets the name of the field'''
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_get_name(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_get_name[] = "Gets the name of the field";
static PyObject *__pyx_pf_3epr_5Field_get_name(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_name");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":730
 *         '''Gets the name of the field'''
 * 
 *         return epr_get_field_name(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(epr_get_field_name(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Field.get_name");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":732
 *         return epr_get_field_name(self._ptr)
 * 
 *     def get_type(self):             # <<<<<<<<<<<<<<
 *         '''Gets the type of the field'''
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_get_type(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_get_type[] = "Gets the type of the field";
static PyObject *__pyx_pf_3epr_5Field_get_type(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_type");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":735
 *         '''Gets the type of the field'''
 * 
 *         return epr_get_field_type(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_elem(self, uint index=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(epr_get_field_type(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Field.get_type");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":737
 *         return epr_get_field_type(self._ptr)
 * 
 *     def get_elem(self, uint index=0):             # <<<<<<<<<<<<<<
 *         '''Field single element access
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_get_elem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_5Field_get_elem[] = "Field single element access\n\n        This function is for getting the elements of a field.\n\n        :param index:\n            the zero-based index of element to be returned, must not be\n            negative\n        :returns:\n            the typed value from given field\n\n        ";
static PyObject *__pyx_pf_3epr_5Field_get_elem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_index;
  EPR_STime *__pyx_v_eprtime;
  PyObject *__pyx_v_etype;
  PyObject *__pyx_v_val;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,0};
  __Pyx_RefNannySetupContext("get_elem");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_elem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[0]) {
      __pyx_v_index = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_index = ((uint)0);
    }
  } else {
    __pyx_v_index = ((uint)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_index = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_elem", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Field.get_elem");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_etype = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_val = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":751
 * 
 *         cdef EPR_STime* eprtime
 *         etype = epr_get_field_type(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *         if etype == e_tid_uchar:
 */
  __pyx_t_1 = PyInt_FromLong(epr_get_field_type(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_etype);
  __pyx_v_etype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":753
 *         etype = epr_get_field_type(self._ptr)
 * 
 *         if etype == e_tid_uchar:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)
 *         elif etype == e_tid_char:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uchar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":754
 * 
 *         if etype == e_tid_uchar:
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_char:
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uchar(epr_get_field_elem_as_uchar(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":755
 *         if etype == e_tid_uchar:
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)
 *         elif etype == e_tid_char:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 *         elif etype == e_tid_ushort:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":756
 *             val = epr_get_field_elem_as_uchar(self._ptr, index)
 *         elif etype == e_tid_char:
 *             val = epr_get_field_elem_as_char(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_ushort:
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 */
    __pyx_t_1 = PyInt_FromLong(epr_get_field_elem_as_char(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":757
 *         elif etype == e_tid_char:
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 *         elif etype == e_tid_ushort:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 *         elif etype == e_tid_short:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_ushort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":758
 *             val = epr_get_field_elem_as_char(self._ptr, index)
 *         elif etype == e_tid_ushort:
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_short:
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_ushort(epr_get_field_elem_as_ushort(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":759
 *         elif etype == e_tid_ushort:
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 *         elif etype == e_tid_short:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 *         elif etype == e_tid_uint:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_short); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":760
 *             val = epr_get_field_elem_as_ushort(self._ptr, index)
 *         elif etype == e_tid_short:
 *             val = epr_get_field_elem_as_short(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_uint:
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 */
    __pyx_t_1 = PyInt_FromLong(epr_get_field_elem_as_short(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":761
 *         elif etype == e_tid_short:
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 *         elif etype == e_tid_uint:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 *         elif etype == e_tid_int:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":762
 *             val = epr_get_field_elem_as_short(self._ptr, index)
 *         elif etype == e_tid_uint:
 *             val = epr_get_field_elem_as_uint(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_int:
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(epr_get_field_elem_as_uint(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":763
 *         elif etype == e_tid_uint:
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 *         elif etype == e_tid_int:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 *         elif etype == e_tid_float:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":764
 *             val = epr_get_field_elem_as_uint(self._ptr, index)
 *         elif etype == e_tid_int:
 *             val = epr_get_field_elem_as_int(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_float:
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 */
    __pyx_t_1 = PyInt_FromLong(epr_get_field_elem_as_int(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":765
 *         elif etype == e_tid_int:
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 *         elif etype == e_tid_float:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 *         elif etype == e_tid_double:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_float); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":766
 *             val = epr_get_field_elem_as_int(self._ptr, index)
 *         elif etype == e_tid_float:
 *             val = epr_get_field_elem_as_float(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_double:
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 */
    __pyx_t_2 = PyFloat_FromDouble(epr_get_field_elem_as_float(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":767
 *         elif etype == e_tid_float:
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 *         elif etype == e_tid_double:             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 *         elif etype == e_tid_string:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":768
 *             val = epr_get_field_elem_as_float(self._ptr, index)
 *         elif etype == e_tid_double:
 *             val = epr_get_field_elem_as_double(self._ptr, index)             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_string:
 *             if index != 0:
 */
    __pyx_t_1 = PyFloat_FromDouble(epr_get_field_elem_as_double(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr, __pyx_v_index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":769
 *         elif etype == e_tid_double:
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 *         elif etype == e_tid_string:             # <<<<<<<<<<<<<<
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":770
 *             val = epr_get_field_elem_as_double(self._ptr, index)
 *         elif etype == e_tid_string:
 *             if index != 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('invalid index: %d' % index)
 *             val = epr_get_field_elem_as_str(self._ptr)
 */
    __pyx_t_3 = (__pyx_v_index != 0);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":771
 *         elif etype == e_tid_string:
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)             # <<<<<<<<<<<<<<
 *             val = epr_get_field_elem_as_str(self._ptr)
 *         #elif etype == e_tid_spare:
 */
      __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":772
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)
 *             val = epr_get_field_elem_as_str(self._ptr)             # <<<<<<<<<<<<<<
 *         #elif etype == e_tid_spare:
 *         #    val = epr_get_field_elem_as_str(self._ptr)
 */
    __pyx_t_1 = __Pyx_PyBytes_FromString(epr_get_field_elem_as_str(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":775
 *         #elif etype == e_tid_spare:
 *         #    val = epr_get_field_elem_as_str(self._ptr)
 *         elif etype == e_tid_time:             # <<<<<<<<<<<<<<
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":776
 *         #    val = epr_get_field_elem_as_str(self._ptr)
 *         elif etype == e_tid_time:
 *             if index != 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('invalid index: %d' % index)
 * 
 */
    __pyx_t_3 = (__pyx_v_index != 0);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":777
 *         elif etype == e_tid_time:
 *             if index != 0:
 *                 raise ValueError('invalid index: %d' % index)             # <<<<<<<<<<<<<<
 * 
 *             # use casting to silence warnings
 */
      __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":780
 * 
 *             # use casting to silence warnings
 *             eprtime = <EPR_STime*>epr_get_field_elem_as_mjd(self._ptr)             # <<<<<<<<<<<<<<
 *             val = EPRTime(eprtime.days, eprtime.seconds, eprtime.microseconds)
 *         else:
 */
    __pyx_v_eprtime = ((EPR_STime *)epr_get_field_elem_as_mjd(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":781
 *             # use casting to silence warnings
 *             eprtime = <EPR_STime*>epr_get_field_elem_as_mjd(self._ptr)
 *             val = EPRTime(eprtime.days, eprtime.seconds, eprtime.microseconds)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('invalid field type')
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRTime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyInt_FromLong(__pyx_v_eprtime->days); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_eprtime->seconds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_eprtime->microseconds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":783
 *             val = EPRTime(eprtime.days, eprtime.seconds, eprtime.microseconds)
 *         else:
 *             raise ValueError('invalid field type')             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_11));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
    __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":785
 *             raise ValueError('invalid field type')
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 *         return val
 * 
 */
  __pyx_t_7 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/antonio/projects/pyepr/src/epr.pyx":786
 * 
 *         pyepr_check_errors()
 *         return val             # <<<<<<<<<<<<<<
 * 
 *     def get_elems(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Field.get_elem");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_etype);
  __Pyx_DECREF(__pyx_v_val);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":788
 *         return val
 * 
 *     def get_elems(self):             # <<<<<<<<<<<<<<
 *         '''Field array element access
 * 
 */

static PyObject *__pyx_pf_3epr_5Field_get_elems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_5Field_get_elems[] = "Field array element access\n\n        This function is for getting an array of field elements of the\n        field.\n\n        :returns:\n            the data array (:class:`numpy.ndarray`) having the type of\n            the field\n\n        ";
static PyObject *__pyx_pf_3epr_5Field_get_elems(PyObject *__pyx_v_self, PyObject *unused) {
  void *__pyx_v_buf;
  size_t __pyx_v_num_elems;
  size_t __pyx_v_i;
  PyArrayObject *__pyx_v_out;
  PyObject *__pyx_v_etype;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  __Pyx_RefNannySetupContext("get_elems");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_etype = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":806
 *         cdef np.ndarray out
 * 
 *         num_elems = epr_get_field_num_elems(self._ptr)             # <<<<<<<<<<<<<<
 *         etype = epr_get_field_type(self._ptr)
 * 
 */
  __pyx_v_num_elems = epr_get_field_num_elems(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":807
 * 
 *         num_elems = epr_get_field_num_elems(self._ptr)
 *         etype = epr_get_field_type(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *         if etype == e_tid_uchar:
 */
  __pyx_t_1 = PyInt_FromLong(epr_get_field_type(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_etype);
  __pyx_v_etype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":809
 *         etype = epr_get_field_type(self._ptr)
 * 
 *         if etype == e_tid_uchar:             # <<<<<<<<<<<<<<
 *             buf = <uchar*>epr_get_field_elems_char(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uchar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":810
 * 
 *         if etype == e_tid_uchar:
 *             buf = <uchar*>epr_get_field_elems_char(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((uchar *)epr_get_field_elems_char(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":811
 *         if etype == e_tid_uchar:
 *             buf = <uchar*>epr_get_field_elems_char(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.uchar)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":812
 *             buf = <uchar*>epr_get_field_elems_char(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.uchar)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":813
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.uchar)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<uchar*>buf)[i]
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uchar); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":814
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.uchar)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<uchar*>buf)[i]
 *         elif etype == e_tid_char:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":815
 *             out = np.ndarray(num_elems, np.uchar)
 *             for i in range(num_elems):
 *                 out[i] = (<uchar*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_char:
 *             buf = <char*>epr_get_field_elems_uchar(self._ptr)
 */
      __pyx_t_5 = __Pyx_PyInt_to_py_uchar((((uchar *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_5, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":816
 *             for i in range(num_elems):
 *                 out[i] = (<uchar*>buf)[i]
 *         elif etype == e_tid_char:             # <<<<<<<<<<<<<<
 *             buf = <char*>epr_get_field_elems_uchar(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_5 = PyInt_FromLong(e_tid_char); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":817
 *                 out[i] = (<uchar*>buf)[i]
 *         elif etype == e_tid_char:
 *             buf = <char*>epr_get_field_elems_uchar(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((char *)epr_get_field_elems_uchar(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":818
 *         elif etype == e_tid_char:
 *             buf = <char*>epr_get_field_elems_uchar(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.char)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":819
 *             buf = <char*>epr_get_field_elems_uchar(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.char)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":820
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.char)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<char*>buf)[i]
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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 = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":821
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.char)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<char*>buf)[i]
 *         elif etype == e_tid_ushort:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":822
 *             out = np.ndarray(num_elems, np.char)
 *             for i in range(num_elems):
 *                 out[i] = (<char*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_ushort:
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 */
      __pyx_t_2 = PyInt_FromLong((((char *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_2, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":823
 *             for i in range(num_elems):
 *                 out[i] = (<char*>buf)[i]
 *         elif etype == e_tid_ushort:             # <<<<<<<<<<<<<<
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_ushort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":824
 *                 out[i] = (<char*>buf)[i]
 *         elif etype == e_tid_ushort:
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((ushort *)epr_get_field_elems_ushort(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":825
 *         elif etype == e_tid_ushort:
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.ushort)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":826
 *             buf = <ushort*>epr_get_field_elems_ushort(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.ushort)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":827
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.ushort)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<ushort*>buf)[i]
 */
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ushort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":828
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.ushort)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<ushort*>buf)[i]
 *         elif etype == e_tid_short:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":829
 *             out = np.ndarray(num_elems, np.ushort)
 *             for i in range(num_elems):
 *                 out[i] = (<ushort*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_short:
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 */
      __pyx_t_1 = __Pyx_PyInt_to_py_ushort((((ushort *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_1, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":830
 *             for i in range(num_elems):
 *                 out[i] = (<ushort*>buf)[i]
 *         elif etype == e_tid_short:             # <<<<<<<<<<<<<<
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_short); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":831
 *                 out[i] = (<ushort*>buf)[i]
 *         elif etype == e_tid_short:
 *             buf = <short*>epr_get_field_elems_short(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((short *)epr_get_field_elems_short(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":832
 *         elif etype == e_tid_short:
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.short)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":833
 *             buf = <short*>epr_get_field_elems_short(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.short)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":834
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.short)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<short*>buf)[i]
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__short); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":835
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.short)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<short*>buf)[i]
 *         elif etype == e_tid_uint:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":836
 *             out = np.ndarray(num_elems, np.short)
 *             for i in range(num_elems):
 *                 out[i] = (<short*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_uint:
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 */
      __pyx_t_5 = PyInt_FromLong((((short *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_5, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":837
 *             for i in range(num_elems):
 *                 out[i] = (<short*>buf)[i]
 *         elif etype == e_tid_uint:             # <<<<<<<<<<<<<<
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_5 = PyInt_FromLong(e_tid_uint); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":838
 *                 out[i] = (<short*>buf)[i]
 *         elif etype == e_tid_uint:
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((uint *)epr_get_field_elems_uint(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":839
 *         elif etype == e_tid_uint:
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.uint)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":840
 *             buf = <uint*>epr_get_field_elems_uint(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.uint)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":841
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.uint)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<uint*>buf)[i]
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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 = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":842
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.uint)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<uint*>buf)[i]
 *         elif etype == e_tid_int:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":843
 *             out = np.ndarray(num_elems, np.uint)
 *             for i in range(num_elems):
 *                 out[i] = (<uint*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_int:
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 */
      __pyx_t_2 = __Pyx_PyInt_to_py_uint((((uint *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_2, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":844
 *             for i in range(num_elems):
 *                 out[i] = (<uint*>buf)[i]
 *         elif etype == e_tid_int:             # <<<<<<<<<<<<<<
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_2 = PyInt_FromLong(e_tid_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":845
 *                 out[i] = (<uint*>buf)[i]
 *         elif etype == e_tid_int:
 *             buf = <int*>epr_get_field_elems_int(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((int *)epr_get_field_elems_int(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":846
 *         elif etype == e_tid_int:
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.int)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":847
 *             buf = <int*>epr_get_field_elems_int(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.int)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L21;
    }
    __pyx_L21:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":848
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.int)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<int*>buf)[i]
 */
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":849
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.int)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<int*>buf)[i]
 *         elif etype == e_tid_float:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":850
 *             out = np.ndarray(num_elems, np.int)
 *             for i in range(num_elems):
 *                 out[i] = (<int*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_float:
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 */
      __pyx_t_1 = PyInt_FromLong((((int *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_1, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":851
 *             for i in range(num_elems):
 *                 out[i] = (<int*>buf)[i]
 *         elif etype == e_tid_float:             # <<<<<<<<<<<<<<
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_float); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":852
 *                 out[i] = (<int*>buf)[i]
 *         elif etype == e_tid_float:
 *             buf = <float*>epr_get_field_elems_float(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((float *)epr_get_field_elems_float(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":853
 *         elif etype == e_tid_float:
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.float32)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":854
 *             buf = <float*>epr_get_field_elems_float(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.float32)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L24;
    }
    __pyx_L24:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":855
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.float32)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<float*>buf)[i]
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":856
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.float32)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<float*>buf)[i]
 *         elif etype == e_tid_double:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":857
 *             out = np.ndarray(num_elems, np.float32)
 *             for i in range(num_elems):
 *                 out[i] = (<float*>buf)[i]             # <<<<<<<<<<<<<<
 *         elif etype == e_tid_double:
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 */
      __pyx_t_5 = PyFloat_FromDouble((((float *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_5, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":858
 *             for i in range(num_elems):
 *                 out[i] = (<float*>buf)[i]
 *         elif etype == e_tid_double:             # <<<<<<<<<<<<<<
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 *             if buf is NULL:
 */
  __pyx_t_5 = PyInt_FromLong(e_tid_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_etype, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":859
 *                 out[i] = (<float*>buf)[i]
 *         elif etype == e_tid_double:
 *             buf = <double*>epr_get_field_elems_double(self._ptr)             # <<<<<<<<<<<<<<
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 */
    __pyx_v_buf = ((double *)epr_get_field_elems_double(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));

    /* "/home/antonio/projects/pyepr/src/epr.pyx":860
 *         elif etype == e_tid_double:
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 *             if buf is NULL:             # <<<<<<<<<<<<<<
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.double)
 */
    __pyx_t_3 = (__pyx_v_buf == NULL);
    if (__pyx_t_3) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":861
 *             buf = <double*>epr_get_field_elems_double(self._ptr)
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 *             out = np.ndarray(num_elems, np.double)
 *             for i in range(num_elems):
 */
      __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L27;
    }
    __pyx_L27:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":862
 *             if buf is NULL:
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.double)             # <<<<<<<<<<<<<<
 *             for i in range(num_elems):
 *                 out[i] = (<double*>buf)[i]
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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 = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_out));
    __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":863
 *                 pyepr_null_ptr_error()
 *             out = np.ndarray(num_elems, np.double)
 *             for i in range(num_elems):             # <<<<<<<<<<<<<<
 *                 out[i] = (<double*>buf)[i]
 *         else:
 */
    __pyx_t_6 = __pyx_v_num_elems;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":864
 *             out = np.ndarray(num_elems, np.double)
 *             for i in range(num_elems):
 *                 out[i] = (<double*>buf)[i]             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('invalid field type')
 */
      __pyx_t_2 = PyFloat_FromDouble((((double *)__pyx_v_buf)[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_2, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":866
 *                 out[i] = (<double*>buf)[i]
 *         else:
 *             raise ValueError('invalid field type')             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_11));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":868
 *             raise ValueError('invalid field type')
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("epr.Field.get_elems");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_out);
  __Pyx_DECREF(__pyx_v_etype);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":871
 * 
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Field("%s") %d %s elements' % (self.get_name(),
 *                 self.get_num_elems(), data_type_id_to_str(self.get_type()))
 */

static PyObject *__pyx_pf_3epr_5Field___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_5Field___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  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_RefNannySetupContext("__repr__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":872
 *     # --- high level interface ------------------------------------------------
 *     def __repr__(self):
 *         return 'epr.Field("%s") %d %s elements' % (self.get_name(),             # <<<<<<<<<<<<<<
 *                 self.get_num_elems(), data_type_id_to_str(self.get_type()))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":873
 *     def __repr__(self):
 *         return 'epr.Field("%s") %d %s elements' % (self.get_name(),
 *                 self.get_num_elems(), data_type_id_to_str(self.get_type()))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__data_type_id_to_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("epr.Field.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":875
 *                 self.get_num_elems(), data_type_id_to_str(self.get_type()))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef EPR_DataTypeId type_ = self.get_type()
 *         if type_ == e_tid_string:
 */

static PyObject *__pyx_pf_3epr_5Field___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_5Field___str__(PyObject *__pyx_v_self) {
  enum EPR_DataTypeId __pyx_v_type_;
  PyObject *__pyx_v_days;
  PyObject *__pyx_v_seconds;
  PyObject *__pyx_v_microseconds;
  PyObject *__pyx_v_fmt;
  PyObject *__pyx_v_data;
  PyObject *__pyx_v_item;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  enum EPR_DataTypeId __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__str__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_days = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_seconds = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_microseconds = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_fmt = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":876
 * 
 *     def __str__(self):
 *         cdef EPR_DataTypeId type_ = self.get_type()             # <<<<<<<<<<<<<<
 *         if type_ == e_tid_string:
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((enum EPR_DataTypeId)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_type_ = __pyx_t_3;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":877
 *     def __str__(self):
 *         cdef EPR_DataTypeId type_ = self.get_type()
 *         if type_ == e_tid_string:             # <<<<<<<<<<<<<<
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 *         elif type_ == e_tid_time:
 */
  __pyx_t_4 = (__pyx_v_type_ == e_tid_string);
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":878
 *         cdef EPR_DataTypeId type_ = self.get_type()
 *         if type_ == e_tid_string:
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())             # <<<<<<<<<<<<<<
 *         elif type_ == e_tid_time:
 *             days, seconds, microseconds = self.get_elem()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_elem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __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;
    goto __pyx_L5;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":879
 *         if type_ == e_tid_string:
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 *         elif type_ == e_tid_time:             # <<<<<<<<<<<<<<
 *             days, seconds, microseconds = self.get_elem()
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),
 */
  __pyx_t_4 = (__pyx_v_type_ == e_tid_time);
  if (__pyx_t_4) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":880
 *             return '%s = "%s"' % (self.get_name(), self.get_elem())
 *         elif type_ == e_tid_time:
 *             days, seconds, microseconds = self.get_elem()             # <<<<<<<<<<<<<<
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),
 *                                                 days, seconds, microseconds)
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_elem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 3)) {
      PyObject* tuple = __pyx_t_2;
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_days);
      __pyx_v_days = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_seconds);
      __pyx_v_seconds = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v_microseconds);
      __pyx_v_microseconds = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_v_days);
      __pyx_v_days = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_seconds);
      __pyx_v_seconds = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v_microseconds);
      __pyx_v_microseconds = __pyx_t_6;
      __pyx_t_6 = 0;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":881
 *         elif type_ == e_tid_time:
 *             days, seconds, microseconds = self.get_elem()
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),             # <<<<<<<<<<<<<<
 *                                                 days, seconds, microseconds)
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":882
 *             days, seconds, microseconds = self.get_elem()
 *             return '%s = {d=%d, j=%d, m=%d}' % (self.get_name(),
 *                                                 days, seconds, microseconds)             # <<<<<<<<<<<<<<
 *         else:
 *             if type_ == e_tid_uchar:
 */
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_days);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_days);
    __Pyx_GIVEREF(__pyx_v_days);
    __Pyx_INCREF(__pyx_v_seconds);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_seconds);
    __Pyx_GIVEREF(__pyx_v_seconds);
    __Pyx_INCREF(__pyx_v_microseconds);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_microseconds);
    __Pyx_GIVEREF(__pyx_v_microseconds);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":884
 *                                                 days, seconds, microseconds)
 *         else:
 *             if type_ == e_tid_uchar:             # <<<<<<<<<<<<<<
 *                 fmt = '%u'
 *             elif type_ == e_tid_char:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_uchar);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":885
 *         else:
 *             if type_ == e_tid_uchar:
 *                 fmt = '%u'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_char:
 *                 fmt = '%d'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_15));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_15);
      goto __pyx_L6;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":886
 *             if type_ == e_tid_uchar:
 *                 fmt = '%u'
 *             elif type_ == e_tid_char:             # <<<<<<<<<<<<<<
 *                 fmt = '%d'
 *             elif type_ == e_tid_ushort:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_char);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":887
 *                 fmt = '%u'
 *             elif type_ == e_tid_char:
 *                 fmt = '%d'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_ushort:
 *                 fmt = '%u'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_16);
      goto __pyx_L6;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":888
 *             elif type_ == e_tid_char:
 *                 fmt = '%d'
 *             elif type_ == e_tid_ushort:             # <<<<<<<<<<<<<<
 *                 fmt = '%u'
 *             elif type_ == e_tid_short:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_ushort);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":889
 *                 fmt = '%d'
 *             elif type_ == e_tid_ushort:
 *                 fmt = '%u'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_short:
 *                 fmt = '%d'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_15));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_15);
      goto __pyx_L6;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":890
 *             elif type_ == e_tid_ushort:
 *                 fmt = '%u'
 *             elif type_ == e_tid_short:             # <<<<<<<<<<<<<<
 *                 fmt = '%d'
 *             elif type_ == e_tid_uint:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_short);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":891
 *                 fmt = '%u'
 *             elif type_ == e_tid_short:
 *                 fmt = '%d'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_uint:
 *                 fmt = '%u'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_16);
      goto __pyx_L6;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":892
 *             elif type_ == e_tid_short:
 *                 fmt = '%d'
 *             elif type_ == e_tid_uint:             # <<<<<<<<<<<<<<
 *                 fmt = '%u'
 *             elif type_ == e_tid_int:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_uint);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":893
 *                 fmt = '%d'
 *             elif type_ == e_tid_uint:
 *                 fmt = '%u'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_int:
 *                 fmt = '%d'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_15));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_15);
      goto __pyx_L6;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":894
 *             elif type_ == e_tid_uint:
 *                 fmt = '%u'
 *             elif type_ == e_tid_int:             # <<<<<<<<<<<<<<
 *                 fmt = '%d'
 *             elif type_ == e_tid_float:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_int);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":895
 *                 fmt = '%u'
 *             elif type_ == e_tid_int:
 *                 fmt = '%d'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_float:
 *                 fmt = '%f'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_16);
      goto __pyx_L6;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":896
 *             elif type_ == e_tid_int:
 *                 fmt = '%d'
 *             elif type_ == e_tid_float:             # <<<<<<<<<<<<<<
 *                 fmt = '%f'
 *             elif type_ == e_tid_double:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_float);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":897
 *                 fmt = '%d'
 *             elif type_ == e_tid_float:
 *                 fmt = '%f'             # <<<<<<<<<<<<<<
 *             elif type_ == e_tid_double:
 *                 fmt = '%f'
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_17));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_17);
      goto __pyx_L6;
    }

    /* "/home/antonio/projects/pyepr/src/epr.pyx":898
 *             elif type_ == e_tid_float:
 *                 fmt = '%f'
 *             elif type_ == e_tid_double:             # <<<<<<<<<<<<<<
 *                 fmt = '%f'
 *             else:
 */
    __pyx_t_4 = (__pyx_v_type_ == e_tid_double);
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":899
 *                 fmt = '%f'
 *             elif type_ == e_tid_double:
 *                 fmt = '%f'             # <<<<<<<<<<<<<<
 *             else:
 *                 if self.get_num_elems() > 1:
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_17));
      __Pyx_DECREF(__pyx_v_fmt);
      __pyx_v_fmt = ((PyObject *)__pyx_kp_s_17);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":901
 *                 fmt = '%f'
 *             else:
 *                 if self.get_num_elems() > 1:             # <<<<<<<<<<<<<<
 *                     data = ['<<unknown data type>>'] * self.get_elems()
 *                     data = ', '.join(data)
 */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_elems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_int_1, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_4) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":902
 *             else:
 *                 if self.get_num_elems() > 1:
 *                     data = ['<<unknown data type>>'] * self.get_elems()             # <<<<<<<<<<<<<<
 *                     data = ', '.join(data)
 *                     return '%s = {%s}' % (self.get_name(), data)
 */
        __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
        PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_18));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_t_6), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_data);
        __pyx_v_data = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "/home/antonio/projects/pyepr/src/epr.pyx":903
 *                 if self.get_num_elems() > 1:
 *                     data = ['<<unknown data type>>'] * self.get_elems()
 *                     data = ', '.join(data)             # <<<<<<<<<<<<<<
 *                     return '%s = {%s}' % (self.get_name(), data)
 *                 else:
 */
        __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_19), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        __pyx_t_6 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __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_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_data);
        __pyx_v_data = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "/home/antonio/projects/pyepr/src/epr.pyx":904
 *                     data = ['<<unknown data type>>'] * self.get_elems()
 *                     data = ', '.join(data)
 *                     return '%s = {%s}' % (self.get_name(), data)             # <<<<<<<<<<<<<<
 *                 else:
 *                     return '%s = <<unknown data type>>' % (self.get_name())
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __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 = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":906
 *                     return '%s = {%s}' % (self.get_name(), data)
 *                 else:
 *                     return '%s = <<unknown data type>>' % (self.get_name())             # <<<<<<<<<<<<<<
 * 
 *             if self.get_num_elems() > 1:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      __pyx_L7:;
    }
    __pyx_L6:;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":908
 *                     return '%s = <<unknown data type>>' % (self.get_name())
 * 
 *             if self.get_num_elems() > 1:             # <<<<<<<<<<<<<<
 *                 data = ', '.join([fmt % item for item in self.get_elems()])
 *                 return '%s = {%s}' % (self.get_name(), data)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_elems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_int_1, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":909
 * 
 *             if self.get_num_elems() > 1:
 *                 data = ', '.join([fmt % item for item in self.get_elems()])             # <<<<<<<<<<<<<<
 *                 return '%s = {%s}' % (self.get_name(), data)
 *             else:
 */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_19), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_8 = 0; __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2);
      } else {
        __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++;
        } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++;
        } else {
          __pyx_t_5 = PyIter_Next(__pyx_t_2);
          if (!__pyx_t_5) {
            if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_DECREF(__pyx_v_item);
        __pyx_v_item = __pyx_t_5;
        __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Remainder(__pyx_v_fmt, __pyx_v_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = PyList_Append(__pyx_t_6, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_t_6));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_data);
      __pyx_v_data = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":910
 *             if self.get_num_elems() > 1:
 *                 data = ', '.join([fmt % item for item in self.get_elems()])
 *                 return '%s = {%s}' % (self.get_name(), data)             # <<<<<<<<<<<<<<
 *             else:
 *                 return '%s = %s' % (self.get_name(), fmt % self.get_elem())
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __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 = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":912
 *                 return '%s = {%s}' % (self.get_name(), data)
 *             else:
 *                 return '%s = %s' % (self.get_name(), fmt % self.get_elem())             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(self, other, int op):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); 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_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_elem); 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_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Remainder(__pyx_v_fmt, __pyx_t_1); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_6 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), __pyx_t_1); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }
    __pyx_L8:;
  }
  __pyx_L5:;

  __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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("epr.Field.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_days);
  __Pyx_DECREF(__pyx_v_seconds);
  __Pyx_DECREF(__pyx_v_microseconds);
  __Pyx_DECREF(__pyx_v_fmt);
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_DECREF(__pyx_v_item);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":914
 *                 return '%s = %s' % (self.get_name(), fmt % self.get_elem())
 * 
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         cdef size_t n
 *         cdef EPR_SField* p1 = (<Field>self)._ptr
 */

static PyObject *__pyx_pf_3epr_5Field___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_3epr_5Field___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  size_t __pyx_v_n;
  EPR_SField *__pyx_v_p1;
  EPR_SField *__pyx_v_p2;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__richcmp__");
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_other);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":916
 *     def __richcmp__(self, other, int op):
 *         cdef size_t n
 *         cdef EPR_SField* p1 = (<Field>self)._ptr             # <<<<<<<<<<<<<<
 *         cdef EPR_SField* p2 = (<Field>other)._ptr
 * 
 */
  __pyx_v_p1 = ((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":917
 *         cdef size_t n
 *         cdef EPR_SField* p1 = (<Field>self)._ptr
 *         cdef EPR_SField* p2 = (<Field>other)._ptr             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self, Field) and isinstance(other, Field):
 */
  __pyx_v_p2 = ((struct __pyx_obj_3epr_Field *)__pyx_v_other)->_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":919
 *         cdef EPR_SField* p2 = (<Field>other)._ptr
 * 
 *         if isinstance(self, Field) and isinstance(other, Field):             # <<<<<<<<<<<<<<
 *             if op == 2:         # eq
 *                 if p1 == p2:
 */
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_self, ((PyTypeObject *)((PyObject*)__pyx_ptype_3epr_Field))); 
  if (__pyx_t_1) {
    __pyx_t_2 = PyObject_TypeCheck(__pyx_v_other, ((PyTypeObject *)((PyObject*)__pyx_ptype_3epr_Field))); 
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":920
 * 
 *         if isinstance(self, Field) and isinstance(other, Field):
 *             if op == 2:         # eq             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return True
 */
    switch (__pyx_v_op) {
      case 2:

      /* "/home/antonio/projects/pyepr/src/epr.pyx":921
 *         if isinstance(self, Field) and isinstance(other, Field):
 *             if op == 2:         # eq
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return True
 * 
 */
      __pyx_t_3 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":922
 *             if op == 2:         # eq
 *                 if p1 == p2:
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":925
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 *                             epr_get_field_num_elems(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or
 */
      __pyx_t_3 = (epr_get_field_num_elems(__pyx_v_p1) != epr_get_field_num_elems(__pyx_v_p2));
      if (!__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":927
 *                             epr_get_field_num_elems(p2)) or
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (strcmp(epr_get_field_unit(p1),
 */
        __pyx_t_1 = (epr_get_field_type(__pyx_v_p1) != epr_get_field_type(__pyx_v_p2));
        if (!__pyx_t_1) {

          /* "/home/antonio/projects/pyepr/src/epr.pyx":930
 * 
 *                     (strcmp(epr_get_field_unit(p1),
 *                             epr_get_field_unit(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (strcmp(epr_get_field_description(p1),
 */
          __pyx_t_2 = (strcmp(epr_get_field_unit(__pyx_v_p1), epr_get_field_unit(__pyx_v_p2)) != 0);
          if (!__pyx_t_2) {

            /* "/home/antonio/projects/pyepr/src/epr.pyx":933
 * 
 *                     (strcmp(epr_get_field_description(p1),
 *                             epr_get_field_description(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (strcmp(epr_get_field_name(p1),
 */
            __pyx_t_5 = (strcmp(epr_get_field_description(__pyx_v_p1), epr_get_field_description(__pyx_v_p2)) != 0);
            if (!__pyx_t_5) {

              /* "/home/antonio/projects/pyepr/src/epr.pyx":936
 * 
 *                     (strcmp(epr_get_field_name(p1),
 *                             epr_get_field_name(p2)) != 0)):             # <<<<<<<<<<<<<<
 * 
 *                     return False
 */
              __pyx_t_6 = (strcmp(epr_get_field_name(__pyx_v_p1), epr_get_field_name(__pyx_v_p2)) != 0);
              __pyx_t_7 = __pyx_t_6;
            } else {
              __pyx_t_7 = __pyx_t_5;
            }
            __pyx_t_5 = __pyx_t_7;
          } else {
            __pyx_t_5 = __pyx_t_2;
          }
          __pyx_t_2 = __pyx_t_5;
        } else {
          __pyx_t_2 = __pyx_t_1;
        }
        __pyx_t_1 = __pyx_t_2;
      } else {
        __pyx_t_1 = __pyx_t_3;
      }
      if (__pyx_t_1) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":938
 *                             epr_get_field_name(p2)) != 0)):
 * 
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":940
 *                     return False
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))             # <<<<<<<<<<<<<<
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)
 */
      __pyx_v_n = epr_get_data_type_size(epr_get_field_type(__pyx_v_p1));

      /* "/home/antonio/projects/pyepr/src/epr.pyx":941
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:             # <<<<<<<<<<<<<<
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 */
      __pyx_t_1 = (__pyx_v_n != 0);
      if (__pyx_t_1) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":942
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)             # <<<<<<<<<<<<<<
 *                 #pyepr_check_errors()
 *                 if n <= 0:
 */
        __pyx_v_n *= epr_get_field_num_elems(__pyx_v_p1);
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":944
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 *                 if n <= 0:             # <<<<<<<<<<<<<<
 *                     # @TODO: check
 *                     return True
 */
      __pyx_t_1 = (__pyx_v_n <= 0);
      if (__pyx_t_1) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":946
 *                 if n <= 0:
 *                     # @TODO: check
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 return (memcmp(p1.elems, p2.elems, n) == 0)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L9;
      }
      __pyx_L9:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":948
 *                     return True
 * 
 *                 return (memcmp(p1.elems, p2.elems, n) == 0)             # <<<<<<<<<<<<<<
 * 
 *             elif op == 3:       # ne
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_p1->elems, __pyx_v_p2->elems, __pyx_v_n) == 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
      break;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":950
 *                 return (memcmp(p1.elems, p2.elems, n) == 0)
 * 
 *             elif op == 3:       # ne             # <<<<<<<<<<<<<<
 *                 if p1 == p2:
 *                     return False
 */
      case 3:

      /* "/home/antonio/projects/pyepr/src/epr.pyx":951
 * 
 *             elif op == 3:       # ne
 *                 if p1 == p2:             # <<<<<<<<<<<<<<
 *                     return False
 * 
 */
      __pyx_t_1 = (__pyx_v_p1 == __pyx_v_p2);
      if (__pyx_t_1) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":952
 *             elif op == 3:       # ne
 *                 if p1 == p2:
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":955
 * 
 *                 if ((epr_get_field_num_elems(p1) !=
 *                             epr_get_field_num_elems(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or
 */
      __pyx_t_1 = (epr_get_field_num_elems(__pyx_v_p1) != epr_get_field_num_elems(__pyx_v_p2));
      if (!__pyx_t_1) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":957
 *                             epr_get_field_num_elems(p2)) or
 * 
 *                     (epr_get_field_type(p1) != epr_get_field_type(p2)) or             # <<<<<<<<<<<<<<
 * 
 *                     (strcmp(epr_get_field_unit(p1),
 */
        __pyx_t_3 = (epr_get_field_type(__pyx_v_p1) != epr_get_field_type(__pyx_v_p2));
        if (!__pyx_t_3) {

          /* "/home/antonio/projects/pyepr/src/epr.pyx":960
 * 
 *                     (strcmp(epr_get_field_unit(p1),
 *                             epr_get_field_unit(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (strcmp(epr_get_field_description(p1),
 */
          __pyx_t_2 = (strcmp(epr_get_field_unit(__pyx_v_p1), epr_get_field_unit(__pyx_v_p2)) != 0);
          if (!__pyx_t_2) {

            /* "/home/antonio/projects/pyepr/src/epr.pyx":963
 * 
 *                     (strcmp(epr_get_field_description(p1),
 *                             epr_get_field_description(p2)) != 0) or             # <<<<<<<<<<<<<<
 * 
 *                     (strcmp(epr_get_field_name(p1),
 */
            __pyx_t_5 = (strcmp(epr_get_field_description(__pyx_v_p1), epr_get_field_description(__pyx_v_p2)) != 0);
            if (!__pyx_t_5) {

              /* "/home/antonio/projects/pyepr/src/epr.pyx":966
 * 
 *                     (strcmp(epr_get_field_name(p1),
 *                             epr_get_field_name(p2)) != 0)):             # <<<<<<<<<<<<<<
 * 
 *                     return True
 */
              __pyx_t_7 = (strcmp(epr_get_field_name(__pyx_v_p1), epr_get_field_name(__pyx_v_p2)) != 0);
              __pyx_t_6 = __pyx_t_7;
            } else {
              __pyx_t_6 = __pyx_t_5;
            }
            __pyx_t_5 = __pyx_t_6;
          } else {
            __pyx_t_5 = __pyx_t_2;
          }
          __pyx_t_2 = __pyx_t_5;
        } else {
          __pyx_t_2 = __pyx_t_3;
        }
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_1;
      }
      if (__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":968
 *                             epr_get_field_name(p2)) != 0)):
 * 
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":970
 *                     return True
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))             # <<<<<<<<<<<<<<
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)
 */
      __pyx_v_n = epr_get_data_type_size(epr_get_field_type(__pyx_v_p1));

      /* "/home/antonio/projects/pyepr/src/epr.pyx":971
 * 
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:             # <<<<<<<<<<<<<<
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 */
      __pyx_t_3 = (__pyx_v_n != 0);
      if (__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":972
 *                 n = epr_get_data_type_size(epr_get_field_type(p1))
 *                 if n != 0:
 *                     n *= epr_get_field_num_elems(p1)             # <<<<<<<<<<<<<<
 *                 #pyepr_check_errors()
 *                 if n <= 0:
 */
        __pyx_v_n *= epr_get_field_num_elems(__pyx_v_p1);
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":974
 *                     n *= epr_get_field_num_elems(p1)
 *                 #pyepr_check_errors()
 *                 if n <= 0:             # <<<<<<<<<<<<<<
 *                     # @TODO: check
 *                     return False
 */
      __pyx_t_3 = (__pyx_v_n <= 0);
      if (__pyx_t_3) {

        /* "/home/antonio/projects/pyepr/src/epr.pyx":976
 *                 if n <= 0:
 *                     # @TODO: check
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 return (memcmp(p1.elems, p2.elems, n) != 0)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "/home/antonio/projects/pyepr/src/epr.pyx":978
 *                     return False
 * 
 *                 return (memcmp(p1.elems, p2.elems, n) != 0)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_p1->elems, __pyx_v_p2->elems, __pyx_v_n) != 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
      break;
      default:

      /* "/home/antonio/projects/pyepr/src/epr.pyx":981
 * 
 *             else:
 *                 raise TypeError # only == and !=             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
      __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":983
 *                 raise TypeError # only == and !=
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr.Field.__richcmp__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_self);
  __Pyx_DECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":985
 *             return NotImplemented
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if epr_get_field_type(self._ptr) == e_tid_string:
 *             return strlen(epr_get_field_elem_as_str(self._ptr))
 */

static Py_ssize_t __pyx_pf_3epr_5Field___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_3epr_5Field___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__len__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":986
 * 
 *     def __len__(self):
 *         if epr_get_field_type(self._ptr) == e_tid_string:             # <<<<<<<<<<<<<<
 *             return strlen(epr_get_field_elem_as_str(self._ptr))
 *         else:
 */
  __pyx_t_1 = (epr_get_field_type(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr) == e_tid_string);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":987
 *     def __len__(self):
 *         if epr_get_field_type(self._ptr) == e_tid_string:
 *             return strlen(epr_get_field_elem_as_str(self._ptr))             # <<<<<<<<<<<<<<
 *         else:
 *             return epr_get_field_num_elems(self._ptr)
 */
    __pyx_r = strlen(epr_get_field_elem_as_str(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr));
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":989
 *             return strlen(epr_get_field_elem_as_str(self._ptr))
 *         else:
 *             return epr_get_field_num_elems(self._ptr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = epr_get_field_num_elems(((struct __pyx_obj_3epr_Field *)__pyx_v_self)->_ptr);
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":992
 * 
 * 
 * cdef new_field(EPR_SField* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static  PyObject *__pyx_f_3epr_new_field(EPR_SField *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_field *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Field *__pyx_v_instance = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("new_field");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }
  __Pyx_INCREF(__pyx_v_parent);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":993
 * 
 * cdef new_field(EPR_SField* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":994
 * cdef new_field(EPR_SField* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Field instance = Field.__new__(Field)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":996
 *         pyepr_null_ptr_error()
 * 
 *     cdef Field instance = Field.__new__(Field)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Field)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __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_3epr_Field))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Field *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":998
 *     cdef Field instance = Field.__new__(Field)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":999
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1001
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_field");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_DECREF(__pyx_v_parent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1017
 *     cdef bint _dealloc
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if not self._dealloc:
 *             return
 */

static void __pyx_pf_3epr_6Record___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_3epr_6Record___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__dealloc__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1018
 * 
 *     def __dealloc__(self):
 *         if not self._dealloc:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = (!((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_dealloc);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1019
 *     def __dealloc__(self):
 *         if not self._dealloc:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if self._ptr is not NULL:
 */
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1021
 *             return
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             epr_free_record(self._ptr)
 *             pyepr_check_errors()
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr != NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1022
 * 
 *         if self._ptr is not NULL:
 *             epr_free_record(self._ptr)             # <<<<<<<<<<<<<<
 *             pyepr_check_errors()
 * 
 */
    epr_free_record(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr);

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1023
 *         if self._ptr is not NULL:
 *             epr_free_record(self._ptr)
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def get_num_fields(self):
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("epr.Record.__dealloc__");
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1025
 *             pyepr_check_errors()
 * 
 *     def get_num_fields(self):             # <<<<<<<<<<<<<<
 *         '''Gets the number of fields contained in the record'''
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_get_num_fields(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Record_get_num_fields[] = "Gets the number of fields contained in the record";
static PyObject *__pyx_pf_3epr_6Record_get_num_fields(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_num_fields");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1028
 *         '''Gets the number of fields contained in the record'''
 * 
 *         return epr_get_num_fields(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def print_(self, ostream=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_fields(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Record.get_num_fields");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1030
 *         return epr_get_num_fields(self._ptr)
 * 
 *     def print_(self, ostream=None):             # <<<<<<<<<<<<<<
 *         '''Write the record to specified file
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_6Record_print_[] = "Write the record to specified file\n\n        This method writes formatted contents of the record to\n        specified *ostream* text file or (default) the ASCII output\n        is be printed to standard output (:data:`sys.stdout`)\n\n        :param ostream:\n            the (opened) output file object\n\n        .. note:: the *ostream* parameter have to be a *real* file not\n                  a generic stream object like :class:`StringIO`\n                  instances\n\n        ";
static PyObject *__pyx_pf_3epr_6Record_print_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ostream = 0;
  FILE *__pyx_v_fd;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ostream,0};
  __Pyx_RefNannySetupContext("print_");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ostream);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "print_") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_ostream = values[0];
  } else {
    __pyx_v_ostream = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_ostream = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Record.print_");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_ostream);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1048
 *         cdef FILE* fd
 * 
 *         if ostream is None:             # <<<<<<<<<<<<<<
 *             ostream = sys.stdout
 * 
 */
  __pyx_t_1 = (__pyx_v_ostream == Py_None);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1049
 * 
 *         if ostream is None:
 *             ostream = sys.stdout             # <<<<<<<<<<<<<<
 * 
 *         fd = PyFile_AsFile(ostream)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_ostream);
    __pyx_v_ostream = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1051
 *             ostream = sys.stdout
 * 
 *         fd = PyFile_AsFile(ostream)             # <<<<<<<<<<<<<<
 *         if fd is NULL:
 *             raise TypeError('invalid ostream')
 */
  __pyx_v_fd = PyFile_AsFile(__pyx_v_ostream);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1052
 * 
 *         fd = PyFile_AsFile(ostream)
 *         if fd is NULL:             # <<<<<<<<<<<<<<
 *             raise TypeError('invalid ostream')
 * 
 */
  __pyx_t_1 = (__pyx_v_fd == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1053
 *         fd = PyFile_AsFile(ostream)
 *         if fd is NULL:
 *             raise TypeError('invalid ostream')             # <<<<<<<<<<<<<<
 * 
 *         Py_BEGIN_ALLOW_THREADS
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1055
 *             raise TypeError('invalid ostream')
 * 
 *         Py_BEGIN_ALLOW_THREADS             # <<<<<<<<<<<<<<
 *         epr_print_record(self._ptr, fd)
 *         Py_END_ALLOW_THREADS
 */
  Py_BEGIN_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1056
 * 
 *         Py_BEGIN_ALLOW_THREADS
 *         epr_print_record(self._ptr, fd)             # <<<<<<<<<<<<<<
 *         Py_END_ALLOW_THREADS
 * 
 */
  epr_print_record(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr, __pyx_v_fd);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1057
 *         Py_BEGIN_ALLOW_THREADS
 *         epr_print_record(self._ptr, fd)
 *         Py_END_ALLOW_THREADS             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
  Py_END_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1059
 *         Py_END_ALLOW_THREADS
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def print_element(self, uint field_index, uint element_index, ostream=None):
 */
  __pyx_t_4 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __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_AddTraceback("epr.Record.print_");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_ostream);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1061
 *         pyepr_check_errors()
 * 
 *     def print_element(self, uint field_index, uint element_index, ostream=None):             # <<<<<<<<<<<<<<
 *         '''Write the specified field element to file
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_print_element(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_6Record_print_element[] = "Write the specified field element to file\n\n        This method writes formatted contents of the specified field\n        element to the *ostream* text file or (default) the ASCII output\n        will be printed to standard output (:data:`sys.stdout`)\n\n        :param field_index:\n            the index of field in the record\n        :param element_index:\n            the index of element in the specified field\n        :param ostream:\n            the (opened) output file object\n\n        .. note:: the *ostream* parameter have to be a *real* file not\n                  a generic stream object like :class:`StringIO`\n                  instances\n\n        ";
static PyObject *__pyx_pf_3epr_6Record_print_element(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_field_index;
  uint __pyx_v_element_index;
  PyObject *__pyx_v_ostream = 0;
  FILE *__pyx_v_fd;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__field_index,&__pyx_n_s__element_index,&__pyx_n_s__ostream,0};
  __Pyx_RefNannySetupContext("print_element");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    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);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__field_index);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__element_index);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("print_element", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ostream);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "print_element") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_field_index = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_field_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_element_index = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_element_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ostream = values[2];
  } else {
    __pyx_v_ostream = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_ostream = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2:
      __pyx_v_element_index = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_element_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_field_index = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_field_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_element", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Record.print_element");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_ostream);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1083
 *         cdef FILE* fd
 * 
 *         if ostream is None:             # <<<<<<<<<<<<<<
 *             ostream = sys.stdout
 * 
 */
  __pyx_t_1 = (__pyx_v_ostream == Py_None);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1084
 * 
 *         if ostream is None:
 *             ostream = sys.stdout             # <<<<<<<<<<<<<<
 * 
 *         fd = PyFile_AsFile(ostream)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_ostream);
    __pyx_v_ostream = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1086
 *             ostream = sys.stdout
 * 
 *         fd = PyFile_AsFile(ostream)             # <<<<<<<<<<<<<<
 *         if fd is NULL:
 *             raise TypeError('invalid ostream')
 */
  __pyx_v_fd = PyFile_AsFile(__pyx_v_ostream);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1087
 * 
 *         fd = PyFile_AsFile(ostream)
 *         if fd is NULL:             # <<<<<<<<<<<<<<
 *             raise TypeError('invalid ostream')
 * 
 */
  __pyx_t_1 = (__pyx_v_fd == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1088
 *         fd = PyFile_AsFile(ostream)
 *         if fd is NULL:
 *             raise TypeError('invalid ostream')             # <<<<<<<<<<<<<<
 * 
 *         Py_BEGIN_ALLOW_THREADS
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1090
 *             raise TypeError('invalid ostream')
 * 
 *         Py_BEGIN_ALLOW_THREADS             # <<<<<<<<<<<<<<
 *         epr_print_element(self._ptr, field_index, element_index, fd)
 *         Py_END_ALLOW_THREADS
 */
  Py_BEGIN_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1091
 * 
 *         Py_BEGIN_ALLOW_THREADS
 *         epr_print_element(self._ptr, field_index, element_index, fd)             # <<<<<<<<<<<<<<
 *         Py_END_ALLOW_THREADS
 * 
 */
  epr_print_element(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr, __pyx_v_field_index, __pyx_v_element_index, __pyx_v_fd);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1092
 *         Py_BEGIN_ALLOW_THREADS
 *         epr_print_element(self._ptr, field_index, element_index, fd)
 *         Py_END_ALLOW_THREADS             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()
 */
  Py_END_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1094
 *         Py_END_ALLOW_THREADS
 * 
 *         pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def get_field(self, name):
 */
  __pyx_t_4 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __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_AddTraceback("epr.Record.print_element");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_ostream);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1096
 *         pyepr_check_errors()
 * 
 *     def get_field(self, name):             # <<<<<<<<<<<<<<
 *         '''Gets a field specified by name
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_3epr_6Record_get_field[] = "Gets a field specified by name\n\n        The field is here identified through the given name.\n        It contains the field info and all corresponding values.\n\n        :param name:\n            the the name of required field\n        :returns:\n            the specified :class:`Field` or raises an exception\n            (:class:`EPRValueError`) if an error occurred\n\n        ";
static PyObject *__pyx_pf_3epr_6Record_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  EPR_SField *__pyx_v_field_ptr;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_field __pyx_t_6;
  __Pyx_RefNannySetupContext("get_field");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_name);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1111
 * 
 *         cdef EPR_SField* field_ptr
 *         field_ptr = <EPR_SField*>epr_get_field(self._ptr, name)             # <<<<<<<<<<<<<<
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)
 */
  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_field_ptr = ((EPR_SField *)epr_get_field(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr, __pyx_t_1));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1112
 *         cdef EPR_SField* field_ptr
 *         field_ptr = <EPR_SField*>epr_get_field(self._ptr, name)
 *         if field_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)
 * 
 */
  __pyx_t_2 = (__pyx_v_field_ptr == NULL);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1113
 *         field_ptr = <EPR_SField*>epr_get_field(self._ptr, name)
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)             # <<<<<<<<<<<<<<
 * 
 *         return new_field(field_ptr, self)
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1115
 *             pyepr_null_ptr_error('unable to get field "%s"' % name)
 * 
 *         return new_field(field_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_field_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = __pyx_v_self;
  __pyx_t_3 = __pyx_f_3epr_new_field(__pyx_v_field_ptr, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Record.get_field");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1117
 *         return new_field(field_ptr, self)
 * 
 *     def get_field_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''Gets a field at the specified position within the record
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_get_field_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_6Record_get_field_at[] = "Gets a field at the specified position within the record\n\n        :param index:\n            the zero-based index (position within record) of the field\n        :returns:\n            the field or raises and exception (:class:`EPRValueError`)\n            if an error occurred\n\n        ";
static PyObject *__pyx_pf_3epr_6Record_get_field_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  EPR_SField *__pyx_v_field_ptr;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_field __pyx_t_6;
  __Pyx_RefNannySetupContext("get_field_at");
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Record.get_field_at");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1129
 * 
 *         cdef EPR_SField* field_ptr
 *         field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)
 */
  __pyx_v_field_ptr = ((EPR_SField *)epr_get_field_at(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr, __pyx_v_index));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1130
 *         cdef EPR_SField* field_ptr
 *         field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, index)
 *         if field_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_field_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1131
 *         field_ptr = <EPR_SField*>epr_get_field_at(self._ptr, index)
 *         if field_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_field(field_ptr, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __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_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1133
 *             pyepr_null_ptr_error('unable to get field at index %d' % index)
 * 
 *         return new_field(field_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = __pyx_v_self;
  __pyx_t_3 = __pyx_f_3epr_new_field(__pyx_v_field_ptr, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Record.get_field_at");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1136
 * 
 *     # --- high level interface ------------------------------------------------
 *     def get_field_names(self):             # <<<<<<<<<<<<<<
 *         '''Return the list of names of the fields in the product
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_get_field_names(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Record_get_field_names[] = "Return the list of names of the fields in the product\n\n        .. note:: this method has no correspondent in the C API\n\n        ";
static PyObject *__pyx_pf_3epr_6Record_get_field_names(PyObject *__pyx_v_self, PyObject *unused) {
  EPR_SField *__pyx_v_field_ptr;
  int __pyx_v_idx;
  PyObject *__pyx_v_names;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("get_field_names");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_names = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1145
 *         cdef EPR_SField* field_ptr
 *         cdef int idx
 *         names = []             # <<<<<<<<<<<<<<
 *         for idx in range(self.get_num_fields()):
 *             field_ptr = epr_get_field_at(self._ptr, idx)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_names);
  __pyx_v_names = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1146
 *         cdef int idx
 *         names = []
 *         for idx in range(self.get_num_fields()):             # <<<<<<<<<<<<<<
 *             field_ptr = epr_get_field_at(self._ptr, idx)
 *             names.append(epr_get_field_name(field_ptr))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_idx = __pyx_t_4;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1147
 *         names = []
 *         for idx in range(self.get_num_fields()):
 *             field_ptr = epr_get_field_at(self._ptr, idx)             # <<<<<<<<<<<<<<
 *             names.append(epr_get_field_name(field_ptr))
 * 
 */
    __pyx_v_field_ptr = epr_get_field_at(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr, __pyx_v_idx);

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1148
 *         for idx in range(self.get_num_fields()):
 *             field_ptr = epr_get_field_at(self._ptr, idx)
 *             names.append(epr_get_field_name(field_ptr))             # <<<<<<<<<<<<<<
 * 
 *         return names
 */
    __pyx_t_2 = __Pyx_PyBytes_FromString(epr_get_field_name(__pyx_v_field_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_names, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1150
 *             names.append(epr_get_field_name(field_ptr))
 * 
 *         return names             # <<<<<<<<<<<<<<
 * 
 *     # @NOTE: generator and generator expressions are not yet implemented in
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_names);
  __pyx_r = __pyx_v_names;
  goto __pyx_L0;

  __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("epr.Record.get_field_names");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_names);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1154
 *     # @NOTE: generator and generator expressions are not yet implemented in
 *     #        cython. As a workaround a list is used
 *     def fields(self):             # <<<<<<<<<<<<<<
 *         '''Return the list of fields contained in the record'''
 * 
 */

static PyObject *__pyx_pf_3epr_6Record_fields(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Record_fields[] = "Return the list of fields contained in the record";
static PyObject *__pyx_pf_3epr_6Record_fields(PyObject *__pyx_v_self, PyObject *unused) {
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  uint __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("fields");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1160
 *         #return list(self)
 *         cdef int idx
 *         return [self.get_field_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_fields(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1161
 *         cdef int idx
 *         return [self.get_field_at(idx)
 *                             for idx in range(epr_get_num_fields(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = epr_get_num_fields(((struct __pyx_obj_3epr_Record *)__pyx_v_self)->_ptr);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_idx = __pyx_t_3;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1160
 *         #return list(self)
 *         cdef int idx
 *         return [self.get_field_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_fields(self._ptr))]
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_field_at); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __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 = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __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 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Record.fields");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1163
 *                             for idx in range(epr_get_num_fields(self._ptr))]
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # @TODO: use generator expression when it will be available
 *         #return (self.get_field_at(idx)
 */

static PyObject *__pyx_pf_3epr_6Record___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Record___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1167
 *         #return (self.get_field_at(idx)
 *         #                    for idx in range(epr_get_num_elems(self._ptr)))
 *         return iter(self.fields())             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __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("epr.Record.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1169
 *         return iter(self.fields())
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return '\n'.join(map(str, self))
 * 
 */

static PyObject *__pyx_pf_3epr_6Record___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Record___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1170
 * 
 *     def __str__(self):
 *         return '\n'.join(map(str, self))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_25), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)&PyString_Type)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_3 = PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Record.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1172
 *         return '\n'.join(map(str, self))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%s %d fields' % (super(Record, self).__repr__(),
 *                                  self.get_num_fields())
 */

static PyObject *__pyx_pf_3epr_6Record___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Record___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1173
 * 
 *     def __repr__(self):
 *         return '%s %d fields' % (super(Record, self).__repr__(),             # <<<<<<<<<<<<<<
 *                                  self.get_num_fields())
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Record)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_3epr_Record)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Record)));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____repr__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1174
 *     def __repr__(self):
 *         return '%s %d fields' % (super(Record, self).__repr__(),
 *                                  self.get_num_fields())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_26), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Record.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1177
 * 
 * 
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static  PyObject *__pyx_f_3epr_new_record(EPR_SRecord *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_record *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  int __pyx_v_dealloc = ((int)0);
  struct __pyx_obj_3epr_Record *__pyx_v_instance = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("new_record");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_dealloc = __pyx_optional_args->dealloc;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_parent);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1178
 * 
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1179
 * cdef new_record(EPR_SRecord* ptr, object parent=None, bint dealloc=False):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Record instance = Record.__new__(Record)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1181
 *         pyepr_null_ptr_error()
 * 
 *     cdef Record instance = Record.__new__(Record)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Record)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __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_3epr_Record))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Record *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1183
 *     cdef Record instance = Record.__new__(Record)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 *     instance._dealloc = dealloc
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1184
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 *     instance._dealloc = dealloc
 * 
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1185
 *     instance._ptr = ptr
 *     instance._parent = parent
 *     instance._dealloc = dealloc             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __pyx_v_instance->_dealloc = __pyx_v_dealloc;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1187
 *     instance._dealloc = dealloc
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_record");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_DECREF(__pyx_v_parent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1201
 *     cdef object _data
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._ptr is not NULL:
 *             epr_free_raster(self._ptr)
 */

static void __pyx_pf_3epr_6Raster___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_3epr_6Raster___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1202
 * 
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             epr_free_raster(self._ptr)
 * 
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr != NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1203
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:
 *             epr_free_raster(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     property data_type:
 */
    epr_free_raster(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1212
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.data_type
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_9data_type___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Raster_9data_type___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1213
 * 
 *         def __get__(self):
 *             return self._ptr.data_type             # <<<<<<<<<<<<<<
 * 
 *     property source_width:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.data_type.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1218
 *         '''The width of the source'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_width
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_12source_width___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Raster_12source_width___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1219
 * 
 *         def __get__(self):
 *             return self._ptr.source_width             # <<<<<<<<<<<<<<
 * 
 *     property source_height:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->source_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_width.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1224
 *         '''The height of the source'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_height
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_13source_height___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Raster_13source_height___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1225
 * 
 *         def __get__(self):
 *             return self._ptr.source_height             # <<<<<<<<<<<<<<
 * 
 *     property source_step_x:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->source_height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_height.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1230
 *         '''The sub-sampling for the across-track direction in pixel'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_step_x
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_13source_step_x___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Raster_13source_step_x___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1231
 * 
 *         def __get__(self):
 *             return self._ptr.source_step_x             # <<<<<<<<<<<<<<
 * 
 *     property source_step_y:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->source_step_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_step_x.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1236
 *         '''The sub-sampling for the along-track direction in pixel'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.source_step_y
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_13source_step_y___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Raster_13source_step_y___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1237
 * 
 *         def __get__(self):
 *             return self._ptr.source_step_y             # <<<<<<<<<<<<<<
 * 
 *     def get_width(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->source_step_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.source_step_y.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1239
 *             return self._ptr.source_step_y
 * 
 *     def get_width(self):             # <<<<<<<<<<<<<<
 *         '''Gets the raster's width in pixels'''
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_get_width(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Raster_get_width[] = "Gets the raster's width in pixels";
static PyObject *__pyx_pf_3epr_6Raster_get_width(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_width");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1242
 *         '''Gets the raster's width in pixels'''
 * 
 *         return epr_get_raster_width(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_height(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_raster_width(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.get_width");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1244
 *         return epr_get_raster_width(self._ptr)
 * 
 *     def get_height(self):             # <<<<<<<<<<<<<<
 *         '''Gets the raster's height in pixels'''
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_get_height(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Raster_get_height[] = "Gets the raster's height in pixels";
static PyObject *__pyx_pf_3epr_6Raster_get_height(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_height");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1247
 *         '''Gets the raster's height in pixels'''
 * 
 *         return epr_get_raster_height(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_elem_size(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_raster_height(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.get_height");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1249
 *         return epr_get_raster_height(self._ptr)
 * 
 *     def get_elem_size(self):             # <<<<<<<<<<<<<<
 *         '''The size in byte of a single element (sample) of this raster's
 *         buffer'''
 */

static PyObject *__pyx_pf_3epr_6Raster_get_elem_size(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_6Raster_get_elem_size[] = "The size in byte of a single element (sample) of this raster's\n        buffer";
static PyObject *__pyx_pf_3epr_6Raster_get_elem_size(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_elem_size");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1253
 *         buffer'''
 * 
 *         return epr_get_raster_elem_size(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_pixel(self, int x, int y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_raster_elem_size(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Raster.get_elem_size");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1255
 *         return epr_get_raster_elem_size(self._ptr)
 * 
 *     def get_pixel(self, int x, int y):             # <<<<<<<<<<<<<<
 *         '''Single pixel access
 * 
 */

static PyObject *__pyx_pf_3epr_6Raster_get_pixel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_6Raster_get_pixel[] = "Single pixel access\n\n        This function is for getting the values of the elements of a\n        raster (i.e. pixel)\n\n        :param x:\n            the (zero-based) X coordinate of the pixel\n        :param y:\n            the (zero-based) Y coordinate of the pixel\n        :returns:\n            the typed value at the given co-ordinate\n\n        ";
static PyObject *__pyx_pf_3epr_6Raster_get_pixel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_x;
  int __pyx_v_y;
  EPR_EDataTypeId __pyx_v_dtype;
  PyObject *__pyx_v_val;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0};
  __Pyx_RefNannySetupContext("get_pixel");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("get_pixel", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_pixel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_x = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_x = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_pixel", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Raster.get_pixel");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_val = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1270
 *         '''
 * 
 *         if (x < 0 or x >= self._ptr.raster_width or             # <<<<<<<<<<<<<<
 *             y < 0  or y >= self._ptr.raster_height):
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))
 */
  __pyx_t_1 = (__pyx_v_x < 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_x >= ((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->raster_width);
    if (!__pyx_t_2) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":1271
 * 
 *         if (x < 0 or x >= self._ptr.raster_width or
 *             y < 0  or y >= self._ptr.raster_height):             # <<<<<<<<<<<<<<
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))
 * 
 */
      __pyx_t_3 = (__pyx_v_y < 0);
      if (!__pyx_t_3) {
        __pyx_t_4 = (__pyx_v_y >= ((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->raster_height);
        __pyx_t_5 = __pyx_t_4;
      } else {
        __pyx_t_5 = __pyx_t_3;
      }
      __pyx_t_3 = __pyx_t_5;
    } else {
      __pyx_t_3 = __pyx_t_2;
    }
    __pyx_t_2 = __pyx_t_3;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1272
 *         if (x < 0 or x >= self._ptr.raster_width or
 *             y < 0  or y >= self._ptr.raster_height):
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))             # <<<<<<<<<<<<<<
 * 
 *         cdef EPR_EDataTypeId dtype = self._ptr.data_type
 */
    __pyx_t_6 = PyInt_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyInt_FromLong(__pyx_v_y); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1274
 *             raise ValueError('index out of range: x=%d, y=%d' % (x, y))
 * 
 *         cdef EPR_EDataTypeId dtype = self._ptr.data_type             # <<<<<<<<<<<<<<
 * 
 *         if dtype == e_tid_uint:
 */
  __pyx_v_dtype = ((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->data_type;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1276
 *         cdef EPR_EDataTypeId dtype = self._ptr.data_type
 * 
 *         if dtype == e_tid_uint:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)
 *         elif dtype == e_tid_int:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_uint);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1277
 * 
 *         if dtype == e_tid_uint:
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         elif dtype == e_tid_int:
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 */
    __pyx_t_7 = __Pyx_PyInt_to_py_uint(epr_get_pixel_as_uint(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr, __pyx_v_x, __pyx_v_y)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L7;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1278
 *         if dtype == e_tid_uint:
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)
 *         elif dtype == e_tid_int:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 *         elif dtype == e_tid_float:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_int);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1279
 *             val = epr_get_pixel_as_uint(self._ptr, x, y)
 *         elif dtype == e_tid_int:
 *             val = epr_get_pixel_as_int(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         elif dtype == e_tid_float:
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 */
    __pyx_t_7 = PyInt_FromLong(epr_get_pixel_as_int(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr, __pyx_v_x, __pyx_v_y)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L7;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1280
 *         elif dtype == e_tid_int:
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 *         elif dtype == e_tid_float:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 *         elif dtype == e_tid_double:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_float);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1281
 *             val = epr_get_pixel_as_int(self._ptr, x, y)
 *         elif dtype == e_tid_float:
 *             val = epr_get_pixel_as_float(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         elif dtype == e_tid_double:
 *             val = epr_get_pixel_as_double(self._ptr, x, y)
 */
    __pyx_t_7 = PyFloat_FromDouble(epr_get_pixel_as_float(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr, __pyx_v_x, __pyx_v_y)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L7;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1282
 *         elif dtype == e_tid_float:
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 *         elif dtype == e_tid_double:             # <<<<<<<<<<<<<<
 *             val = epr_get_pixel_as_double(self._ptr, x, y)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_dtype == e_tid_double);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1283
 *             val = epr_get_pixel_as_float(self._ptr, x, y)
 *         elif dtype == e_tid_double:
 *             val = epr_get_pixel_as_double(self._ptr, x, y)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('invalid data type: "%s"' %
 */
    __pyx_t_7 = PyFloat_FromDouble(epr_get_pixel_as_double(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr, __pyx_v_x, __pyx_v_y)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1286
 *         else:
 *             raise ValueError('invalid data type: "%s"' %
 *                                                 epr_data_type_id_to_str(dtype))             # <<<<<<<<<<<<<<
 * 
 *         pyepr_check_errors()    # @TODO: check
 */
    __pyx_t_7 = __Pyx_PyBytes_FromString(epr_data_type_id_to_str(__pyx_v_dtype)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1288
 *                                                 epr_data_type_id_to_str(dtype))
 * 
 *         pyepr_check_errors()    # @TODO: check             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_t_9 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1290
 *         pyepr_check_errors()    # @TODO: check
 * 
 *         return val             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("epr.Raster.get_pixel");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_val);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1293
 * 
 *     # --- high level interface ------------------------------------------------
 *     cdef np.ndarray toarray(self):             # <<<<<<<<<<<<<<
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)
 *         if dtype == np.NPY_NOTYPE:
 */

static  PyArrayObject *__pyx_f_3epr_6Raster_toarray(struct __pyx_obj_3epr_Raster *__pyx_v_self) {
  enum NPY_TYPES __pyx_v_dtype;
  npy_intp __pyx_v_shape[2];
  PyArrayObject *__pyx_v_result;
  PyArrayObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("toarray");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1294
 *     # --- high level interface ------------------------------------------------
 *     cdef np.ndarray toarray(self):
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_NOTYPE:
 *             raise TypeError('invalid data type')
 */
  __pyx_v_dtype = __pyx_f_3epr__epr_to_numpy_type_id(__pyx_v_self->_ptr->data_type);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1295
 *     cdef np.ndarray toarray(self):
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)
 *         if dtype == np.NPY_NOTYPE:             # <<<<<<<<<<<<<<
 *             raise TypeError('invalid data type')
 * 
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_NOTYPE);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1296
 *         cdef np.NPY_TYPES dtype = _epr_to_numpy_type_id(self._ptr.data_type)
 *         if dtype == np.NPY_NOTYPE:
 *             raise TypeError('invalid data type')             # <<<<<<<<<<<<<<
 * 
 *         cdef np.npy_intp shape[2]
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_29));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __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);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1299
 * 
 *         cdef np.npy_intp shape[2]
 *         shape[0] = self._ptr.raster_height             # <<<<<<<<<<<<<<
 *         shape[1] = self._ptr.raster_width
 * 
 */
  (__pyx_v_shape[0]) = __pyx_v_self->_ptr->raster_height;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1300
 *         cdef np.npy_intp shape[2]
 *         shape[0] = self._ptr.raster_height
 *         shape[1] = self._ptr.raster_width             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray result
 */
  (__pyx_v_shape[1]) = __pyx_v_self->_ptr->raster_width;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1303
 * 
 *         cdef np.ndarray result
 *         result = np.PyArray_SimpleNewFromData(2, shape, dtype, self._ptr.buffer)             # <<<<<<<<<<<<<<
 * 
 *         # Make the ndarray keep a reference to this object
 */
  __pyx_t_3 = PyArray_SimpleNewFromData(2, __pyx_v_shape, __pyx_v_dtype, __pyx_v_self->_ptr->buffer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __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 = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_v_result));
  __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1306
 * 
 *         # Make the ndarray keep a reference to this object
 *         np.set_array_base(result, self)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_f_5numpy_set_array_base(__pyx_v_result, ((PyObject *)__pyx_v_self));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1308
 *         np.set_array_base(result, self)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     property data:
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Raster.toarray");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_result);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1319
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._data is not None:
 *                 return self._data
 */

static PyObject *__pyx_pf_3epr_6Raster_4data___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Raster_4data___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1320
 * 
 *         def __get__(self):
 *             if self._data is not None:             # <<<<<<<<<<<<<<
 *                 return self._data
 * 
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data != Py_None);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1321
 *         def __get__(self):
 *             if self._data is not None:
 *                 return self._data             # <<<<<<<<<<<<<<
 * 
 *             if self._ptr.buffer is NULL:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data);
    __pyx_r = ((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1323
 *                 return self._data
 * 
 *             if self._ptr.buffer is NULL:             # <<<<<<<<<<<<<<
 *                 return np.ndarray(())
 * 
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_ptr->buffer == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1324
 * 
 *             if self._ptr.buffer is NULL:
 *                 return np.ndarray(())             # <<<<<<<<<<<<<<
 * 
 *             self._data = self.toarray()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_empty_tuple));
    __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1326
 *                 return np.ndarray(())
 * 
 *             self._data = self.toarray()             # <<<<<<<<<<<<<<
 * 
 *             return self._data
 */
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3epr_Raster *)((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->__pyx_vtab)->toarray(((struct __pyx_obj_3epr_Raster *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data);
  __Pyx_DECREF(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data);
  ((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1328
 *             self._data = self.toarray()
 * 
 *             return self._data             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data);
  __pyx_r = ((struct __pyx_obj_3epr_Raster *)__pyx_v_self)->_data;
  goto __pyx_L0;

  __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_AddTraceback("epr.Raster.data.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1330
 *             return self._data
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),
 *                                       data_type_id_to_str(self.data_type),
 */

static PyObject *__pyx_pf_3epr_6Raster___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_6Raster___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  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_RefNannySetupContext("__repr__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1331
 * 
 *     def __repr__(self):
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),             # <<<<<<<<<<<<<<
 *                                       data_type_id_to_str(self.data_type),
 *                                       self.get_height(), self.get_width())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Raster)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_3epr_Raster)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_3epr_Raster)));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____repr__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1332
 *     def __repr__(self):
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),
 *                                       data_type_id_to_str(self.data_type),             # <<<<<<<<<<<<<<
 *                                       self.get_height(), self.get_width())
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__data_type_id_to_str); 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_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data_type); 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 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); 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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1333
 *         return '%s %s (%dL x %dP)' % (super(Raster, self).__repr__(),
 *                                       data_type_id_to_str(self.data_type),
 *                                       self.get_height(), self.get_width())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("epr.Raster.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1336
 * 
 * 
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static  PyObject *__pyx_f_3epr_new_raster(EPR_SRaster *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_raster *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Raster *__pyx_v_instance = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("new_raster");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }
  __Pyx_INCREF(__pyx_v_parent);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1337
 * 
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1338
 * cdef new_raster(EPR_SRaster* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Raster instance = Raster.__new__(Raster)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1340
 *         pyepr_null_ptr_error()
 * 
 *     cdef Raster instance = Raster.__new__(Raster)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Raster)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __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_3epr_Raster))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Raster *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1342
 *     cdef Raster instance = Raster.__new__(Raster)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 *     instance._data = None
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1343
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 *     instance._data = None
 * 
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1344
 *     instance._ptr = ptr
 *     instance._parent = parent
 *     instance._data = None             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_instance->_data);
  __Pyx_DECREF(__pyx_v_instance->_data);
  __pyx_v_instance->_data = Py_None;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1346
 *     instance._data = None
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_raster");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_DECREF(__pyx_v_parent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1349
 * 
 * 
 * def create_raster(EPR_EDataTypeId data_type, uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                   uint xstep=1, uint ystep=1):
 *     '''Creates a raster of the specified data type
 */

static PyObject *__pyx_pf_3epr_create_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_create_raster[] = "Creates a raster of the specified data type\n\n    This function can be used to create any type of raster, e.g. for\n    later use as a bit-mask.\n\n    :param data_type:\n        the type of the data to stored in the raster, must be one of\n        E_TID_*\n    :param src_width:\n        the width (across track dimension) of the source to be read\n        into the raster.\n        See description of :meth:`Band.create_compatible_raster`\n    :param src_height:\n        the height (along track dimension) of the source to be read\n        into the raster.\n        See description of :meth:`Band.create_compatible_raster`\n    :param xstep:\n        the sub-sampling step across track of the source when reading\n        into the raster\n    :param ystep:\n        the sub-sampling step along track of the source when reading\n        into the raster\n    :returns:\n        the new :class:`Raster` instance\n\n    .. seealso:: description of :meth:`Band.create_compatible_raster`\n\n    ";
static PyObject *__pyx_pf_3epr_create_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  EPR_EDataTypeId __pyx_v_data_type;
  uint __pyx_v_src_width;
  uint __pyx_v_src_height;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  EPR_SRaster *__pyx_v_raster_ptr;
  PyObject *__pyx_r = NULL;
  int __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;
  int __pyx_t_7;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_8;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data_type,&__pyx_n_s__src_width,&__pyx_n_s__src_height,&__pyx_n_s__xstep,&__pyx_n_s__ystep,0};
  __Pyx_RefNannySetupContext("create_raster");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[5] = {0,0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data_type);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_width);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("create_raster", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_height);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("create_raster", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
        if (unlikely(value)) { values[3] = value; kw_args--; }
      }
      case  4:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
        if (unlikely(value)) { values[4] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "create_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_data_type = PyInt_AsLong(values[0]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_width = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_height = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[3]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[4]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[4]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  } else {
    __pyx_v_xstep = ((uint)1);
    __pyx_v_ystep = ((uint)1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5:
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  4:
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  3:
      __pyx_v_src_height = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_src_width = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_data_type = PyInt_AsLong(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_raster", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.create_raster");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1380
 *     '''
 * 
 *     if xstep == 0 or ystep == 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))
 * 
 */
  __pyx_t_1 = (__pyx_v_xstep == 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_ystep == 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1381
 * 
 *     if xstep == 0 or ystep == 0:
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))             # <<<<<<<<<<<<<<
 * 
 *     cdef EPR_SRaster* raster_ptr
 */
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1385
 *     cdef EPR_SRaster* raster_ptr
 *     raster_ptr = epr_create_raster(data_type, src_width, src_height,
 *                                    xstep, ystep)             # <<<<<<<<<<<<<<
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')
 */
  __pyx_v_raster_ptr = epr_create_raster(__pyx_v_data_type, __pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1386
 *     raster_ptr = epr_create_raster(data_type, src_width, src_height,
 *                                    xstep, ystep)
 *     if raster_ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 */
  __pyx_t_3 = (__pyx_v_raster_ptr == NULL);
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1387
 *                                    xstep, ystep)
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')             # <<<<<<<<<<<<<<
 * 
 *     return new_raster(raster_ptr)
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.msg = ((PyObject *)__pyx_kp_s_32);
    __pyx_t_7 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1389
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 *     return new_raster(raster_ptr)             # <<<<<<<<<<<<<<
 * 
 * def create_bitmask_raster(uint src_width, uint src_height,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_3epr_new_raster(__pyx_v_raster_ptr, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.create_raster");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1391
 *     return new_raster(raster_ptr)
 * 
 * def create_bitmask_raster(uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                           uint xstep=1, uint ystep=1):
 *     '''Creates a raster to be used for reading bitmasks
 */

static PyObject *__pyx_pf_3epr_create_bitmask_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_create_bitmask_raster[] = "Creates a raster to be used for reading bitmasks\n\n    The raster returned always is of type ``byte``.\n\n    :param src_width:\n        the width (across track dimension) of the source to be read\n        into the raster\n    :param src_height:\n        the height (along track dimension) of the source to be read\n        into the raster\n    :param xstep:\n        the sub-sampling step across track of the source when reading\n        into the raster\n    :param ystep:\n        the sub-sampling step along track of the source when reading\n        into the raster\n    :returns:\n        the new raster instance or raises an exception\n        (:class:`EPRValueError`) if an error occurred\n\n    .. seealso:: the description of :meth:`Band.create_compatible_raster`\n\n    ";
static PyObject *__pyx_pf_3epr_create_bitmask_raster(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_src_width;
  uint __pyx_v_src_height;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  EPR_SRaster *__pyx_v_raster_ptr;
  PyObject *__pyx_r = NULL;
  int __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;
  int __pyx_t_7;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_8;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__src_width,&__pyx_n_s__src_height,&__pyx_n_s__xstep,&__pyx_n_s__ystep,0};
  __Pyx_RefNannySetupContext("create_bitmask_raster");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_width);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_height);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("create_bitmask_raster", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
        if (unlikely(value)) { values[3] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "create_bitmask_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_src_width = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_height = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[3]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  } else {
    __pyx_v_xstep = ((uint)1);
    __pyx_v_ystep = ((uint)1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4:
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  3:
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_src_height = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_src_width = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_bitmask_raster", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.create_bitmask_raster");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1417
 *     '''
 * 
 *     if xstep == 0 or ystep == 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))
 * 
 */
  __pyx_t_1 = (__pyx_v_xstep == 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_ystep == 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1418
 * 
 *     if xstep == 0 or ystep == 0:
 *         raise ValueError('invalid step: xspet=%d, ystep=%d' % (xstep, ystep))             # <<<<<<<<<<<<<<
 * 
 *     cdef EPR_SRaster* raster_ptr
 */
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1421
 * 
 *     cdef EPR_SRaster* raster_ptr
 *     raster_ptr = epr_create_bitmask_raster(src_width, src_height, xstep, ystep)             # <<<<<<<<<<<<<<
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')
 */
  __pyx_v_raster_ptr = epr_create_bitmask_raster(__pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1422
 *     cdef EPR_SRaster* raster_ptr
 *     raster_ptr = epr_create_bitmask_raster(src_width, src_height, xstep, ystep)
 *     if raster_ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 */
  __pyx_t_3 = (__pyx_v_raster_ptr == NULL);
  if (__pyx_t_3) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1423
 *     raster_ptr = epr_create_bitmask_raster(src_width, src_height, xstep, ystep)
 *     if raster_ptr is NULL:
 *         pyepr_null_ptr_error('unable to create a new raster')             # <<<<<<<<<<<<<<
 * 
 *     return new_raster(raster_ptr)
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.msg = ((PyObject *)__pyx_kp_s_32);
    __pyx_t_7 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1425
 *         pyepr_null_ptr_error('unable to create a new raster')
 * 
 *     return new_raster(raster_ptr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_3epr_new_raster(__pyx_v_raster_ptr, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.create_bitmask_raster");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1445
 *         '''The :class:`Product` instance to which this band belongs to'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._parent
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_7product___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_7product___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1446
 * 
 *         def __get__(self):
 *             return self._parent             # <<<<<<<<<<<<<<
 * 
 *     property spectr_band_index:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_parent);
  __pyx_r = ((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_parent;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1455
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.spectr_band_index
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_17spectr_band_index___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_17spectr_band_index___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1456
 * 
 *         def __get__(self):
 *             return self._ptr.spectr_band_index             # <<<<<<<<<<<<<<
 * 
 *     property sample_model:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->spectr_band_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.spectr_band_index.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1473
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.sample_model
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_12sample_model___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_12sample_model___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1474
 * 
 *         def __get__(self):
 *             return self._ptr.sample_model             # <<<<<<<<<<<<<<
 * 
 *     property data_type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->sample_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.sample_model.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1488
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.data_type
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_9data_type___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_9data_type___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1489
 * 
 *         def __get__(self):
 *             return self._ptr.data_type             # <<<<<<<<<<<<<<
 * 
 *     property scaling_method:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.data_type.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1510
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.scaling_method
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14scaling_method___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_14scaling_method___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1511
 * 
 *         def __get__(self):
 *             return self._ptr.scaling_method             # <<<<<<<<<<<<<<
 * 
 *     property scaling_offset:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->scaling_method); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.scaling_method.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1527
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.scaling_offset
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14scaling_offset___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_14scaling_offset___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1528
 * 
 *         def __get__(self):
 *             return self._ptr.scaling_offset             # <<<<<<<<<<<<<<
 * 
 *     property scaling_factor:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->scaling_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.scaling_offset.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1544
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.scaling_factor
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14scaling_factor___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_14scaling_factor___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1545
 * 
 *         def __get__(self):
 *             return self._ptr.scaling_factor             # <<<<<<<<<<<<<<
 * 
 *     property bm_expr:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->scaling_factor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.scaling_factor.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1554
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.bm_expr is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_4Band_7bm_expr___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_7bm_expr___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1555
 * 
 *         def __get__(self):
 *             if self._ptr.bm_expr is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->bm_expr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1556
 *         def __get__(self):
 *             if self._ptr.bm_expr is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._ptr.bm_expr
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1558
 *                 return None
 *             else:
 *                 return self._ptr.bm_expr             # <<<<<<<<<<<<<<
 * 
 *     property unit:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->bm_expr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Band.bm_expr.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1563
 *         '''The geophysical unit for the band's pixel values'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.unit is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_4Band_4unit___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_4unit___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1564
 * 
 *         def __get__(self):
 *             if self._ptr.unit is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->unit == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1565
 *         def __get__(self):
 *             if self._ptr.unit is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._ptr.unit
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1567
 *                 return None
 *             else:
 *                 return self._ptr.unit             # <<<<<<<<<<<<<<
 * 
 *     property description:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->unit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Band.unit.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1572
 *         '''A short description of the band's contents'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.description is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_4Band_11description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_11description___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1573
 * 
 *         def __get__(self):
 *             if self._ptr.description is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->description == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1574
 *         def __get__(self):
 *             if self._ptr.description is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._ptr.description
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1576
 *                 return None
 *             else:
 *                 return self._ptr.description             # <<<<<<<<<<<<<<
 * 
 *     property lines_mirrored:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Band.description.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1587
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint>self._ptr.lines_mirrored
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_14lines_mirrored___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band_14lines_mirrored___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1588
 * 
 *         def __get__(self):
 *             return <bint>self._ptr.lines_mirrored             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((int)((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr->lines_mirrored)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.lines_mirrored.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1590
 *             return <bint>self._ptr.lines_mirrored
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         '''Gets the name of the band'''
 * 
 */

static PyObject *__pyx_pf_3epr_4Band_get_name(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_4Band_get_name[] = "Gets the name of the band";
static PyObject *__pyx_pf_3epr_4Band_get_name(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_name");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1593
 *         '''Gets the name of the band'''
 * 
 *         return epr_get_band_name(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: default values for src_width and src_height
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(epr_get_band_name(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.get_name");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1596
 * 
 *     # @TODO: default values for src_width and src_height
 *     def create_compatible_raster(self, uint src_width, uint src_height,             # <<<<<<<<<<<<<<
 *                                  uint xstep=1, uint ystep=1):
 *         '''Creates a raster which is compatible with the data type of the band
 */

static PyObject *__pyx_pf_3epr_4Band_create_compatible_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_4Band_create_compatible_raster[] = "Creates a raster which is compatible with the data type of the band\n""\n""        The created raster is used to read the data in it (see\n""        :meth:`Band.read_raster`).\n""\n""        The raster is defined on the grid of the product, from which the\n""        data are read. Spatial subsets and under-sampling are possible)\n""        through the parameter of the method.\n""\n""        A raster is an object that allows direct access to data of a\n""        certain portion of the ENVISAT product that are read into the it.\n""        Such a portion is called the source. The complete ENVISAT product\n""        can be much greater than the source. One can move the raster over\n""        the complete ENVISAT product and read in turn different parts\n""        (always of the size of the source) of it into the raster.\n""        The source is specified by the parameters *height* and *width*.\n""\n""        A typical example is a processing in blocks. Lets say, a block\n""        has 64x32 pixel. Then, my source has a width of 64 pixel and a\n""        height of 32 pixel.\n""\n""        Another example is a processing of complete image lines. Then,\n""        my source has a widths of the complete product (for example 1121\n""        for a MERIS RR product), and a height of 1). One can loop over\n""        all blocks read into the raster and process it.\n""\n""        In addition, it is possible to defined a sub-sampling step for\n""        a raster. This means, that the source is not read 1:1 into the\n""        raster, but that only every 2nd or 3rd pixel is read. This step\n""        can be set differently for the across track (source_step_x) and\n""        along track (source_step_y) directions.\n""\n""        :param src_width:\n""            the width (across track dimension) of the source to be read\n""            into the raster\n""        :param src_height:\n""            the height (along track dimension) of the source to be read\n""            into the raster\n""        :param xstep:\n""            the sub-sampling step across track of the source when reading\n""            into the raster\n""        :param ystep:\n""            the sub-sampling step along track of the source when reading\n""            into the raster\n""        :returns:\n""            the new raster instance or raises an exception\n""            (:class:`EPRValueError`) if an error occurred\n""\n""        ";
static PyObject *__pyx_pf_3epr_4Band_create_compatible_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_src_width;
  uint __pyx_v_src_height;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  EPR_SRaster *__pyx_v_raster_ptr;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_8;
  struct __pyx_opt_args_3epr_new_raster __pyx_t_9;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__src_width,&__pyx_n_s__src_height,&__pyx_n_s__xstep,&__pyx_n_s__ystep,0};
  __Pyx_RefNannySetupContext("create_compatible_raster");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_width);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__src_height);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("create_compatible_raster", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
        if (unlikely(value)) { values[3] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "create_compatible_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_src_width = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_src_height = __Pyx_PyInt_from_py_uint(values[1]); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[3]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  } else {
    __pyx_v_xstep = ((uint)1);
    __pyx_v_ystep = ((uint)1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4:
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  3:
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_src_height = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_src_height == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_src_width = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_src_width == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_compatible_raster", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Band.create_compatible_raster");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1658
 *         raster_ptr = epr_create_compatible_raster(self._ptr,
 *                                                   src_width, src_height,
 *                                                   xstep, ystep)             # <<<<<<<<<<<<<<
 *         if raster_ptr is NULL:
 *             pyepr_null_ptr_error('unable to create compatible raster with '
 */
  __pyx_v_raster_ptr = epr_create_compatible_raster(((struct __pyx_obj_3epr_Band *)__pyx_v_self)->_ptr, __pyx_v_src_width, __pyx_v_src_height, __pyx_v_xstep, __pyx_v_ystep);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1659
 *                                                   src_width, src_height,
 *                                                   xstep, ystep)
 *         if raster_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to create compatible raster with '
 *                                  'width=%d, height=%d xstep=%d, ystep=%d' %
 */
  __pyx_t_1 = (__pyx_v_raster_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1662
 *             pyepr_null_ptr_error('unable to create compatible raster with '
 *                                  'width=%d, height=%d xstep=%d, ystep=%d' %
 *                                         (src_width, src_height, xstep, ystep))             # <<<<<<<<<<<<<<
 * 
 *         return new_raster(raster_ptr, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_src_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_src_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_33), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.msg = __pyx_t_5;
    __pyx_t_7 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1664
 *                                         (src_width, src_height, xstep, ystep))
 * 
 *         return new_raster(raster_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.parent = __pyx_v_self;
  __pyx_t_5 = __pyx_f_3epr_new_raster(__pyx_v_raster_ptr, &__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Band.create_compatible_raster");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1666
 *         return new_raster(raster_ptr, self)
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):             # <<<<<<<<<<<<<<
 *         '''Reads (geo-)physical values of the band of the specified
 *         source-region
 */

static PyObject *__pyx_pf_3epr_4Band_read_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static  PyObject *__pyx_f_3epr_4Band_read_raster(struct __pyx_obj_3epr_Band *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3epr_4Band_read_raster *__pyx_optional_args) {
  int __pyx_v_xoffset = ((int)0);
  int __pyx_v_yoffset = ((int)0);
  struct __pyx_obj_3epr_Raster *__pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)Py_None);
  int __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("read_raster");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_xoffset = __pyx_optional_args->xoffset;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_yoffset = __pyx_optional_args->yoffset;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_raster = __pyx_optional_args->raster;
        }
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF((PyObject *)__pyx_v_raster);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_raster); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_3epr_4Band_read_raster)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_xoffset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_yoffset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __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 = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_raster));
      PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_raster));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_raster));
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1699
 *         cdef int ret
 * 
 *         if raster is None:             # <<<<<<<<<<<<<<
 *             raster = self.create_compatible_raster()
 * 
 */
  __pyx_t_5 = (((PyObject *)__pyx_v_raster) == Py_None);
  if (__pyx_t_5) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1700
 * 
 *         if raster is None:
 *             raster = self.create_compatible_raster()             # <<<<<<<<<<<<<<
 * 
 *         Py_BEGIN_ALLOW_THREADS
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_34); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3epr_Raster))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_raster));
    __pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1702
 *             raster = self.create_compatible_raster()
 * 
 *         Py_BEGIN_ALLOW_THREADS             # <<<<<<<<<<<<<<
 *         ret = epr_read_band_raster(self._ptr, xoffset, yoffset, raster._ptr)
 *         Py_END_ALLOW_THREADS
 */
  Py_BEGIN_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1703
 * 
 *         Py_BEGIN_ALLOW_THREADS
 *         ret = epr_read_band_raster(self._ptr, xoffset, yoffset, raster._ptr)             # <<<<<<<<<<<<<<
 *         Py_END_ALLOW_THREADS
 * 
 */
  __pyx_v_ret = epr_read_band_raster(__pyx_v_self->_ptr, __pyx_v_xoffset, __pyx_v_yoffset, __pyx_v_raster->_ptr);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1704
 *         Py_BEGIN_ALLOW_THREADS
 *         ret = epr_read_band_raster(self._ptr, xoffset, yoffset, raster._ptr)
 *         Py_END_ALLOW_THREADS             # <<<<<<<<<<<<<<
 * 
 *         if ret != 0:
 */
  Py_END_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1706
 *         Py_END_ALLOW_THREADS
 * 
 *         if ret != 0:             # <<<<<<<<<<<<<<
 *             pyepr_check_errors()
 * 
 */
  __pyx_t_5 = (__pyx_v_ret != 0);
  if (__pyx_t_5) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1707
 * 
 *         if ret != 0:
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *         raster._data = None
 */
    __pyx_t_6 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1709
 *             pyepr_check_errors()
 * 
 *         raster._data = None             # <<<<<<<<<<<<<<
 * 
 *         return raster
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_raster->_data);
  __Pyx_DECREF(__pyx_v_raster->_data);
  __pyx_v_raster->_data = Py_None;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1711
 *         raster._data = None
 * 
 *         return raster             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_raster));
  __pyx_r = ((PyObject *)__pyx_v_raster);
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr.Band.read_raster");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF((PyObject *)__pyx_v_raster);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1666
 *         return new_raster(raster_ptr, self)
 * 
 *     cpdef read_raster(self, int xoffset=0, int yoffset=0, Raster raster=None):             # <<<<<<<<<<<<<<
 *         '''Reads (geo-)physical values of the band of the specified
 *         source-region
 */

static PyObject *__pyx_pf_3epr_4Band_read_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_4Band_read_raster[] = "Reads (geo-)physical values of the band of the specified\n        source-region\n\n        The source-region is a defined part of the whole ENVISAT product\n        image, which shall be read into a raster.\n        In this routine the co-ordinates are specified, where the\n        source-region to be read starts.\n        The dimension of the region and the sub-sampling are attributes\n        of the raster into which the data are read.\n\n        :param xoffset:\n            across-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param yoffset:\n            along-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param raster:\n            :class:`Raster` instance set with appropriate parameters to\n            read into. If not provided a new :class:`Raster` is instantiated\n        :returns:\n            the :class:`Raster` instance in which data are read\n\n        This method raises an instance of the appropriate :class:`EPRError`\n        sub-class if case of errors\n\n        .. seealso:: :meth:`Band.create_compatible_raster` and\n                     :func:`create_raster`\n\n        ";
static PyObject *__pyx_pf_3epr_4Band_read_raster(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_xoffset;
  int __pyx_v_yoffset;
  struct __pyx_obj_3epr_Raster *__pyx_v_raster = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3epr_4Band_read_raster __pyx_t_2;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xoffset,&__pyx_n_s__yoffset,&__pyx_n_s__raster,0};
  __Pyx_RefNannySetupContext("read_raster");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject*)((struct __pyx_obj_3epr_Raster *)Py_None);
    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);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xoffset);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yoffset);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__raster);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read_raster") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[0]) {
      __pyx_v_xoffset = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_xoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xoffset = ((int)0);
    }
    if (values[1]) {
      __pyx_v_yoffset = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_yoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_yoffset = ((int)0);
    }
    __pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)values[2]);
  } else {
    __pyx_v_xoffset = ((int)0);
    __pyx_v_yoffset = ((int)0);
    __pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_raster = ((struct __pyx_obj_3epr_Raster *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2: __pyx_v_yoffset = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_yoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_xoffset = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_xoffset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_raster", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Band.read_raster");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_raster), __pyx_ptype_3epr_Raster, 1, "raster", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.xoffset = __pyx_v_xoffset;
  __pyx_t_2.yoffset = __pyx_v_yoffset;
  __pyx_t_2.raster = __pyx_v_raster;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3epr_Band *)((struct __pyx_obj_3epr_Band *)__pyx_v_self)->__pyx_vtab)->read_raster(((struct __pyx_obj_3epr_Band *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Band.read_raster");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1714
 * 
 *     # --- high level interface ------------------------------------------------
 *     def read_as_array(self, width=None, height=None,             # <<<<<<<<<<<<<<
 *                       uint xoffset=0, uint yoffset=0,
 *                       uint xstep=1, uint ystep=1):
 */

static PyObject *__pyx_pf_3epr_4Band_read_as_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_4Band_read_as_array[] = "Reads the specified source region as an :class:`numpy.ndarray`\n\n        The source-region is a defined part of the whole ENVISAT product\n        image, which shall be read into a raster.\n        In this routine the co-ordinates are specified, where the\n        source-region to be read starts.\n        The dimension of the region and the sub-sampling are attributes\n        of the raster into which the data are read.\n\n        :param src_width:\n            the width (across track dimension) of the source to be read\n            into the raster. If not provided reads as much as possible\n        :param src_height:\n            the height (along track dimension) of the source to be read\n            into the raster. If not provided reads as much as possible\n        :param xoffset:\n            across-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param yoffset:\n            along-track source co-ordinate in pixel co-ordinates\n            (zero-based) of the upper right corner of the source-region\n        :param xstep:\n            the sub-sampling step across track of the source when reading\n            into the raster\n        :param ystep:\n            the sub-sampling step along track of the source when reading\n            into the raster\n        :returns:\n            the :class:`numpy.ndarray` instance in which data are read\n\n        This method raises an instance of the appropriate :class:`EPRError`\n        sub-class if case of errors\n\n        .. seealso:: :meth:`Band.create_compatible_raster`,\n                     :func:`create_raster` and :meth:`Band.read_raster`\n\n        ";
static PyObject *__pyx_pf_3epr_4Band_read_as_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  uint __pyx_v_xoffset;
  uint __pyx_v_yoffset;
  uint __pyx_v_xstep;
  uint __pyx_v_ystep;
  PyObject *__pyx_v_w;
  PyObject *__pyx_v_h;
  PyObject *__pyx_v_raster;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_3epr_4Band_read_raster __pyx_t_6;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__width,&__pyx_n_s__height,&__pyx_n_s__xoffset,&__pyx_n_s__yoffset,&__pyx_n_s__xstep,&__pyx_n_s__ystep,0};
  __Pyx_RefNannySetupContext("read_as_array");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    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);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__width);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__height);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xoffset);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yoffset);
        if (unlikely(value)) { values[3] = value; kw_args--; }
      }
      case  4:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xstep);
        if (unlikely(value)) { values[4] = value; kw_args--; }
      }
      case  5:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ystep);
        if (unlikely(value)) { values[5] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read_as_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_width = values[0];
    __pyx_v_height = values[1];
    if (values[2]) {
      __pyx_v_xoffset = __Pyx_PyInt_from_py_uint(values[2]); if (unlikely((__pyx_v_xoffset == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xoffset = ((uint)0);
    }
    if (values[3]) {
      __pyx_v_yoffset = __Pyx_PyInt_from_py_uint(values[3]); if (unlikely((__pyx_v_yoffset == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_yoffset = ((uint)0);
    }
    if (values[4]) {
      __pyx_v_xstep = __Pyx_PyInt_from_py_uint(values[4]); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_xstep = ((uint)1);
    }
    if (values[5]) {
      __pyx_v_ystep = __Pyx_PyInt_from_py_uint(values[5]); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ystep = ((uint)1);
    }
  } else {
    __pyx_v_width = ((PyObject *)Py_None);
    __pyx_v_height = ((PyObject *)Py_None);
    __pyx_v_xoffset = ((uint)0);
    __pyx_v_yoffset = ((uint)0);
    __pyx_v_xstep = ((uint)1);
    __pyx_v_ystep = ((uint)1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  6: __pyx_v_ystep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_ystep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  5: __pyx_v_xstep = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_xstep == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  4: __pyx_v_yoffset = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_yoffset == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  3: __pyx_v_xoffset = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_xoffset == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_height = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_width = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_as_array", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Band.read_as_array");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);
  __pyx_v_w = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_h = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_raster = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1755
 *         '''
 * 
 *         if width is None:             # <<<<<<<<<<<<<<
 *             w = self.product.get_scene_width()
 *             if w > xoffset:
 */
  __pyx_t_1 = (__pyx_v_width == Py_None);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1756
 * 
 *         if width is None:
 *             w = self.product.get_scene_width()             # <<<<<<<<<<<<<<
 *             if w > xoffset:
 *                 width = w - xoffset
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__product); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_scene_width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_w);
    __pyx_v_w = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1757
 *         if width is None:
 *             w = self.product.get_scene_width()
 *             if w > xoffset:             # <<<<<<<<<<<<<<
 *                 width = w - xoffset
 *             else:
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_xoffset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_w, __pyx_t_2, Py_GT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __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_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":1758
 *             w = self.product.get_scene_width()
 *             if w > xoffset:
 *                 width = w - xoffset             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError('xoffset os larger that he scene width')
 */
      __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_xoffset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_w, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_width);
      __pyx_v_width = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":1760
 *                 width = w - xoffset
 *             else:
 *                 raise ValueError('xoffset os larger that he scene width')             # <<<<<<<<<<<<<<
 * 
 *         if height is None:
 */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_35));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
      __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __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);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1762
 *                 raise ValueError('xoffset os larger that he scene width')
 * 
 *         if height is None:             # <<<<<<<<<<<<<<
 *             h = self.product.get_scene_height()
 *             if h > yoffset:
 */
  __pyx_t_1 = (__pyx_v_height == Py_None);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1763
 * 
 *         if height is None:
 *             h = self.product.get_scene_height()             # <<<<<<<<<<<<<<
 *             if h > yoffset:
 *                 height = h - yoffset
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__product); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get_scene_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_h);
    __pyx_v_h = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1764
 *         if height is None:
 *             h = self.product.get_scene_height()
 *             if h > yoffset:             # <<<<<<<<<<<<<<
 *                 height = h - yoffset
 *             else:
 */
    __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_yoffset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_h, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":1765
 *             h = self.product.get_scene_height()
 *             if h > yoffset:
 *                 height = h - yoffset             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError('yoffset os larger that he scene height')
 */
      __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_yoffset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Subtract(__pyx_v_h, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_height);
      __pyx_v_height = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/antonio/projects/pyepr/src/epr.pyx":1767
 *                 height = h - yoffset
 *             else:
 *                 raise ValueError('yoffset os larger that he scene height')             # <<<<<<<<<<<<<<
 * 
 *         raster = self.create_compatible_raster(width, height, xstep, ystep)
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_36));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_36));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36));
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1769
 *                 raise ValueError('yoffset os larger that he scene height')
 * 
 *         raster = self.create_compatible_raster(width, height, xstep, ystep)             # <<<<<<<<<<<<<<
 *         self.read_raster(xoffset, yoffset, raster)
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_to_py_uint(__pyx_v_xstep); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_to_py_uint(__pyx_v_ystep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __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_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_v_raster);
  __pyx_v_raster = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1770
 * 
 *         raster = self.create_compatible_raster(width, height, xstep, ystep)
 *         self.read_raster(xoffset, yoffset, raster)             # <<<<<<<<<<<<<<
 * 
 *         return raster.data
 */
  if (!(likely(((__pyx_v_raster) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_raster, __pyx_ptype_3epr_Raster))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6.__pyx_n = 3;
  __pyx_t_6.xoffset = __pyx_v_xoffset;
  __pyx_t_6.yoffset = __pyx_v_yoffset;
  __pyx_t_6.raster = ((struct __pyx_obj_3epr_Raster *)__pyx_v_raster);
  __pyx_t_4 = ((struct __pyx_vtabstruct_3epr_Band *)((struct __pyx_obj_3epr_Band *)__pyx_v_self)->__pyx_vtab)->read_raster(((struct __pyx_obj_3epr_Band *)__pyx_v_self), 0, &__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1772
 *         self.read_raster(xoffset, yoffset, raster)
 * 
 *         return raster.data             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_raster, __pyx_n_s__data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("epr.Band.read_as_array");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_w);
  __Pyx_DECREF(__pyx_v_h);
  __Pyx_DECREF(__pyx_v_raster);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_width);
  __Pyx_DECREF(__pyx_v_height);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1774
 *         return raster.data
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Band(%s) of %s' % (self.get_name(), repr(self.product))
 * 
 */

static PyObject *__pyx_pf_3epr_4Band___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_4Band___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1775
 * 
 *     def __repr__(self):
 *         return 'epr.Band(%s) of %s' % (self.get_name(), repr(self.product))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__product); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_37), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Band.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1778
 * 
 * 
 * cdef new_band(EPR_SBandId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static  PyObject *__pyx_f_3epr_new_band(EPR_SBandId *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_band *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Band *__pyx_v_instance = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("new_band");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }
  __Pyx_INCREF(__pyx_v_parent);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1779
 * 
 * cdef new_band(EPR_SBandId* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1780
 * cdef new_band(EPR_SBandId* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Band instance = Band.__new__(Band)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1782
 *         pyepr_null_ptr_error()
 * 
 *     cdef Band instance = Band.__new__(Band)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Band)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __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_3epr_Band))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Band *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1784
 *     cdef Band instance = Band.__new__(Band)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1785
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1787
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_band");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_DECREF(__pyx_v_parent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1808
 *         '''The :class:`Product` instance to which this dataset belongs to'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._parent
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_7product___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Dataset_7product___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1809
 * 
 *         def __get__(self):
 *             return self._parent             # <<<<<<<<<<<<<<
 * 
 *     property description:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_parent);
  __pyx_r = ((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_parent;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1814
 *         '''A short description of the band's contents'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.description is NULL:
 *                 return ''
 */

static PyObject *__pyx_pf_3epr_7Dataset_11description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Dataset_11description___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1815
 * 
 *         def __get__(self):
 *             if self._ptr.description is NULL:             # <<<<<<<<<<<<<<
 *                 return ''
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr->description == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1816
 *         def __get__(self):
 *             if self._ptr.description is NULL:
 *                 return ''             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._ptr.description
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
    __pyx_r = ((PyObject *)__pyx_kp_s_1);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1818
 *                 return ''
 *             else:
 *                 return self._ptr.description             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr->description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Dataset.description.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1820
 *                 return self._ptr.description
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         '''Gets the name of the dataset'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_get_name(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_get_name[] = "Gets the name of the dataset";
static PyObject *__pyx_pf_3epr_7Dataset_get_name(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_name");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1823
 *         '''Gets the name of the dataset'''
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             return epr_get_dataset_name(self._ptr)
 *         return ''
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr != NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1824
 * 
 *         if self._ptr is not NULL:
 *             return epr_get_dataset_name(self._ptr)             # <<<<<<<<<<<<<<
 *         return ''
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(epr_get_dataset_name(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1825
 *         if self._ptr is not NULL:
 *             return epr_get_dataset_name(self._ptr)
 *         return ''             # <<<<<<<<<<<<<<
 * 
 *     def get_dsd_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  __pyx_r = ((PyObject *)__pyx_kp_s_1);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Dataset.get_name");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1827
 *         return ''
 * 
 *     def get_dsd_name(self):             # <<<<<<<<<<<<<<
 *         '''Gets the name of the DSD (dataset descriptor)'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_get_dsd_name(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_get_dsd_name[] = "Gets the name of the DSD (dataset descriptor)";
static PyObject *__pyx_pf_3epr_7Dataset_get_dsd_name(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_dsd_name");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1830
 *         '''Gets the name of the DSD (dataset descriptor)'''
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             return epr_get_dsd_name(self._ptr)
 *         return ''
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr != NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1831
 * 
 *         if self._ptr is not NULL:
 *             return epr_get_dsd_name(self._ptr)             # <<<<<<<<<<<<<<
 *         return ''
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(epr_get_dsd_name(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1832
 *         if self._ptr is not NULL:
 *             return epr_get_dsd_name(self._ptr)
 *         return ''             # <<<<<<<<<<<<<<
 * 
 *     def get_num_records(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  __pyx_r = ((PyObject *)__pyx_kp_s_1);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Dataset.get_dsd_name");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1834
 *         return ''
 * 
 *     def get_num_records(self):             # <<<<<<<<<<<<<<
 *         '''Gets the number of records of the dataset'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_get_num_records(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_get_num_records[] = "Gets the number of records of the dataset";
static PyObject *__pyx_pf_3epr_7Dataset_get_num_records(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_num_records");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1837
 *         '''Gets the number of records of the dataset'''
 * 
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             return epr_get_num_records(self._ptr)
 *         return 0
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr != NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1838
 * 
 *         if self._ptr is not NULL:
 *             return epr_get_num_records(self._ptr)             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(epr_get_num_records(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1839
 *         if self._ptr is not NULL:
 *             return epr_get_num_records(self._ptr)
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def get_dsd(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_r = __pyx_int_0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Dataset.get_num_records");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1841
 *         return 0
 * 
 *     def get_dsd(self):             # <<<<<<<<<<<<<<
 *         '''Gets the dataset descriptor (DSD)'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_get_dsd(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_get_dsd[] = "Gets the dataset descriptor (DSD)";
static PyObject *__pyx_pf_3epr_7Dataset_get_dsd(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3epr_new_dsd __pyx_t_2;
  __Pyx_RefNannySetupContext("get_dsd");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1844
 *         '''Gets the dataset descriptor (DSD)'''
 * 
 *         return new_dsd(<EPR_SDSD*>epr_get_dsd(self._ptr), self)             # <<<<<<<<<<<<<<
 * 
 *     def create_record(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.parent = __pyx_v_self;
  __pyx_t_1 = __pyx_f_3epr_new_dsd(((EPR_SDSD *)epr_get_dsd(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr)), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Dataset.get_dsd");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1846
 *         return new_dsd(<EPR_SDSD*>epr_get_dsd(self._ptr), self)
 * 
 *     def create_record(self):             # <<<<<<<<<<<<<<
 *         '''Creates a new record
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_create_record(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_create_record[] = "Creates a new record\n\n        Creates a new, empty record with a structure compatible with\n        the dataset. Such a record is typically used in subsequent\n        calls to :meth:`Dataset.read_record`.\n\n        :returns:\n            the new record instance\n\n        ";
static PyObject *__pyx_pf_3epr_7Dataset_create_record(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_3epr_new_record __pyx_t_2;
  __Pyx_RefNannySetupContext("create_record");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1858
 *         '''
 * 
 *         return new_record(epr_create_record(self._ptr), self, True)             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: default: index=0
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.parent = __pyx_v_self;
  __pyx_t_2.dealloc = 1;
  __pyx_t_1 = __pyx_f_3epr_new_record(epr_create_record(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Dataset.create_record");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1861
 * 
 *     # @TODO: default: index=0
 *     def read_record(self, uint index, Record record=None):             # <<<<<<<<<<<<<<
 *         '''Reads specified record of the dataset
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_read_record(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3epr_7Dataset_read_record[] = "Reads specified record of the dataset\n\n        The record is identified through the given zero-based record\n        index. In order to reduce memory reallocation, a record\n        (pre-)created by the method :meth:`Dataset.create_record` can\n        be passed to this method.\n        Data is then read into this given record.\n\n        If no record (``None``) is given, the method initiates a new\n        one.\n\n        In both cases, the record in which the data is read into will\n        be  returned.\n\n        :param index:\n            the zero-based record index\n        :param record:\n            a pre-created record to reduce memory reallocation, can be\n            ``None`` (default) to let the function allocate a new\n            record\n        :returns:\n            the record in which the data has been read into or raises\n            an exception (:class:`EPRValueError`) if an error occurred\n\n        ";
static PyObject *__pyx_pf_3epr_7Dataset_read_record(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint __pyx_v_index;
  struct __pyx_obj_3epr_Record *__pyx_v_record = 0;
  EPR_SRecord *__pyx_v_record_ptr;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  int __pyx_t_6;
  struct __pyx_opt_args_3epr_new_record __pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__record,0};
  __Pyx_RefNannySetupContext("read_record");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[1] = (PyObject*)((struct __pyx_obj_3epr_Record *)Py_None);
    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);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__record);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read_record") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_index = __Pyx_PyInt_from_py_uint(values[0]); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_record = ((struct __pyx_obj_3epr_Record *)values[1]);
  } else {
    __pyx_v_record = ((struct __pyx_obj_3epr_Record *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_record = ((struct __pyx_obj_3epr_Record *)PyTuple_GET_ITEM(__pyx_args, 1));
      case  1: __pyx_v_index = __Pyx_PyInt_from_py_uint(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_record", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Dataset.read_record");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF((PyObject *)__pyx_v_record);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record), __pyx_ptype_3epr_Record, 1, "record", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1888
 *         '''
 * 
 *         cdef EPR_SRecord* record_ptr = NULL             # <<<<<<<<<<<<<<
 *         if record:
 *             record_ptr = (<Record>record)._ptr
 */
  __pyx_v_record_ptr = NULL;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1889
 * 
 *         cdef EPR_SRecord* record_ptr = NULL
 *         if record:             # <<<<<<<<<<<<<<
 *             record_ptr = (<Record>record)._ptr
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_record)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1890
 *         cdef EPR_SRecord* record_ptr = NULL
 *         if record:
 *             record_ptr = (<Record>record)._ptr             # <<<<<<<<<<<<<<
 * 
 *         Py_BEGIN_ALLOW_THREADS
 */
    __pyx_v_record_ptr = __pyx_v_record->_ptr;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1892
 *             record_ptr = (<Record>record)._ptr
 * 
 *         Py_BEGIN_ALLOW_THREADS             # <<<<<<<<<<<<<<
 *         record_ptr = epr_read_record(self._ptr, index, record_ptr)
 *         Py_END_ALLOW_THREADS
 */
  Py_BEGIN_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1893
 * 
 *         Py_BEGIN_ALLOW_THREADS
 *         record_ptr = epr_read_record(self._ptr, index, record_ptr)             # <<<<<<<<<<<<<<
 *         Py_END_ALLOW_THREADS
 * 
 */
  __pyx_v_record_ptr = epr_read_record(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr, __pyx_v_index, __pyx_v_record_ptr);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1894
 *         Py_BEGIN_ALLOW_THREADS
 *         record_ptr = epr_read_record(self._ptr, index, record_ptr)
 *         Py_END_ALLOW_THREADS             # <<<<<<<<<<<<<<
 * 
 *         if record_ptr is NULL:
 */
  Py_END_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1896
 *         Py_END_ALLOW_THREADS
 * 
 *         if record_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to read record at index %d' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_record_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1897
 * 
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to read record at index %d' % index)             # <<<<<<<<<<<<<<
 * 
 *         if not record:
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __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_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1899
 *             pyepr_null_ptr_error('unable to read record at index %d' % index)
 * 
 *         if not record:             # <<<<<<<<<<<<<<
 *             record = new_record(record_ptr, self, True)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_record)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = (!__pyx_t_1);
  if (__pyx_t_6) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1900
 * 
 *         if not record:
 *             record = new_record(record_ptr, self, True)             # <<<<<<<<<<<<<<
 * 
 *         return record
 */
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.parent = __pyx_v_self;
    __pyx_t_7.dealloc = 1;
    __pyx_t_3 = __pyx_f_3epr_new_record(__pyx_v_record_ptr, &__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __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_3epr_Record))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_record));
    __pyx_v_record = ((struct __pyx_obj_3epr_Record *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1902
 *             record = new_record(record_ptr, self, True)
 * 
 *         return record             # <<<<<<<<<<<<<<
 * 
 *     # --- high level interface ------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_record));
  __pyx_r = ((PyObject *)__pyx_v_record);
  goto __pyx_L0;

  __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_AddTraceback("epr.Dataset.read_record");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF((PyObject *)__pyx_v_record);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1907
 *     # @NOTE: generator and generator expressions are not yet implemented in
 *     #        cython. As a workaround a list is used
 *     def records(self):             # <<<<<<<<<<<<<<
 *         '''Return the list of records contained in the dataset'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Dataset_records(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Dataset_records[] = "Return the list of records contained in the dataset";
static PyObject *__pyx_pf_3epr_7Dataset_records(PyObject *__pyx_v_self, PyObject *unused) {
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  uint __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("records");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1913
 *         #return list(self)
 *         cdef int idx
 *         return [self.read_record(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_records(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1914
 *         cdef int idx
 *         return [self.read_record(idx)
 *                             for idx in range(epr_get_num_records(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = epr_get_num_records(((struct __pyx_obj_3epr_Dataset *)__pyx_v_self)->_ptr);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_idx = __pyx_t_3;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1913
 *         #return list(self)
 *         cdef int idx
 *         return [self.read_record(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_records(self._ptr))]
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__read_record); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __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 = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __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 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Dataset.records");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1916
 *                             for idx in range(epr_get_num_records(self._ptr))]
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # @TODO: use generator expression when it will be available
 *         #return (self.get_field_at(idx)
 */

static PyObject *__pyx_pf_3epr_7Dataset___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Dataset___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1920
 *         #return (self.get_field_at(idx)
 *         #                    for idx in range(epr_get_num_elems(self._ptr)))
 *         return iter(self.records())             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__records); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __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("epr.Dataset.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1922
 *         return iter(self.records())
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         lines = [repr(self), '']
 *         lines.extend(map(str, self))
 */

static PyObject *__pyx_pf_3epr_7Dataset___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Dataset___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_lines;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__");
  __pyx_v_lines = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1923
 * 
 *     def __str__(self):
 *         lines = [repr(self), '']             # <<<<<<<<<<<<<<
 *         lines.extend(map(str, self))
 *         return '\n'.join(map(repr, lines))
 */
  __pyx_t_1 = PyObject_Repr(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
  __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_lines);
  __pyx_v_lines = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1924
 *     def __str__(self):
 *         lines = [repr(self), '']
 *         lines.extend(map(str, self))             # <<<<<<<<<<<<<<
 *         return '\n'.join(map(repr, lines))
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_lines, __pyx_n_s__extend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)&PyString_Type)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_3 = PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __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_3); __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1925
 *         lines = [repr(self), '']
 *         lines.extend(map(str, self))
 *         return '\n'.join(map(repr, lines))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_25), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_repr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_repr);
  __Pyx_GIVEREF(__pyx_builtin_repr);
  __Pyx_INCREF(__pyx_v_lines);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_lines);
  __Pyx_GIVEREF(__pyx_v_lines);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __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_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Dataset.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_lines);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1927
 *         return '\n'.join(map(repr, lines))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Dataset(%s) %d records' % (self.get_name(),
 *                                                self.get_num_records())
 */

static PyObject *__pyx_pf_3epr_7Dataset___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Dataset___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1928
 * 
 *     def __repr__(self):
 *         return 'epr.Dataset(%s) %d records' % (self.get_name(),             # <<<<<<<<<<<<<<
 *                                                self.get_num_records())
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1929
 *     def __repr__(self):
 *         return 'epr.Dataset(%s) %d records' % (self.get_name(),
 *                                                self.get_num_records())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_records); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Dataset.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1932
 * 
 * 
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):             # <<<<<<<<<<<<<<
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()
 */

static  PyObject *__pyx_f_3epr_new_dataset(EPR_SDatasetId *__pyx_v_ptr, struct __pyx_opt_args_3epr_new_dataset *__pyx_optional_args) {
  PyObject *__pyx_v_parent = ((PyObject *)Py_None);
  struct __pyx_obj_3epr_Dataset *__pyx_v_instance = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("new_dataset");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_parent = __pyx_optional_args->parent;
    }
  }
  __Pyx_INCREF(__pyx_v_parent);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1933
 * 
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         pyepr_null_ptr_error()
 * 
 */
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1934
 * cdef new_dataset(EPR_SDatasetId* ptr, object parent=None):
 *     if ptr is NULL:
 *         pyepr_null_ptr_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef Dataset instance = Dataset.__new__(Dataset)
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1936
 *         pyepr_null_ptr_error()
 * 
 *     cdef Dataset instance = Dataset.__new__(Dataset)             # <<<<<<<<<<<<<<
 * 
 *     instance._ptr = ptr
 */
  __pyx_t_3 = __Pyx_tp_new(((PyObject*)__pyx_ptype_3epr_Dataset)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __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_3epr_Dataset))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_instance = ((struct __pyx_obj_3epr_Dataset *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1938
 *     cdef Dataset instance = Dataset.__new__(Dataset)
 * 
 *     instance._ptr = ptr             # <<<<<<<<<<<<<<
 *     instance._parent = parent
 * 
 */
  __pyx_v_instance->_ptr = __pyx_v_ptr;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1939
 * 
 *     instance._ptr = ptr
 *     instance._parent = parent             # <<<<<<<<<<<<<<
 * 
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instance->_parent);
  __Pyx_DECREF(__pyx_v_instance->_parent);
  __pyx_v_instance->_parent = __pyx_v_parent;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1941
 *     instance._parent = parent
 * 
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
  __pyx_r = ((PyObject *)__pyx_v_instance);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.new_dataset");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
  __Pyx_DECREF(__pyx_v_parent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1956
 *     cdef EPR_SProductId* _ptr
 * 
 *     def __cinit__(self, filename, *args, **kargs):             # <<<<<<<<<<<<<<
 *         Py_BEGIN_ALLOW_THREADS
 *         self._ptr = epr_open_product(filename)
 */

static int __pyx_pf_3epr_7Product___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_3epr_7Product___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kargs = 0;
  int __pyx_r;
  char *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,0};
  __Pyx_RefNannySetupContext("__cinit__");
  __pyx_v_kargs = PyDict_New(); if (unlikely(!__pyx_v_kargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_args);

    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kargs);
      return -1;
    }
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      default:
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
    }
    if (unlikely(kw_args > 0)) {
      const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1;
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kargs, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_filename = values[0];
  } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 0);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kargs);
  __Pyx_AddTraceback("epr.Product.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_filename);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1957
 * 
 *     def __cinit__(self, filename, *args, **kargs):
 *         Py_BEGIN_ALLOW_THREADS             # <<<<<<<<<<<<<<
 *         self._ptr = epr_open_product(filename)
 *         Py_END_ALLOW_THREADS
 */
  Py_BEGIN_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1958
 *     def __cinit__(self, filename, *args, **kargs):
 *         Py_BEGIN_ALLOW_THREADS
 *         self._ptr = epr_open_product(filename)             # <<<<<<<<<<<<<<
 *         Py_END_ALLOW_THREADS
 * 
 */
  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr = epr_open_product(__pyx_t_1);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1959
 *         Py_BEGIN_ALLOW_THREADS
 *         self._ptr = epr_open_product(filename)
 *         Py_END_ALLOW_THREADS             # <<<<<<<<<<<<<<
 * 
 *         if self._ptr is NULL:
 */
  Py_END_ALLOW_THREADS;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1961
 *         Py_END_ALLOW_THREADS
 * 
 *         if self._ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to open %s' % filename)
 * 
 */
  __pyx_t_2 = (((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr == NULL);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1962
 * 
 *         if self._ptr is NULL:
 *             pyepr_null_ptr_error('unable to open %s' % filename)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_40), __pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Product.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kargs);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_filename);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1964
 *             pyepr_null_ptr_error('unable to open %s' % filename)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._ptr is not NULL:
 *             epr_close_product(self._ptr)
 */

static void __pyx_pf_3epr_7Product___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_3epr_7Product___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__dealloc__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1965
 * 
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:             # <<<<<<<<<<<<<<
 *             epr_close_product(self._ptr)
 *             pyepr_check_errors()
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr != NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1966
 *     def __dealloc__(self):
 *         if self._ptr is not NULL:
 *             epr_close_product(self._ptr)             # <<<<<<<<<<<<<<
 *             pyepr_check_errors()
 * 
 */
    epr_close_product(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr);

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1967
 *         if self._ptr is not NULL:
 *             epr_close_product(self._ptr)
 *             pyepr_check_errors()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, filename):
 */
    __pyx_t_2 = __pyx_f_3epr_pyepr_check_errors(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("epr.Product.__dealloc__");
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1969
 *             pyepr_check_errors()
 * 
 *     def __init__(self, filename):             # <<<<<<<<<<<<<<
 *         # @NOTE: this method suppresses the default behavior of EprObject
 *         #        that is raising an exception when it is instantiated by
 */

static int __pyx_pf_3epr_7Product___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_3epr_7Product___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_filename = values[0];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 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 = 1969; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.__init__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":1978
 *         '''The file's path including the file name'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.file_path is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_7Product_9file_path___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Product_9file_path___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1979
 * 
 *         def __get__(self):
 *             if self._ptr.file_path is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr->file_path == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1980
 *         def __get__(self):
 *             if self._ptr.file_path is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._ptr.file_path
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":1982
 *                 return None
 *             else:
 *                 return self._ptr.file_path             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: check
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr->file_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Product.file_path.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2000
 *         '''The total size in bytes of the product file'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.tot_size
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_8tot_size___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Product_8tot_size___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2001
 * 
 *         def __get__(self):
 *             return self._ptr.tot_size             # <<<<<<<<<<<<<<
 * 
 *     property id_string:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr->tot_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.tot_size.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2013
 *         '''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._ptr.id_string is NULL:
 *                 return None
 */

static PyObject *__pyx_pf_3epr_7Product_9id_string___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Product_9id_string___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2014
 * 
 *         def __get__(self):
 *             if self._ptr.id_string is NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr->id_string == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2015
 *         def __get__(self):
 *             if self._ptr.id_string is NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._ptr.id_string
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2017
 *                 return None
 *             else:
 *                 return self._ptr.id_string             # <<<<<<<<<<<<<<
 * 
 *     property meris_iodd_version:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr->id_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("epr.Product.id_string.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2022
 *         '''For MERIS L1b and RR and FR to provide backward compatibility'''
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._ptr.meris_iodd_version
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_18meris_iodd_version___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Product_18meris_iodd_version___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2023
 * 
 *         def __get__(self):
 *             return self._ptr.meris_iodd_version             # <<<<<<<<<<<<<<
 * 
 *     def get_scene_width(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr->meris_iodd_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.meris_iodd_version.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2025
 *             return self._ptr.meris_iodd_version
 * 
 *     def get_scene_width(self):             # <<<<<<<<<<<<<<
 *         '''Gets the product's scene width in pixels'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_scene_width(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_scene_width[] = "Gets the product's scene width in pixels";
static PyObject *__pyx_pf_3epr_7Product_get_scene_width(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_scene_width");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2028
 *         '''Gets the product's scene width in pixels'''
 * 
 *         return epr_get_scene_width(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_scene_height(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_scene_width(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_scene_width");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2030
 *         return epr_get_scene_width(self._ptr)
 * 
 *     def get_scene_height(self):             # <<<<<<<<<<<<<<
 *         '''Gets the product's scene height in pixels'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_scene_height(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_scene_height[] = "Gets the product's scene height in pixels";
static PyObject *__pyx_pf_3epr_7Product_get_scene_height(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_scene_height");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2033
 *         '''Gets the product's scene height in pixels'''
 * 
 *         return epr_get_scene_height(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_num_datasets(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_scene_height(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_scene_height");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2035
 *         return epr_get_scene_height(self._ptr)
 * 
 *     def get_num_datasets(self):             # <<<<<<<<<<<<<<
 *         '''Gets the number of all datasets contained in a product'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_num_datasets(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_num_datasets[] = "Gets the number of all datasets contained in a product";
static PyObject *__pyx_pf_3epr_7Product_get_num_datasets(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_num_datasets");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2038
 *         '''Gets the number of all datasets contained in a product'''
 * 
 *         return epr_get_num_datasets(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_num_dsds(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_datasets(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_num_datasets");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2040
 *         return epr_get_num_datasets(self._ptr)
 * 
 *     def get_num_dsds(self):             # <<<<<<<<<<<<<<
 *         '''Gets the number of all DSDs (dataset descriptors) contained
 *         in the product'''
 */

static PyObject *__pyx_pf_3epr_7Product_get_num_dsds(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_num_dsds[] = "Gets the number of all DSDs (dataset descriptors) contained\n        in the product";
static PyObject *__pyx_pf_3epr_7Product_get_num_dsds(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_num_dsds");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2044
 *         in the product'''
 * 
 *         return epr_get_num_dsds(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_num_bands(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_dsds(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_num_dsds");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2046
 *         return epr_get_num_dsds(self._ptr)
 * 
 *     def get_num_bands(self):             # <<<<<<<<<<<<<<
 *         '''Gets the number of all bands contained in a product'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_num_bands(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_num_bands[] = "Gets the number of all bands contained in a product";
static PyObject *__pyx_pf_3epr_7Product_get_num_bands(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_num_bands");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2049
 *         '''Gets the number of all bands contained in a product'''
 * 
 *         return epr_get_num_bands(self._ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_dataset_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_uint(epr_get_num_bands(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("epr.Product.get_num_bands");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2051
 *         return epr_get_num_bands(self._ptr)
 * 
 *     def get_dataset_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''Gets the dataset at the specified position within the product
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_dataset_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_7Product_get_dataset_at[] = "Gets the dataset at the specified position within the product\n\n        :param index:\n            the index identifying the position of the dataset, starting\n            with 0, must not be negative\n        :returns:\n            the requested :class:`Dataset`\n\n        ";
static PyObject *__pyx_pf_3epr_7Product_get_dataset_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  EPR_SDatasetId *__pyx_v_dataset_id;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_dataset __pyx_t_6;
  __Pyx_RefNannySetupContext("get_dataset_at");
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.get_dataset_at");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2063
 * 
 *         cdef EPR_SDatasetId* dataset_id
 *         dataset_id = epr_get_dataset_id_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)
 */
  __pyx_v_dataset_id = epr_get_dataset_id_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr, __pyx_v_index);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2064
 *         cdef EPR_SDatasetId* dataset_id
 *         dataset_id = epr_get_dataset_id_at(self._ptr, index)
 *         if dataset_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_dataset_id == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2065
 *         dataset_id = epr_get_dataset_id_at(self._ptr, index)
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_dataset(dataset_id, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_41), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __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_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2067
 *             pyepr_null_ptr_error('unable to get dataset at index %d' % index)
 * 
 *         return new_dataset(dataset_id, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_dataset(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = __pyx_v_self;
  __pyx_t_3 = __pyx_f_3epr_new_dataset(__pyx_v_dataset_id, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.get_dataset_at");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2069
 *         return new_dataset(dataset_id, self)
 * 
 *     def get_dataset(self, name):             # <<<<<<<<<<<<<<
 *         '''Gets the dataset corresponding to the specified dataset name
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_dataset(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_3epr_7Product_get_dataset[] = "Gets the dataset corresponding to the specified dataset name\n\n        :param name:\n            the dataset name\n        :returns:\n            the requested :class:`Dataset` instance\n\n        ";
static PyObject *__pyx_pf_3epr_7Product_get_dataset(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  EPR_SDatasetId *__pyx_v_dataset_id;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_dataset __pyx_t_6;
  __Pyx_RefNannySetupContext("get_dataset");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_name);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2080
 * 
 *         cdef EPR_SDatasetId* dataset_id
 *         dataset_id = epr_get_dataset_id(self._ptr, name)             # <<<<<<<<<<<<<<
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error('unable to get dataset "%s"' % name)
 */
  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dataset_id = epr_get_dataset_id(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr, __pyx_t_1);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2081
 *         cdef EPR_SDatasetId* dataset_id
 *         dataset_id = epr_get_dataset_id(self._ptr, name)
 *         if dataset_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get dataset "%s"' % name)
 * 
 */
  __pyx_t_2 = (__pyx_v_dataset_id == NULL);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2082
 *         dataset_id = epr_get_dataset_id(self._ptr, name)
 *         if dataset_id is NULL:
 *             pyepr_null_ptr_error('unable to get dataset "%s"' % name)             # <<<<<<<<<<<<<<
 * 
 *         return new_dataset(dataset_id, self)
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_42), __pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2084
 *             pyepr_null_ptr_error('unable to get dataset "%s"' % name)
 * 
 *         return new_dataset(dataset_id, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_dsd_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = __pyx_v_self;
  __pyx_t_3 = __pyx_f_3epr_new_dataset(__pyx_v_dataset_id, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Product.get_dataset");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2086
 *         return new_dataset(dataset_id, self)
 * 
 *     def get_dsd_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''Gets the DSD at the specified position
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_dsd_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_7Product_get_dsd_at[] = "Gets the DSD at the specified position\n\n        Gets the DSD (dataset descriptor) at the specified position\n        within the product.\n\n        :param index:\n            the index identifying the position of the DSD, starting\n            with 0, must not be negative\n        :returns:\n            the requested :class:`DSD` instance\n\n        ";
static PyObject *__pyx_pf_3epr_7Product_get_dsd_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  EPR_SDSD *__pyx_v_dsd_ptr;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_dsd __pyx_t_6;
  __Pyx_RefNannySetupContext("get_dsd_at");
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.get_dsd_at");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2101
 * 
 *         cdef EPR_SDSD* dsd_ptr
 *         dsd_ptr = epr_get_dsd_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if dsd_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)
 */
  __pyx_v_dsd_ptr = epr_get_dsd_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr, __pyx_v_index);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2102
 *         cdef EPR_SDSD* dsd_ptr
 *         dsd_ptr = epr_get_dsd_at(self._ptr, index)
 *         if dsd_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_dsd_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2103
 *         dsd_ptr = epr_get_dsd_at(self._ptr, index)
 *         if dsd_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_dsd(dsd_ptr, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_43), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; __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_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2105
 *             pyepr_null_ptr_error('unable to get DSD at index "%d"' % index)
 * 
 *         return new_dsd(dsd_ptr, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_mph(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = __pyx_v_self;
  __pyx_t_3 = __pyx_f_3epr_new_dsd(__pyx_v_dsd_ptr, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.get_dsd_at");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2107
 *         return new_dsd(dsd_ptr, self)
 * 
 *     def get_mph(self):             # <<<<<<<<<<<<<<
 *         '''The :class:`Record` representing the main product header (MPH)'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_mph(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_mph[] = "The :class:`Record` representing the main product header (MPH)";
static PyObject *__pyx_pf_3epr_7Product_get_mph(PyObject *__pyx_v_self, PyObject *unused) {
  EPR_SRecord *__pyx_v_record_ptr;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_3epr_new_record __pyx_t_5;
  __Pyx_RefNannySetupContext("get_mph");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2111
 * 
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_mph(self._ptr)             # <<<<<<<<<<<<<<
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get MPH record')
 */
  __pyx_v_record_ptr = epr_get_mph(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2112
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_mph(self._ptr)
 *         if record_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get MPH record')
 * 
 */
  __pyx_t_1 = (__pyx_v_record_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2113
 *         record_ptr = epr_get_mph(self._ptr)
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get MPH record')             # <<<<<<<<<<<<<<
 * 
 *         return new_record(record_ptr, self, False)
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.msg = ((PyObject *)__pyx_kp_s_44);
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2115
 *             pyepr_null_ptr_error('unable to get MPH record')
 * 
 *         return new_record(record_ptr, self, False)             # <<<<<<<<<<<<<<
 * 
 *     def get_sph(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.parent = __pyx_v_self;
  __pyx_t_5.dealloc = 0;
  __pyx_t_4 = __pyx_f_3epr_new_record(__pyx_v_record_ptr, &__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr.Product.get_mph");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2117
 *         return new_record(record_ptr, self, False)
 * 
 *     def get_sph(self):             # <<<<<<<<<<<<<<
 *         '''The :class:`Record` representing the specific product header (SPH)'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_sph(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_sph[] = "The :class:`Record` representing the specific product header (SPH)";
static PyObject *__pyx_pf_3epr_7Product_get_sph(PyObject *__pyx_v_self, PyObject *unused) {
  EPR_SRecord *__pyx_v_record_ptr;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_3epr_new_record __pyx_t_5;
  __Pyx_RefNannySetupContext("get_sph");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2121
 * 
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_sph(self._ptr)             # <<<<<<<<<<<<<<
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get SPH record')
 */
  __pyx_v_record_ptr = epr_get_sph(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2122
 *         cdef EPR_SRecord* record_ptr
 *         record_ptr = epr_get_sph(self._ptr)
 *         if record_ptr is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get SPH record')
 * 
 */
  __pyx_t_1 = (__pyx_v_record_ptr == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2123
 *         record_ptr = epr_get_sph(self._ptr)
 *         if record_ptr is NULL:
 *             pyepr_null_ptr_error('unable to get SPH record')             # <<<<<<<<<<<<<<
 * 
 *         return new_record(record_ptr, self, False)
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.msg = ((PyObject *)__pyx_kp_s_45);
    __pyx_t_2 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2125
 *             pyepr_null_ptr_error('unable to get SPH record')
 * 
 *         return new_record(record_ptr, self, False)             # <<<<<<<<<<<<<<
 * 
 *     def get_band(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.parent = __pyx_v_self;
  __pyx_t_5.dealloc = 0;
  __pyx_t_4 = __pyx_f_3epr_new_record(__pyx_v_record_ptr, &__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr.Product.get_sph");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2127
 *         return new_record(record_ptr, self, False)
 * 
 *     def get_band(self, name):             # <<<<<<<<<<<<<<
 *         '''Gets the band corresponding to the specified name.
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_band(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_3epr_7Product_get_band[] = "Gets the band corresponding to the specified name.\n\n        :param name:\n            the name of the band\n        :returns:\n            the requested :class:`Band` instance, or raises a\n            :class:`EPRValueError` if not found\n\n        ";
static PyObject *__pyx_pf_3epr_7Product_get_band(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  EPR_SBandId *__pyx_v_band_id;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_band __pyx_t_6;
  __Pyx_RefNannySetupContext("get_band");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_name);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2139
 * 
 *         cdef EPR_SBandId* band_id
 *         band_id = epr_get_band_id(self._ptr, name)             # <<<<<<<<<<<<<<
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)
 */
  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_band_id = epr_get_band_id(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr, __pyx_t_1);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2140
 *         cdef EPR_SBandId* band_id
 *         band_id = epr_get_band_id(self._ptr, name)
 *         if band_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)
 * 
 */
  __pyx_t_2 = (__pyx_v_band_id == NULL);
  if (__pyx_t_2) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2141
 *         band_id = epr_get_band_id(self._ptr, name)
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)             # <<<<<<<<<<<<<<
 * 
 *         return new_band(band_id, self)
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_46), __pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2143
 *             pyepr_null_ptr_error('unable to get band "%s"' % name)
 * 
 *         return new_band(band_id, self)             # <<<<<<<<<<<<<<
 * 
 *     def get_band_at(self, uint index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = __pyx_v_self;
  __pyx_t_3 = __pyx_f_3epr_new_band(__pyx_v_band_id, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Product.get_band");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2145
 *         return new_band(band_id, self)
 * 
 *     def get_band_at(self, uint index):             # <<<<<<<<<<<<<<
 *         '''Gets the band at the specified position within the product
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_band_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_3epr_7Product_get_band_at[] = "Gets the band at the specified position within the product\n\n        :param index:\n            the index identifying the position of the band, starting\n            with 0, must not be negative\n        :returns:\n            the requested :class:`Band` instance, or raises a\n            :class:`EPRValueError` if not found\n\n        ";
static PyObject *__pyx_pf_3epr_7Product_get_band_at(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  uint __pyx_v_index;
  EPR_SBandId *__pyx_v_band_id;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_3epr_pyepr_null_ptr_error __pyx_t_5;
  struct __pyx_opt_args_3epr_new_band __pyx_t_6;
  __Pyx_RefNannySetupContext("get_band_at");
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyInt_from_py_uint(__pyx_arg_index); if (unlikely((__pyx_v_index == (uint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("epr.Product.get_band_at");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2158
 * 
 *         cdef EPR_SBandId* band_id
 *         band_id = epr_get_band_id_at(self._ptr, index)             # <<<<<<<<<<<<<<
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)
 */
  __pyx_v_band_id = epr_get_band_id_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr, __pyx_v_index);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2159
 *         cdef EPR_SBandId* band_id
 *         band_id = epr_get_band_id_at(self._ptr, index)
 *         if band_id is NULL:             # <<<<<<<<<<<<<<
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)
 * 
 */
  __pyx_t_1 = (__pyx_v_band_id == NULL);
  if (__pyx_t_1) {

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2160
 *         band_id = epr_get_band_id_at(self._ptr, index)
 *         if band_id is NULL:
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)             # <<<<<<<<<<<<<<
 * 
 *         return new_band(band_id, self)
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_uint(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_47), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __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_n = 1;
    __pyx_t_5.msg = __pyx_t_3;
    __pyx_t_4 = __pyx_f_3epr_pyepr_null_ptr_error(&__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2162
 *             pyepr_null_ptr_error('unable to get band at index "%d"' % index)
 * 
 *         return new_band(band_id, self)             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: complete and make it more pythonic
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.parent = __pyx_v_self;
  __pyx_t_3 = __pyx_f_3epr_new_band(__pyx_v_band_id, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_AddTraceback("epr.Product.get_band_at");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2212
 * 
 *     # --- high level interface ------------------------------------------------
 *     def get_dataset_names(self):             # <<<<<<<<<<<<<<
 *         '''Return the list of names of the datasets in the product
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_dataset_names(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_dataset_names[] = "Return the list of names of the datasets in the product\n\n        .. note:: this method has no correspondent in the C API\n\n        ";
static PyObject *__pyx_pf_3epr_7Product_get_dataset_names(PyObject *__pyx_v_self, PyObject *unused) {
  EPR_SDatasetId *__pyx_v_dataset_ptr;
  int __pyx_v_idx;
  PyObject *__pyx_v_names;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("get_dataset_names");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_names = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2221
 *         cdef EPR_SDatasetId* dataset_ptr
 *         cdef int idx
 *         names = []             # <<<<<<<<<<<<<<
 *         for idx in range(self.get_num_datasets()):
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_names);
  __pyx_v_names = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2222
 *         cdef int idx
 *         names = []
 *         for idx in range(self.get_num_datasets()):             # <<<<<<<<<<<<<<
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)
 *             names.append(epr_get_dataset_name(dataset_ptr))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_datasets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_idx = __pyx_t_4;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2223
 *         names = []
 *         for idx in range(self.get_num_datasets()):
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)             # <<<<<<<<<<<<<<
 *             names.append(epr_get_dataset_name(dataset_ptr))
 * 
 */
    __pyx_v_dataset_ptr = epr_get_dataset_id_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr, __pyx_v_idx);

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2224
 *         for idx in range(self.get_num_datasets()):
 *             dataset_ptr = epr_get_dataset_id_at(self._ptr, idx)
 *             names.append(epr_get_dataset_name(dataset_ptr))             # <<<<<<<<<<<<<<
 * 
 *         return names
 */
    __pyx_t_2 = __Pyx_PyBytes_FromString(epr_get_dataset_name(__pyx_v_dataset_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_names, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2226
 *             names.append(epr_get_dataset_name(dataset_ptr))
 * 
 *         return names             # <<<<<<<<<<<<<<
 * 
 *     def get_band_names(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_names);
  __pyx_r = __pyx_v_names;
  goto __pyx_L0;

  __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("epr.Product.get_dataset_names");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_names);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2228
 *         return names
 * 
 *     def get_band_names(self):             # <<<<<<<<<<<<<<
 *         '''Return the list of names of the bands in the product
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_get_band_names(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_get_band_names[] = "Return the list of names of the bands in the product\n\n        .. note:: this method has no correspondent in the C API\n\n        ";
static PyObject *__pyx_pf_3epr_7Product_get_band_names(PyObject *__pyx_v_self, PyObject *unused) {
  EPR_SBandId *__pyx_v_band_ptr;
  int __pyx_v_idx;
  PyObject *__pyx_v_names;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("get_band_names");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_names = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2237
 *         cdef EPR_SBandId* band_ptr
 *         cdef int idx
 *         names = []             # <<<<<<<<<<<<<<
 *         for idx in range(self.get_num_bands()):
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_names);
  __pyx_v_names = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2238
 *         cdef int idx
 *         names = []
 *         for idx in range(self.get_num_bands()):             # <<<<<<<<<<<<<<
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)
 *             names.append(epr_get_band_name(band_ptr))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_bands); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_idx = __pyx_t_4;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2239
 *         names = []
 *         for idx in range(self.get_num_bands()):
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)             # <<<<<<<<<<<<<<
 *             names.append(epr_get_band_name(band_ptr))
 * 
 */
    __pyx_v_band_ptr = epr_get_band_id_at(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr, __pyx_v_idx);

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2240
 *         for idx in range(self.get_num_bands()):
 *             band_ptr = epr_get_band_id_at(self._ptr, idx)
 *             names.append(epr_get_band_name(band_ptr))             # <<<<<<<<<<<<<<
 * 
 *         return names
 */
    __pyx_t_2 = __Pyx_PyBytes_FromString(epr_get_band_name(__pyx_v_band_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_names, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2242
 *             names.append(epr_get_band_name(band_ptr))
 * 
 *         return names             # <<<<<<<<<<<<<<
 * 
 *     # @NOTE: generator and generator expressions are not yet implemented in
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_names);
  __pyx_r = __pyx_v_names;
  goto __pyx_L0;

  __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("epr.Product.get_band_names");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_names);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2246
 *     # @NOTE: generator and generator expressions are not yet implemented in
 *     #        cython. As a workaround a list is used
 *     def datasets(self):             # <<<<<<<<<<<<<<
 *         '''Return the list of dataset in the product'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_datasets(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_datasets[] = "Return the list of dataset in the product";
static PyObject *__pyx_pf_3epr_7Product_datasets(PyObject *__pyx_v_self, PyObject *unused) {
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  uint __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("datasets");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2250
 * 
 *         cdef int idx
 *         return [self.get_dataset_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_datasets(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2251
 *         cdef int idx
 *         return [self.get_dataset_at(idx)
 *                             for idx in range(epr_get_num_datasets(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     def bands(self):
 */
  __pyx_t_2 = epr_get_num_datasets(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_idx = __pyx_t_3;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2250
 * 
 *         cdef int idx
 *         return [self.get_dataset_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_datasets(self._ptr))]
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_dataset_at); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __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 = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __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 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Product.datasets");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2253
 *                             for idx in range(epr_get_num_datasets(self._ptr))]
 * 
 *     def bands(self):             # <<<<<<<<<<<<<<
 *         '''Return the list of bands in the product'''
 * 
 */

static PyObject *__pyx_pf_3epr_7Product_bands(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_3epr_7Product_bands[] = "Return the list of bands in the product";
static PyObject *__pyx_pf_3epr_7Product_bands(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_idx;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __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;
  __Pyx_RefNannySetupContext("bands");
  __pyx_v_idx = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2256
 *         '''Return the list of bands in the product'''
 * 
 *         return [self.get_band_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_bands(self._ptr))]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2257
 * 
 *         return [self.get_band_at(idx)
 *                             for idx in range(epr_get_num_bands(self._ptr))]             # <<<<<<<<<<<<<<
 * 
 *     # @TODO: iter on both datasets and bands (??)
 */
  __pyx_t_3 = __Pyx_PyInt_to_py_uint(epr_get_num_bands(((struct __pyx_obj_3epr_Product *)__pyx_v_self)->_ptr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __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 = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_4))) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
    } else {
      __pyx_t_3 = PyIter_Next(__pyx_t_4);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_v_idx);
    __pyx_v_idx = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/antonio/projects/pyepr/src/epr.pyx":2256
 *         '''Return the list of bands in the product'''
 * 
 *         return [self.get_band_at(idx)             # <<<<<<<<<<<<<<
 *                             for idx in range(epr_get_num_bands(self._ptr))]
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_band_at); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __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 = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_idx);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_idx);
    __Pyx_GIVEREF(__pyx_v_idx);
    __pyx_t_6 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6); if (unlikely(__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("epr.Product.bands");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_idx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2263
 *     #    return itertools.chain((self.datasets(), self.bands()))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'epr.Product(%s) %d datasets, %d bands' % (self.id_string,
 *                                 self.get_num_datasets(), self.get_num_bands())
 */

static PyObject *__pyx_pf_3epr_7Product___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Product___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2264
 * 
 *     def __repr__(self):
 *         return 'epr.Product(%s) %d datasets, %d bands' % (self.id_string,             # <<<<<<<<<<<<<<
 *                                 self.get_num_datasets(), self.get_num_bands())
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__id_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2265
 *     def __repr__(self):
 *         return 'epr.Product(%s) %d datasets, %d bands' % (self.id_string,
 *                                 self.get_num_datasets(), self.get_num_bands())             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_datasets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_num_bands); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("epr.Product.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2267
 *                                 self.get_num_datasets(), self.get_num_bands())
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         lines = [repr(self), '']
 *         lines.extend(map(repr, self.datasets()))
 */

static PyObject *__pyx_pf_3epr_7Product___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_3epr_7Product___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_lines;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__");
  __pyx_v_lines = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2268
 * 
 *     def __str__(self):
 *         lines = [repr(self), '']             # <<<<<<<<<<<<<<
 *         lines.extend(map(repr, self.datasets()))
 *         lines.append('')
 */
  __pyx_t_1 = PyObject_Repr(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
  __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_lines);
  __pyx_v_lines = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2269
 *     def __str__(self):
 *         lines = [repr(self), '']
 *         lines.extend(map(repr, self.datasets()))             # <<<<<<<<<<<<<<
 *         lines.append('')
 *         lines.extend(map(repr, self.bands()))
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_lines, __pyx_n_s__extend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__datasets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_repr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_repr);
  __Pyx_GIVEREF(__pyx_builtin_repr);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __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_3); __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2270
 *         lines = [repr(self), '']
 *         lines.extend(map(repr, self.datasets()))
 *         lines.append('')             # <<<<<<<<<<<<<<
 *         lines.extend(map(repr, self.bands()))
 *         return '\n'.join(map(repr, lines))
 */
  __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_lines, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2271
 *         lines.extend(map(repr, self.datasets()))
 *         lines.append('')
 *         lines.extend(map(repr, self.bands()))             # <<<<<<<<<<<<<<
 *         return '\n'.join(map(repr, lines))
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_lines, __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bands); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_repr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_repr);
  __Pyx_GIVEREF(__pyx_builtin_repr);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2272
 *         lines.append('')
 *         lines.extend(map(repr, self.bands()))
 *         return '\n'.join(map(repr, lines))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_25), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_repr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_repr);
  __Pyx_GIVEREF(__pyx_builtin_repr);
  __Pyx_INCREF(__pyx_v_lines);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_lines);
  __Pyx_GIVEREF(__pyx_v_lines);
  __pyx_t_3 = PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __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_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("epr.Product.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_lines);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2275
 * 
 * 
 * def open(filename):             # <<<<<<<<<<<<<<
 *     '''Opens the ENVISAT product
 * 
 */

static PyObject *__pyx_pf_3epr_open(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_3epr_open[] = "Opens the ENVISAT product\n\n    Opens the ENVISAT product file with the given file path, reads MPH,\n    SPH and all DSDs, organized the table with parameter of line length\n    and tie points number.\n\n    :param product_file_path:\n        the path to the ENVISAT product file\n    :returns:\n        the :class:`Product` instance representing the specified\n        product. An exception (:class:`ValueError`) is raised if the\n        file could not be opened.\n\n    .. seealso :class:`Product`\n\n    ";
static PyObject *__pyx_pf_3epr_open(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("open");
  __pyx_self = __pyx_self;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2293
 *     '''
 * 
 *     return Product(filename)             # <<<<<<<<<<<<<<
 * 
 * # library initialization/finalization
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3epr_Product)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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("epr.open");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/antonio/projects/pyepr/src/epr.pyx":2302
 * 
 * @atexit.register
 * def _close_api():             # <<<<<<<<<<<<<<
 *     global _EPR_C_LIB
 *     _EPR_C_LIB = None
 */

static PyObject *__pyx_pf_3epr__close_api(PyObject *__pyx_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_3epr__close_api(PyObject *__pyx_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("_close_api");
  __pyx_self = __pyx_self;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2304
 * def _close_api():
 *     global _EPR_C_LIB
 *     _EPR_C_LIB = None             # <<<<<<<<<<<<<<
 * del atexit
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GOTREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_DECREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(Py_None);
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr_CLib *)Py_None);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":187
 *         # 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.
 */

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_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;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("__getbuffer__");
  if (__pyx_v_info == NULL) return 0;
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":193
 *             # of flags
 *             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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":194
 *             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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":196
 *             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(((PyArrayObject *)__pyx_v_self));

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":198
 *             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)));
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":201
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L5:;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":203
 *                 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_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":204
 * 
 *             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(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":205
 *             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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_kp_u_49));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_49));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_49));
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":207
 *                 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_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  if (__pyx_t_3) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":208
 * 
 *             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_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":209
 *             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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_kp_u_50));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_50));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_50));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":211
 *                 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(((PyArrayObject *)__pyx_v_self));

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info. This is allocated
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":213
 *             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_6 = __pyx_v_copy_shape;
  if (__pyx_t_6) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":216
 *                 # 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) * ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2)));

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":217
 *                 # as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":218
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_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_6 = __pyx_v_ndim;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":219
 *                 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(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":220
 *                 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(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222
 *                     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
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223
 *             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(((PyArrayObject *)__pyx_v_self)));
  }
  __pyx_L8:;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224
 *                 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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":225
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":226
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":230
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
  __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":234
 *             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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":236
 *             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);
  if (__pyx_t_2) {
    __pyx_t_3 = (!__pyx_v_copy_shape);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":238
 *             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;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":241
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = __pyx_v_self;
  }
  __pyx_L11:;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":243
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 */
    __pyx_v_t = __pyx_v_descr->type_num;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":245
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_v_little_endian;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (!__pyx_t_2) {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":246
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
      if (__pyx_t_1) {
        __pyx_t_3 = (!__pyx_v_little_endian);
        __pyx_t_8 = __pyx_t_3;
      } else {
        __pyx_t_8 = __pyx_t_1;
      }
      __pyx_t_1 = __pyx_t_8;
    } else {
      __pyx_t_1 = __pyx_t_2;
    }
    if (__pyx_t_1) {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":247
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(((PyObject *)__pyx_kp_u_51));
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_51));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_51));
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":248
 *                     (descr.byteorder == '<' 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"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__b;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":249
 *                     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"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__B;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":250
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__h;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":251
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__H;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":252
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_INT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__i;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":253
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__I;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":254
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__l;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":255
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__L;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":256
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__q;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":257
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Q;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":258
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__f;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":259
 *                 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"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__d;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":260
 *                 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"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__g;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":261
 *                 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"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zf;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":262
 *                 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"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zd;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":263
 *                 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:
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zg;
      goto __pyx_L14;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":264
 *                 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)
 */
    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__O;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":266
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_52), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L14:;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":267
 *                 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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":268
 *                     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;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":270
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":271
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":272
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # 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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":275
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 f[0] = 0 # Terminate format string
 * 
 */
    __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":276
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = 0;
  }
  __pyx_L12:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
  __pyx_r = -1;
  __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->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_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":278
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279
 * 
 *         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(((PyArrayObject *)__pyx_v_self));
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":280
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":281
 *             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)));
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":282
 *                 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);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":755
 * 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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1");

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":756
 * 
 * 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[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758
 *     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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2");

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":759
 * 
 * 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[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761
 *     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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3");

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":762
 * 
 * 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[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764
 *     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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4");

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":765
 * 
 * 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[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767
 *     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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5");

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":768
 * 
 * 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[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770
 *     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;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields;
  PyObject *__pyx_v_childname;
  PyObject *__pyx_v_new_offset;
  PyObject *__pyx_v_t;
  char *__pyx_r;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  char *__pyx_t_10;
  __Pyx_RefNannySetupContext("_util_dtypestring");
  __Pyx_INCREF((PyObject *)__pyx_v_descr);
  __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_t = Py_None; __Pyx_INCREF(Py_None);

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":777
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":778
 *     cdef tuple i
 *     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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":781
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) {
    __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2);
  } else {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    __Pyx_DECREF(__pyx_v_childname);
    __pyx_v_childname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":782
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __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 tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_fields));
    __pyx_v_fields = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":783
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) {
      PyObject* tuple = ((PyObject *)__pyx_v_fields);
      __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_v_child));
      __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_new_offset);
      __pyx_v_new_offset = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":785
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":786
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(((PyObject *)__pyx_kp_u_53));
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_53));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_53));
      __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":788
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_6 = (__pyx_v_child->byteorder == '>');
    if (__pyx_t_6) {
      __pyx_t_7 = __pyx_v_little_endian;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    if (!__pyx_t_7) {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":789
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' 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_6 = (__pyx_v_child->byteorder == '<');
      if (__pyx_t_6) {
        __pyx_t_8 = (!__pyx_v_little_endian);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_6;
      }
      __pyx_t_6 = __pyx_t_9;
    } else {
      __pyx_t_6 = __pyx_t_7;
    }
    if (__pyx_t_6) {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":790
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' 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 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_kp_u_51));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_51));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_51));
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":800
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_6) break;

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":801
 *         # 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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":802
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f += 1;

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      (__pyx_v_offset[0]) += 1;
    }

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    (__pyx_v_offset[0]) += __pyx_v_child->elsize;

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807
 *         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));
    if (__pyx_t_6) {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":808
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_t);
      __pyx_v_t = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":809
 *         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);
      if (__pyx_t_6) {

        /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":810
 *             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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(((PyObject *)__pyx_kp_u_54));
        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_54));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_54));
        __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":813
 * 
 *             # 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_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __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_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":814
 *             # 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 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":815
 *             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_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __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_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":816
 *             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 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":817
 *             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_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __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_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":818
 *             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 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":819
 *             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_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __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_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":820
 *             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 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":821
 *             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_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __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_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":822
 *             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 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":823
 *             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_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __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_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":824
 *             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 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":825
 *             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_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __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_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":826
 *             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 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f += 1;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":827
 *             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_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __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 += 1;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":828
 *             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 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f += 1;
        goto __pyx_L11;
      }

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":829
 *             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_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __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_L11;
      }
      /*else*/ {

        /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":831
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_52), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __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[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L11:;

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":832
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f += 1;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":836
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_10;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":837
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("numpy._util_dtypestring");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_child);
  __Pyx_DECREF(__pyx_v_fields);
  __Pyx_DECREF(__pyx_v_childname);
  __Pyx_DECREF(__pyx_v_new_offset);
  __Pyx_DECREF(__pyx_v_t);
  __Pyx_DECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":952
 * 
 * 
 * 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;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_array_base");
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_INCREF(__pyx_v_base);

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":954
 * 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);
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":955
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":957
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    Py_INCREF(__pyx_v_base);

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":958
 *      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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":959
 *          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/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":960
 *          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;

  __Pyx_DECREF((PyObject *)__pyx_v_arr);
  __Pyx_DECREF(__pyx_v_base);
  __Pyx_RefNannyFinishContext();
}

/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962
 *      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;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base");
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":963
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr->base == NULL);
  if (__pyx_t_1) {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":964
 * 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;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_3epr_CLib(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_3epr_4CLib___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3epr_CLib(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_3epr_4CLib___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static struct PyMethodDef __pyx_methods_3epr_CLib[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CLib = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CLib = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CLib = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CLib = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_CLib = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.CLib"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_CLib), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_CLib, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_CLib, /*tp_as_number*/
  &__pyx_tp_as_sequence_CLib, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CLib, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CLib, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  __Pyx_DOCSTR("Library object to handle C API initialization/finalization"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_CLib, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_CLib, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_EprObject(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_EprObject *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_EprObject *)o);
  p->epr_c_lib = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_3epr_9EprObject___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3epr_EprObject(PyObject *o) {
  struct __pyx_obj_3epr_EprObject *p = (struct __pyx_obj_3epr_EprObject *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_3epr_9EprObject___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->epr_c_lib);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_3epr_EprObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_EprObject *p = (struct __pyx_obj_3epr_EprObject *)o;
  if (p->epr_c_lib) {
    e = (*v)(p->epr_c_lib, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_EprObject(PyObject *o) {
  struct __pyx_obj_3epr_EprObject *p = (struct __pyx_obj_3epr_EprObject *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->epr_c_lib);
  p->epr_c_lib = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_3epr_EprObject[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_EprObject = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_EprObject = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_EprObject = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_EprObject = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_EprObject = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.EprObject"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_EprObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_EprObject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_EprObject, /*tp_as_number*/
  &__pyx_tp_as_sequence_EprObject, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_EprObject, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_EprObject, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3epr_EprObject, /*tp_traverse*/
  __pyx_tp_clear_3epr_EprObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_EprObject, /*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_pf_3epr_9EprObject___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_EprObject, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_DSD(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_DSD *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_DSD *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_DSD(PyObject *o) {
  struct __pyx_obj_3epr_DSD *p = (struct __pyx_obj_3epr_DSD *)o;
  Py_XDECREF(p->_parent);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_DSD(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_DSD *p = (struct __pyx_obj_3epr_DSD *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_DSD(PyObject *o) {
  struct __pyx_obj_3epr_DSD *p = (struct __pyx_obj_3epr_DSD *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_3DSD_index(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_5index___get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_name(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_7ds_name___get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_type(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_7ds_type___get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_filename(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_8filename___get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_offset(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_9ds_offset___get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_ds_size(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_7ds_size___get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_num_dsr(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_7num_dsr___get__(o);
}

static PyObject *__pyx_getprop_3epr_3DSD_dsr_size(PyObject *o, void *x) {
  return __pyx_pf_3epr_3DSD_8dsr_size___get__(o);
}

static struct PyMethodDef __pyx_methods_3epr_DSD[] = {
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_3epr_3DSD___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_DSD[] = {
  {(char *)"index", __pyx_getprop_3epr_3DSD_index, 0, __Pyx_DOCSTR(__pyx_k_55), 0},
  {(char *)"ds_name", __pyx_getprop_3epr_3DSD_ds_name, 0, __Pyx_DOCSTR(__pyx_k_56), 0},
  {(char *)"ds_type", __pyx_getprop_3epr_3DSD_ds_type, 0, __Pyx_DOCSTR(__pyx_k_57), 0},
  {(char *)"filename", __pyx_getprop_3epr_3DSD_filename, 0, __Pyx_DOCSTR(__pyx_k_58), 0},
  {(char *)"ds_offset", __pyx_getprop_3epr_3DSD_ds_offset, 0, __Pyx_DOCSTR(__pyx_k_59), 0},
  {(char *)"ds_size", __pyx_getprop_3epr_3DSD_ds_size, 0, __Pyx_DOCSTR(__pyx_k_60), 0},
  {(char *)"num_dsr", __pyx_getprop_3epr_3DSD_num_dsr, 0, __Pyx_DOCSTR(__pyx_k_61), 0},
  {(char *)"dsr_size", __pyx_getprop_3epr_3DSD_dsr_size, 0, __Pyx_DOCSTR(__pyx_k_62), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DSD = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_DSD = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_DSD = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DSD = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_DSD = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.DSD"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_DSD), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_DSD, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_3epr_3DSD___repr__, /*tp_repr*/
  &__pyx_tp_as_number_DSD, /*tp_as_number*/
  &__pyx_tp_as_sequence_DSD, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_DSD, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_DSD, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Dataset descriptor\n\n    The DSD class contains information about the properties of a\n    dataset and its location within an ENVISAT product file\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_DSD, /*tp_traverse*/
  __pyx_tp_clear_3epr_DSD, /*tp_clear*/
  __pyx_pf_3epr_3DSD___richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_DSD, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_DSD, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_DSD, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Field(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Field *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Field *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Field(PyObject *o) {
  struct __pyx_obj_3epr_Field *p = (struct __pyx_obj_3epr_Field *)o;
  Py_XDECREF(p->_parent);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Field(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Field *p = (struct __pyx_obj_3epr_Field *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Field(PyObject *o) {
  struct __pyx_obj_3epr_Field *p = (struct __pyx_obj_3epr_Field *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_3epr_Field[] = {
  {__Pyx_NAMESTR("print_"), (PyCFunction)__pyx_pf_3epr_5Field_print_, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_print_)},
  {__Pyx_NAMESTR("get_unit"), (PyCFunction)__pyx_pf_3epr_5Field_get_unit, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_get_unit)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pf_3epr_5Field_get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_get_description)},
  {__Pyx_NAMESTR("get_num_elems"), (PyCFunction)__pyx_pf_3epr_5Field_get_num_elems, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_get_num_elems)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pf_3epr_5Field_get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_get_name)},
  {__Pyx_NAMESTR("get_type"), (PyCFunction)__pyx_pf_3epr_5Field_get_type, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_get_type)},
  {__Pyx_NAMESTR("get_elem"), (PyCFunction)__pyx_pf_3epr_5Field_get_elem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_get_elem)},
  {__Pyx_NAMESTR("get_elems"), (PyCFunction)__pyx_pf_3epr_5Field_get_elems, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_5Field_get_elems)},
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_3epr_5Field___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_3epr_5Field___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Field = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Field = {
  __pyx_pf_3epr_5Field___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Field = {
  __pyx_pf_3epr_5Field___len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Field = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_Field = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Field"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Field), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Field, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_3epr_5Field___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Field, /*tp_as_number*/
  &__pyx_tp_as_sequence_Field, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Field, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_3epr_5Field___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Field, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Represents a field within a record\n\n    A field is composed of one or more data elements of one of the\n    types defined in the internal ``field_info`` structure.\n\n    .. seealso:: :class:`Record`\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Field, /*tp_traverse*/
  __pyx_tp_clear_3epr_Field, /*tp_clear*/
  __pyx_pf_3epr_5Field___richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Field, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Field, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Record(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Record *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Record *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Record(PyObject *o) {
  struct __pyx_obj_3epr_Record *p = (struct __pyx_obj_3epr_Record *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_3epr_6Record___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->_parent);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Record(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Record *p = (struct __pyx_obj_3epr_Record *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Record(PyObject *o) {
  struct __pyx_obj_3epr_Record *p = (struct __pyx_obj_3epr_Record *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_3epr_Record[] = {
  {__Pyx_NAMESTR("get_num_fields"), (PyCFunction)__pyx_pf_3epr_6Record_get_num_fields, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_get_num_fields)},
  {__Pyx_NAMESTR("print_"), (PyCFunction)__pyx_pf_3epr_6Record_print_, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_print_)},
  {__Pyx_NAMESTR("print_element"), (PyCFunction)__pyx_pf_3epr_6Record_print_element, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_print_element)},
  {__Pyx_NAMESTR("get_field"), (PyCFunction)__pyx_pf_3epr_6Record_get_field, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_get_field)},
  {__Pyx_NAMESTR("get_field_at"), (PyCFunction)__pyx_pf_3epr_6Record_get_field_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_get_field_at)},
  {__Pyx_NAMESTR("get_field_names"), (PyCFunction)__pyx_pf_3epr_6Record_get_field_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_get_field_names)},
  {__Pyx_NAMESTR("fields"), (PyCFunction)__pyx_pf_3epr_6Record_fields, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Record_fields)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_3epr_6Record___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_3epr_6Record___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_3epr_6Record___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Record = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Record = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Record = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Record = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_Record = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Record"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Record), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Record, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_3epr_6Record___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Record, /*tp_as_number*/
  &__pyx_tp_as_sequence_Record, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Record, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_3epr_6Record___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Record, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Represents a record read from an ENVISAT dataset\n\n    A record is composed of multiple fields.\n\n    .. seealso:: :class:`Field`\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Record, /*tp_traverse*/
  __pyx_tp_clear_3epr_Record, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_3epr_6Record___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Record, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Record, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_3epr_Raster __pyx_vtable_3epr_Raster;

static PyObject *__pyx_tp_new_3epr_Raster(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Raster *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Raster *)o);
  p->__pyx_vtab = __pyx_vtabptr_3epr_Raster;
  p->_parent = Py_None; Py_INCREF(Py_None);
  p->_data = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Raster(PyObject *o) {
  struct __pyx_obj_3epr_Raster *p = (struct __pyx_obj_3epr_Raster *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_3epr_6Raster___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->_parent);
  Py_XDECREF(p->_data);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Raster(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Raster *p = (struct __pyx_obj_3epr_Raster *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  if (p->_data) {
    e = (*v)(p->_data, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Raster(PyObject *o) {
  struct __pyx_obj_3epr_Raster *p = (struct __pyx_obj_3epr_Raster *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_data);
  p->_data = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_6Raster_data_type(PyObject *o, void *x) {
  return __pyx_pf_3epr_6Raster_9data_type___get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_width(PyObject *o, void *x) {
  return __pyx_pf_3epr_6Raster_12source_width___get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_height(PyObject *o, void *x) {
  return __pyx_pf_3epr_6Raster_13source_height___get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_step_x(PyObject *o, void *x) {
  return __pyx_pf_3epr_6Raster_13source_step_x___get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_source_step_y(PyObject *o, void *x) {
  return __pyx_pf_3epr_6Raster_13source_step_y___get__(o);
}

static PyObject *__pyx_getprop_3epr_6Raster_data(PyObject *o, void *x) {
  return __pyx_pf_3epr_6Raster_4data___get__(o);
}

static struct PyMethodDef __pyx_methods_3epr_Raster[] = {
  {__Pyx_NAMESTR("get_width"), (PyCFunction)__pyx_pf_3epr_6Raster_get_width, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_get_width)},
  {__Pyx_NAMESTR("get_height"), (PyCFunction)__pyx_pf_3epr_6Raster_get_height, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_get_height)},
  {__Pyx_NAMESTR("get_elem_size"), (PyCFunction)__pyx_pf_3epr_6Raster_get_elem_size, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_get_elem_size)},
  {__Pyx_NAMESTR("get_pixel"), (PyCFunction)__pyx_pf_3epr_6Raster_get_pixel, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_6Raster_get_pixel)},
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_3epr_6Raster___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Raster[] = {
  {(char *)"data_type", __pyx_getprop_3epr_6Raster_data_type, 0, __Pyx_DOCSTR(__pyx_k_63), 0},
  {(char *)"source_width", __pyx_getprop_3epr_6Raster_source_width, 0, __Pyx_DOCSTR(__pyx_k_64), 0},
  {(char *)"source_height", __pyx_getprop_3epr_6Raster_source_height, 0, __Pyx_DOCSTR(__pyx_k_65), 0},
  {(char *)"source_step_x", __pyx_getprop_3epr_6Raster_source_step_x, 0, __Pyx_DOCSTR(__pyx_k_66), 0},
  {(char *)"source_step_y", __pyx_getprop_3epr_6Raster_source_step_y, 0, __Pyx_DOCSTR(__pyx_k_67), 0},
  {(char *)"data", __pyx_getprop_3epr_6Raster_data, 0, __Pyx_DOCSTR(__pyx_k_68), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Raster = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Raster = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Raster = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Raster = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_Raster = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Raster"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Raster), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Raster, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_3epr_6Raster___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Raster, /*tp_as_number*/
  &__pyx_tp_as_sequence_Raster, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Raster, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Raster, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Represents a raster in which data will be stored\n\n    All 'size' parameter are in PIXEL.\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Raster, /*tp_traverse*/
  __pyx_tp_clear_3epr_Raster, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Raster, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Raster, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Raster, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_3epr_Band __pyx_vtable_3epr_Band;

static PyObject *__pyx_tp_new_3epr_Band(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Band *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Band *)o);
  p->__pyx_vtab = __pyx_vtabptr_3epr_Band;
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Band(PyObject *o) {
  struct __pyx_obj_3epr_Band *p = (struct __pyx_obj_3epr_Band *)o;
  Py_XDECREF(p->_parent);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Band(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Band *p = (struct __pyx_obj_3epr_Band *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Band(PyObject *o) {
  struct __pyx_obj_3epr_Band *p = (struct __pyx_obj_3epr_Band *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_4Band_product(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_7product___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_spectr_band_index(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_17spectr_band_index___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_sample_model(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_12sample_model___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_data_type(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_9data_type___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_scaling_method(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_14scaling_method___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_scaling_offset(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_14scaling_offset___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_scaling_factor(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_14scaling_factor___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_bm_expr(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_7bm_expr___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_unit(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_4unit___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_description(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_11description___get__(o);
}

static PyObject *__pyx_getprop_3epr_4Band_lines_mirrored(PyObject *o, void *x) {
  return __pyx_pf_3epr_4Band_14lines_mirrored___get__(o);
}

static struct PyMethodDef __pyx_methods_3epr_Band[] = {
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pf_3epr_4Band_get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_get_name)},
  {__Pyx_NAMESTR("create_compatible_raster"), (PyCFunction)__pyx_pf_3epr_4Band_create_compatible_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_create_compatible_raster)},
  {__Pyx_NAMESTR("read_raster"), (PyCFunction)__pyx_pf_3epr_4Band_read_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_read_raster)},
  {__Pyx_NAMESTR("read_as_array"), (PyCFunction)__pyx_pf_3epr_4Band_read_as_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_4Band_read_as_array)},
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_3epr_4Band___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Band[] = {
  {(char *)"product", __pyx_getprop_3epr_4Band_product, 0, __Pyx_DOCSTR(__pyx_k_69), 0},
  {(char *)"spectr_band_index", __pyx_getprop_3epr_4Band_spectr_band_index, 0, __Pyx_DOCSTR(__pyx_k_70), 0},
  {(char *)"sample_model", __pyx_getprop_3epr_4Band_sample_model, 0, __Pyx_DOCSTR(__pyx_k_71), 0},
  {(char *)"data_type", __pyx_getprop_3epr_4Band_data_type, 0, __Pyx_DOCSTR(__pyx_k_72), 0},
  {(char *)"scaling_method", __pyx_getprop_3epr_4Band_scaling_method, 0, __Pyx_DOCSTR(__pyx_k_73), 0},
  {(char *)"scaling_offset", __pyx_getprop_3epr_4Band_scaling_offset, 0, __Pyx_DOCSTR(__pyx_k_74), 0},
  {(char *)"scaling_factor", __pyx_getprop_3epr_4Band_scaling_factor, 0, __Pyx_DOCSTR(__pyx_k_75), 0},
  {(char *)"bm_expr", __pyx_getprop_3epr_4Band_bm_expr, 0, __Pyx_DOCSTR(__pyx_k_76), 0},
  {(char *)"unit", __pyx_getprop_3epr_4Band_unit, 0, __Pyx_DOCSTR(__pyx_k_77), 0},
  {(char *)"description", __pyx_getprop_3epr_4Band_description, 0, __Pyx_DOCSTR(__pyx_k_78), 0},
  {(char *)"lines_mirrored", __pyx_getprop_3epr_4Band_lines_mirrored, 0, __Pyx_DOCSTR(__pyx_k_79), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Band = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Band = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Band = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Band = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_Band = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Band"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Band), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Band, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_3epr_4Band___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Band, /*tp_as_number*/
  &__pyx_tp_as_sequence_Band, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Band, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Band, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("The band of an ENVISAT product\n\n    The Band class contains information about a band within an ENVISAT\n    product file which has been opened with the :func:`open` function.\n\n    A new Band instance can be obtained with the :meth:`Product.get_band`\n    method.\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Band, /*tp_traverse*/
  __pyx_tp_clear_3epr_Band, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Band, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Band, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Band, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Dataset(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3epr_Dataset *p;
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_3epr_Dataset *)o);
  p->_parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3epr_Dataset(PyObject *o) {
  struct __pyx_obj_3epr_Dataset *p = (struct __pyx_obj_3epr_Dataset *)o;
  Py_XDECREF(p->_parent);
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static int __pyx_tp_traverse_3epr_Dataset(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3epr_Dataset *p = (struct __pyx_obj_3epr_Dataset *)o;
  e = __pyx_tp_traverse_3epr_EprObject(o, v, a); if (e) return e;
  if (p->_parent) {
    e = (*v)(p->_parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3epr_Dataset(PyObject *o) {
  struct __pyx_obj_3epr_Dataset *p = (struct __pyx_obj_3epr_Dataset *)o;
  PyObject* tmp;
  __pyx_tp_clear_3epr_EprObject(o);
  tmp = ((PyObject*)p->_parent);
  p->_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3epr_7Dataset_product(PyObject *o, void *x) {
  return __pyx_pf_3epr_7Dataset_7product___get__(o);
}

static PyObject *__pyx_getprop_3epr_7Dataset_description(PyObject *o, void *x) {
  return __pyx_pf_3epr_7Dataset_11description___get__(o);
}

static struct PyMethodDef __pyx_methods_3epr_Dataset[] = {
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pf_3epr_7Dataset_get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_get_name)},
  {__Pyx_NAMESTR("get_dsd_name"), (PyCFunction)__pyx_pf_3epr_7Dataset_get_dsd_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_get_dsd_name)},
  {__Pyx_NAMESTR("get_num_records"), (PyCFunction)__pyx_pf_3epr_7Dataset_get_num_records, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_get_num_records)},
  {__Pyx_NAMESTR("get_dsd"), (PyCFunction)__pyx_pf_3epr_7Dataset_get_dsd, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_get_dsd)},
  {__Pyx_NAMESTR("create_record"), (PyCFunction)__pyx_pf_3epr_7Dataset_create_record, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_create_record)},
  {__Pyx_NAMESTR("read_record"), (PyCFunction)__pyx_pf_3epr_7Dataset_read_record, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_read_record)},
  {__Pyx_NAMESTR("records"), (PyCFunction)__pyx_pf_3epr_7Dataset_records, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Dataset_records)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_3epr_7Dataset___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_3epr_7Dataset___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_3epr_7Dataset___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Dataset[] = {
  {(char *)"product", __pyx_getprop_3epr_7Dataset_product, 0, __Pyx_DOCSTR(__pyx_k_80), 0},
  {(char *)"description", __pyx_getprop_3epr_7Dataset_description, 0, __Pyx_DOCSTR(__pyx_k_78), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Dataset = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Dataset = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Dataset = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Dataset = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_Dataset = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Dataset"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Dataset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Dataset, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_3epr_7Dataset___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Dataset, /*tp_as_number*/
  &__pyx_tp_as_sequence_Dataset, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Dataset, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_3epr_7Dataset___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Dataset, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("ENVISAT dataset\n\n    The Dataset class contains information about a dataset within an\n    ENVISAT product file which has been opened with the :func:`open`\n    function.\n\n    A new Dataset instance can be obtained with the\n    :meth:`Product.get_dataset` or :meth:`Product.get_dataset_at` methods.\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_Dataset, /*tp_traverse*/
  __pyx_tp_clear_3epr_Dataset, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_3epr_7Dataset___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Dataset, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Dataset, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Dataset, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_3epr_Product(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_3epr_EprObject(t, a, k);
  if (!o) return 0;
  if (__pyx_pf_3epr_7Product___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_3epr_Product(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_3epr_7Product___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_3epr_EprObject(o);
}

static PyObject *__pyx_getprop_3epr_7Product_file_path(PyObject *o, void *x) {
  return __pyx_pf_3epr_7Product_9file_path___get__(o);
}

static PyObject *__pyx_getprop_3epr_7Product_tot_size(PyObject *o, void *x) {
  return __pyx_pf_3epr_7Product_8tot_size___get__(o);
}

static PyObject *__pyx_getprop_3epr_7Product_id_string(PyObject *o, void *x) {
  return __pyx_pf_3epr_7Product_9id_string___get__(o);
}

static PyObject *__pyx_getprop_3epr_7Product_meris_iodd_version(PyObject *o, void *x) {
  return __pyx_pf_3epr_7Product_18meris_iodd_version___get__(o);
}

static struct PyMethodDef __pyx_methods_3epr_Product[] = {
  {__Pyx_NAMESTR("get_scene_width"), (PyCFunction)__pyx_pf_3epr_7Product_get_scene_width, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_scene_width)},
  {__Pyx_NAMESTR("get_scene_height"), (PyCFunction)__pyx_pf_3epr_7Product_get_scene_height, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_scene_height)},
  {__Pyx_NAMESTR("get_num_datasets"), (PyCFunction)__pyx_pf_3epr_7Product_get_num_datasets, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_num_datasets)},
  {__Pyx_NAMESTR("get_num_dsds"), (PyCFunction)__pyx_pf_3epr_7Product_get_num_dsds, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_num_dsds)},
  {__Pyx_NAMESTR("get_num_bands"), (PyCFunction)__pyx_pf_3epr_7Product_get_num_bands, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_num_bands)},
  {__Pyx_NAMESTR("get_dataset_at"), (PyCFunction)__pyx_pf_3epr_7Product_get_dataset_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_dataset_at)},
  {__Pyx_NAMESTR("get_dataset"), (PyCFunction)__pyx_pf_3epr_7Product_get_dataset, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_dataset)},
  {__Pyx_NAMESTR("get_dsd_at"), (PyCFunction)__pyx_pf_3epr_7Product_get_dsd_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_dsd_at)},
  {__Pyx_NAMESTR("get_mph"), (PyCFunction)__pyx_pf_3epr_7Product_get_mph, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_mph)},
  {__Pyx_NAMESTR("get_sph"), (PyCFunction)__pyx_pf_3epr_7Product_get_sph, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_sph)},
  {__Pyx_NAMESTR("get_band"), (PyCFunction)__pyx_pf_3epr_7Product_get_band, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_band)},
  {__Pyx_NAMESTR("get_band_at"), (PyCFunction)__pyx_pf_3epr_7Product_get_band_at, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_band_at)},
  {__Pyx_NAMESTR("get_dataset_names"), (PyCFunction)__pyx_pf_3epr_7Product_get_dataset_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_dataset_names)},
  {__Pyx_NAMESTR("get_band_names"), (PyCFunction)__pyx_pf_3epr_7Product_get_band_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_get_band_names)},
  {__Pyx_NAMESTR("datasets"), (PyCFunction)__pyx_pf_3epr_7Product_datasets, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_datasets)},
  {__Pyx_NAMESTR("bands"), (PyCFunction)__pyx_pf_3epr_7Product_bands, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3epr_7Product_bands)},
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_3epr_7Product___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_3epr_7Product___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3epr_Product[] = {
  {(char *)"file_path", __pyx_getprop_3epr_7Product_file_path, 0, __Pyx_DOCSTR(__pyx_k_81), 0},
  {(char *)"tot_size", __pyx_getprop_3epr_7Product_tot_size, 0, __Pyx_DOCSTR(__pyx_k_82), 0},
  {(char *)"id_string", __pyx_getprop_3epr_7Product_id_string, 0, __Pyx_DOCSTR(__pyx_k_83), 0},
  {(char *)"meris_iodd_version", __pyx_getprop_3epr_7Product_meris_iodd_version, 0, __Pyx_DOCSTR(__pyx_k_84), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Product = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Product = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Product = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Product = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_3epr_Product = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("epr.Product"), /*tp_name*/
  sizeof(struct __pyx_obj_3epr_Product), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3epr_Product, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_3epr_7Product___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Product, /*tp_as_number*/
  &__pyx_tp_as_sequence_Product, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Product, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_3epr_7Product___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Product, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("ENVISAT product\n\n    The Product class provides methods and properties to get information\n    about an ENVISAT product file.\n\n    .. seealso:: :func:`open`\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_3epr_EprObject, /*tp_traverse*/
  __pyx_tp_clear_3epr_EprObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3epr_Product, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3epr_Product, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_3epr_7Product___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3epr_Product, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static struct PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("get_data_type_size"), (PyCFunction)__pyx_pf_3epr_get_data_type_size, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_get_data_type_size)},
  {__Pyx_NAMESTR("data_type_id_to_str"), (PyCFunction)__pyx_pf_3epr_data_type_id_to_str, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_data_type_id_to_str)},
  {__Pyx_NAMESTR("get_scaling_method_name"), (PyCFunction)__pyx_pf_3epr_get_scaling_method_name, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_get_scaling_method_name)},
  {__Pyx_NAMESTR("get_sample_model_name"), (PyCFunction)__pyx_pf_3epr_get_sample_model_name, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_get_sample_model_name)},
  {__Pyx_NAMESTR("create_raster"), (PyCFunction)__pyx_pf_3epr_create_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_create_raster)},
  {__Pyx_NAMESTR("create_bitmask_raster"), (PyCFunction)__pyx_pf_3epr_create_bitmask_raster, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3epr_create_bitmask_raster)},
  {__Pyx_NAMESTR("open"), (PyCFunction)__pyx_pf_3epr_open, METH_O, __Pyx_DOCSTR(__pyx_doc_3epr_open)},
  {__Pyx_NAMESTR("_close_api"), (PyCFunction)__pyx_pf_3epr__close_api, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("epr"),
    __Pyx_DOCSTR(__pyx_k_85), /* 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_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_u_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 1, 0, 0},
  {&__pyx_kp_u_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 1, 0, 0},
  {&__pyx_kp_u_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 1, 0, 0},
  {&__pyx_kp_u_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 1, 0, 0},
  {&__pyx_kp_u_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 1, 0, 0},
  {&__pyx_kp_u_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 1, 0, 0},
  {&__pyx_kp_u_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 1, 0, 0},
  {&__pyx_kp_u_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 1, 0, 0},
  {&__pyx_kp_u_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 1, 0, 0},
  {&__pyx_kp_u_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 1, 0, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_u_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 1, 0, 0},
  {&__pyx_kp_u_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 1, 0, 0},
  {&__pyx_kp_u_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 1, 0, 0},
  {&__pyx_kp_u_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 1, 0, 0},
  {&__pyx_kp_u_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 1, 0, 0},
  {&__pyx_kp_u_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 1, 0, 0},
  {&__pyx_n_s_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 1},
  {&__pyx_kp_u_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 1, 0, 0},
  {&__pyx_kp_u_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 1, 0, 0},
  {&__pyx_kp_u_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 1, 0, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_u_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 1, 0, 0},
  {&__pyx_kp_u_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 1, 0, 0},
  {&__pyx_kp_u_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 1, 0, 0},
  {&__pyx_kp_u_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 1, 0, 0},
  {&__pyx_kp_u_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 1, 0, 0},
  {&__pyx_kp_u_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 1, 0, 0},
  {&__pyx_kp_u_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 1, 0, 0},
  {&__pyx_kp_u_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 1, 0, 0},
  {&__pyx_kp_u_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 1, 0, 0},
  {&__pyx_kp_u_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 1, 0, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_u_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 1, 0, 0},
  {&__pyx_kp_u_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 1, 0, 0},
  {&__pyx_kp_u_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 1, 0, 0},
  {&__pyx_kp_u_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 1, 0, 0},
  {&__pyx_kp_u_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 1, 0, 0},
  {&__pyx_kp_u_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 1, 0, 0},
  {&__pyx_kp_u_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 1, 0, 0},
  {&__pyx_kp_u_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 1, 0, 0},
  {&__pyx_kp_u_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 1, 0, 0},
  {&__pyx_kp_u_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 1, 0, 0},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
  {&__pyx_kp_u_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 1, 0, 0},
  {&__pyx_kp_u_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 1, 0, 0},
  {&__pyx_kp_u_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 1, 0, 0},
  {&__pyx_kp_u_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 1, 0, 0},
  {&__pyx_kp_u_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 1, 0, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_n_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 1},
  {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
  {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
  {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
  {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0},
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
  {&__pyx_kp_u_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 1, 0, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_u_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 1, 0, 0},
  {&__pyx_kp_u_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 1, 0, 0},
  {&__pyx_kp_u_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 1, 0, 0},
  {&__pyx_kp_u_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 1, 0, 0},
  {&__pyx_kp_u_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 1, 0, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0},
  {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
  {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
  {&__pyx_kp_u_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 1, 0, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_kp_u_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 1, 0, 0},
  {&__pyx_kp_u_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 1, 0, 0},
  {&__pyx_n_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 1},
  {&__pyx_kp_u_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 1, 0, 0},
  {&__pyx_n_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 1},
  {&__pyx_kp_u_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 1, 0, 0},
  {&__pyx_kp_u_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 1, 0, 0},
  {&__pyx_kp_u_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 1, 0, 0},
  {&__pyx_kp_u_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 1, 0, 0},
  {&__pyx_kp_u_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 1, 0, 0},
  {&__pyx_kp_s__1OF1, __pyx_k__1OF1, sizeof(__pyx_k__1OF1), 0, 0, 1, 0},
  {&__pyx_kp_s__1OF2, __pyx_k__1OF2, sizeof(__pyx_k__1OF2), 0, 0, 1, 0},
  {&__pyx_kp_s__2OF2, __pyx_k__2OF2, sizeof(__pyx_k__2OF2), 0, 0, 1, 0},
  {&__pyx_kp_s__2TOF, __pyx_k__2TOF, sizeof(__pyx_k__2TOF), 0, 0, 1, 0},
  {&__pyx_kp_s__3TOI, __pyx_k__3TOI, sizeof(__pyx_k__3TOI), 0, 0, 1, 0},
  {&__pyx_n_s__Band, __pyx_k__Band, sizeof(__pyx_k__Band), 0, 0, 1, 1},
  {&__pyx_n_s__Dataset, __pyx_k__Dataset, sizeof(__pyx_k__Dataset), 0, 0, 1, 1},
  {&__pyx_n_s__EPRError, __pyx_k__EPRError, sizeof(__pyx_k__EPRError), 0, 0, 1, 1},
  {&__pyx_n_s__EPRTime, __pyx_k__EPRTime, sizeof(__pyx_k__EPRTime), 0, 0, 1, 1},
  {&__pyx_n_s__EPRValueError, __pyx_k__EPRValueError, sizeof(__pyx_k__EPRValueError), 0, 0, 1, 1},
  {&__pyx_n_s__EPR_C_API_VERSION, __pyx_k__EPR_C_API_VERSION, sizeof(__pyx_k__EPR_C_API_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMID_LIN, __pyx_k__E_SMID_LIN, sizeof(__pyx_k__E_SMID_LIN), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMID_LOG, __pyx_k__E_SMID_LOG, sizeof(__pyx_k__E_SMID_LOG), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMID_NON, __pyx_k__E_SMID_NON, sizeof(__pyx_k__E_SMID_NON), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_1OF1, __pyx_k__E_SMOD_1OF1, sizeof(__pyx_k__E_SMOD_1OF1), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_1OF2, __pyx_k__E_SMOD_1OF2, sizeof(__pyx_k__E_SMOD_1OF2), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_2OF2, __pyx_k__E_SMOD_2OF2, sizeof(__pyx_k__E_SMOD_2OF2), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_2TOF, __pyx_k__E_SMOD_2TOF, sizeof(__pyx_k__E_SMOD_2TOF), 0, 0, 1, 1},
  {&__pyx_n_s__E_SMOD_3TOI, __pyx_k__E_SMOD_3TOI, sizeof(__pyx_k__E_SMOD_3TOI), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_CHAR, __pyx_k__E_TID_CHAR, sizeof(__pyx_k__E_TID_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_DOUBLE, __pyx_k__E_TID_DOUBLE, sizeof(__pyx_k__E_TID_DOUBLE), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_FLOAT, __pyx_k__E_TID_FLOAT, sizeof(__pyx_k__E_TID_FLOAT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_INT, __pyx_k__E_TID_INT, sizeof(__pyx_k__E_TID_INT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_SHORT, __pyx_k__E_TID_SHORT, sizeof(__pyx_k__E_TID_SHORT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_SPARE, __pyx_k__E_TID_SPARE, sizeof(__pyx_k__E_TID_SPARE), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_STRING, __pyx_k__E_TID_STRING, sizeof(__pyx_k__E_TID_STRING), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_TIME, __pyx_k__E_TID_TIME, sizeof(__pyx_k__E_TID_TIME), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_UCHAR, __pyx_k__E_TID_UCHAR, sizeof(__pyx_k__E_TID_UCHAR), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_UINT, __pyx_k__E_TID_UINT, sizeof(__pyx_k__E_TID_UINT), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_UNKNOWN, __pyx_k__E_TID_UNKNOWN, sizeof(__pyx_k__E_TID_UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s__E_TID_USHORT, __pyx_k__E_TID_USHORT, sizeof(__pyx_k__E_TID_USHORT), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__Field, __pyx_k__Field, sizeof(__pyx_k__Field), 0, 0, 1, 1},
  {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
  {&__pyx_n_s__LIN, __pyx_k__LIN, sizeof(__pyx_k__LIN), 0, 0, 1, 1},
  {&__pyx_n_s__LOG, __pyx_k__LOG, sizeof(__pyx_k__LOG), 0, 0, 1, 1},
  {&__pyx_n_s__NONE, __pyx_k__NONE, sizeof(__pyx_k__NONE), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplemented, __pyx_k__NotImplemented, sizeof(__pyx_k__NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s__Product, __pyx_k__Product, sizeof(__pyx_k__Product), 0, 0, 1, 1},
  {&__pyx_n_s__Raster, __pyx_k__Raster, sizeof(__pyx_k__Raster), 0, 0, 1, 1},
  {&__pyx_n_s__Record, __pyx_k__Record, sizeof(__pyx_k__Record), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____repr__, __pyx_k____repr__, sizeof(__pyx_k____repr__), 0, 0, 1, 1},
  {&__pyx_n_s____revision__, __pyx_k____revision__, sizeof(__pyx_k____revision__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
  {&__pyx_n_s___close_api, __pyx_k___close_api, sizeof(__pyx_k___close_api), 0, 0, 1, 1},
  {&__pyx_n_s___data, __pyx_k___data, sizeof(__pyx_k___data), 0, 0, 1, 1},
  {&__pyx_n_s___dealloc, __pyx_k___dealloc, sizeof(__pyx_k___dealloc), 0, 0, 1, 1},
  {&__pyx_n_s___parent, __pyx_k___parent, sizeof(__pyx_k___parent), 0, 0, 1, 1},
  {&__pyx_n_s___ptr, __pyx_k___ptr, sizeof(__pyx_k___ptr), 0, 0, 1, 1},
  {&__pyx_n_s__atexit, __pyx_k__atexit, sizeof(__pyx_k__atexit), 0, 0, 1, 1},
  {&__pyx_n_s__bands, __pyx_k__bands, sizeof(__pyx_k__bands), 0, 0, 1, 1},
  {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1},
  {&__pyx_n_s__bm_expr, __pyx_k__bm_expr, sizeof(__pyx_k__bm_expr), 0, 0, 1, 1},
  {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1},
  {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
  {&__pyx_n_s__byteorder, __pyx_k__byteorder, sizeof(__pyx_k__byteorder), 0, 0, 1, 1},
  {&__pyx_n_s__char, __pyx_k__char, sizeof(__pyx_k__char), 0, 0, 1, 1},
  {&__pyx_n_s__code, __pyx_k__code, sizeof(__pyx_k__code), 0, 0, 1, 1},
  {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
  {&__pyx_n_s__create_raster, __pyx_k__create_raster, sizeof(__pyx_k__create_raster), 0, 0, 1, 1},
  {&__pyx_n_s__create_record, __pyx_k__create_record, sizeof(__pyx_k__create_record), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__data_type, __pyx_k__data_type, sizeof(__pyx_k__data_type), 0, 0, 1, 1},
  {&__pyx_n_s__data_type_id_to_str, __pyx_k__data_type_id_to_str, sizeof(__pyx_k__data_type_id_to_str), 0, 0, 1, 1},
  {&__pyx_n_s__datasets, __pyx_k__datasets, sizeof(__pyx_k__datasets), 0, 0, 1, 1},
  {&__pyx_n_s__days, __pyx_k__days, sizeof(__pyx_k__days), 0, 0, 1, 1},
  {&__pyx_n_s__descr, __pyx_k__descr, sizeof(__pyx_k__descr), 0, 0, 1, 1},
  {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
  {&__pyx_n_s__ds_name, __pyx_k__ds_name, sizeof(__pyx_k__ds_name), 0, 0, 1, 1},
  {&__pyx_n_s__ds_offset, __pyx_k__ds_offset, sizeof(__pyx_k__ds_offset), 0, 0, 1, 1},
  {&__pyx_n_s__ds_size, __pyx_k__ds_size, sizeof(__pyx_k__ds_size), 0, 0, 1, 1},
  {&__pyx_n_s__ds_type, __pyx_k__ds_type, sizeof(__pyx_k__ds_type), 0, 0, 1, 1},
  {&__pyx_n_s__dsr_size, __pyx_k__dsr_size, sizeof(__pyx_k__dsr_size), 0, 0, 1, 1},
  {&__pyx_n_s__element_index, __pyx_k__element_index, sizeof(__pyx_k__element_index), 0, 0, 1, 1},
  {&__pyx_n_s__elems, __pyx_k__elems, sizeof(__pyx_k__elems), 0, 0, 1, 1},
  {&__pyx_n_s__epr_c_lib, __pyx_k__epr_c_lib, sizeof(__pyx_k__epr_c_lib), 0, 0, 1, 1},
  {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
  {&__pyx_n_s__field_index, __pyx_k__field_index, sizeof(__pyx_k__field_index), 0, 0, 1, 1},
  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
  {&__pyx_n_s__file_path, __pyx_k__file_path, sizeof(__pyx_k__file_path), 0, 0, 1, 1},
  {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
  {&__pyx_n_s__float32, __pyx_k__float32, sizeof(__pyx_k__float32), 0, 0, 1, 1},
  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
  {&__pyx_n_s__get_band, __pyx_k__get_band, sizeof(__pyx_k__get_band), 0, 0, 1, 1},
  {&__pyx_n_s__get_band_at, __pyx_k__get_band_at, sizeof(__pyx_k__get_band_at), 0, 0, 1, 1},
  {&__pyx_n_s__get_band_names, __pyx_k__get_band_names, sizeof(__pyx_k__get_band_names), 0, 0, 1, 1},
  {&__pyx_n_s__get_data_type_size, __pyx_k__get_data_type_size, sizeof(__pyx_k__get_data_type_size), 0, 0, 1, 1},
  {&__pyx_n_s__get_dataset, __pyx_k__get_dataset, sizeof(__pyx_k__get_dataset), 0, 0, 1, 1},
  {&__pyx_n_s__get_dataset_at, __pyx_k__get_dataset_at, sizeof(__pyx_k__get_dataset_at), 0, 0, 1, 1},
  {&__pyx_n_s__get_dataset_names, __pyx_k__get_dataset_names, sizeof(__pyx_k__get_dataset_names), 0, 0, 1, 1},
  {&__pyx_n_s__get_description, __pyx_k__get_description, sizeof(__pyx_k__get_description), 0, 0, 1, 1},
  {&__pyx_n_s__get_dsd, __pyx_k__get_dsd, sizeof(__pyx_k__get_dsd), 0, 0, 1, 1},
  {&__pyx_n_s__get_dsd_at, __pyx_k__get_dsd_at, sizeof(__pyx_k__get_dsd_at), 0, 0, 1, 1},
  {&__pyx_n_s__get_dsd_name, __pyx_k__get_dsd_name, sizeof(__pyx_k__get_dsd_name), 0, 0, 1, 1},
  {&__pyx_n_s__get_elem, __pyx_k__get_elem, sizeof(__pyx_k__get_elem), 0, 0, 1, 1},
  {&__pyx_n_s__get_elem_size, __pyx_k__get_elem_size, sizeof(__pyx_k__get_elem_size), 0, 0, 1, 1},
  {&__pyx_n_s__get_elems, __pyx_k__get_elems, sizeof(__pyx_k__get_elems), 0, 0, 1, 1},
  {&__pyx_n_s__get_field, __pyx_k__get_field, sizeof(__pyx_k__get_field), 0, 0, 1, 1},
  {&__pyx_n_s__get_field_at, __pyx_k__get_field_at, sizeof(__pyx_k__get_field_at), 0, 0, 1, 1},
  {&__pyx_n_s__get_field_names, __pyx_k__get_field_names, sizeof(__pyx_k__get_field_names), 0, 0, 1, 1},
  {&__pyx_n_s__get_height, __pyx_k__get_height, sizeof(__pyx_k__get_height), 0, 0, 1, 1},
  {&__pyx_n_s__get_mph, __pyx_k__get_mph, sizeof(__pyx_k__get_mph), 0, 0, 1, 1},
  {&__pyx_n_s__get_name, __pyx_k__get_name, sizeof(__pyx_k__get_name), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_bands, __pyx_k__get_num_bands, sizeof(__pyx_k__get_num_bands), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_datasets, __pyx_k__get_num_datasets, sizeof(__pyx_k__get_num_datasets), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_dsds, __pyx_k__get_num_dsds, sizeof(__pyx_k__get_num_dsds), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_elems, __pyx_k__get_num_elems, sizeof(__pyx_k__get_num_elems), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_fields, __pyx_k__get_num_fields, sizeof(__pyx_k__get_num_fields), 0, 0, 1, 1},
  {&__pyx_n_s__get_num_records, __pyx_k__get_num_records, sizeof(__pyx_k__get_num_records), 0, 0, 1, 1},
  {&__pyx_n_s__get_pixel, __pyx_k__get_pixel, sizeof(__pyx_k__get_pixel), 0, 0, 1, 1},
  {&__pyx_n_s__get_scene_height, __pyx_k__get_scene_height, sizeof(__pyx_k__get_scene_height), 0, 0, 1, 1},
  {&__pyx_n_s__get_scene_width, __pyx_k__get_scene_width, sizeof(__pyx_k__get_scene_width), 0, 0, 1, 1},
  {&__pyx_n_s__get_sph, __pyx_k__get_sph, sizeof(__pyx_k__get_sph), 0, 0, 1, 1},
  {&__pyx_n_s__get_type, __pyx_k__get_type, sizeof(__pyx_k__get_type), 0, 0, 1, 1},
  {&__pyx_n_s__get_unit, __pyx_k__get_unit, sizeof(__pyx_k__get_unit), 0, 0, 1, 1},
  {&__pyx_n_s__get_width, __pyx_k__get_width, sizeof(__pyx_k__get_width), 0, 0, 1, 1},
  {&__pyx_n_s__height, __pyx_k__height, sizeof(__pyx_k__height), 0, 0, 1, 1},
  {&__pyx_n_s__id_string, __pyx_k__id_string, sizeof(__pyx_k__id_string), 0, 0, 1, 1},
  {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
  {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
  {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__lines_mirrored, __pyx_k__lines_mirrored, sizeof(__pyx_k__lines_mirrored), 0, 0, 1, 1},
  {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
  {&__pyx_n_s__meris_iodd_version, __pyx_k__meris_iodd_version, sizeof(__pyx_k__meris_iodd_version), 0, 0, 1, 1},
  {&__pyx_n_s__message, __pyx_k__message, sizeof(__pyx_k__message), 0, 0, 1, 1},
  {&__pyx_n_s__microseconds, __pyx_k__microseconds, sizeof(__pyx_k__microseconds), 0, 0, 1, 1},
  {&__pyx_n_s__namedtuple, __pyx_k__namedtuple, sizeof(__pyx_k__namedtuple), 0, 0, 1, 1},
  {&__pyx_n_s__names, __pyx_k__names, sizeof(__pyx_k__names), 0, 0, 1, 1},
  {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
  {&__pyx_n_s__num_dsr, __pyx_k__num_dsr, sizeof(__pyx_k__num_dsr), 0, 0, 1, 1},
  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
  {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
  {&__pyx_n_s__ostream, __pyx_k__ostream, sizeof(__pyx_k__ostream), 0, 0, 1, 1},
  {&__pyx_n_s__print_, __pyx_k__print_, sizeof(__pyx_k__print_), 0, 0, 1, 1},
  {&__pyx_n_s__print_element, __pyx_k__print_element, sizeof(__pyx_k__print_element), 0, 0, 1, 1},
  {&__pyx_n_s__product, __pyx_k__product, sizeof(__pyx_k__product), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__raster, __pyx_k__raster, sizeof(__pyx_k__raster), 0, 0, 1, 1},
  {&__pyx_n_s__raster_height, __pyx_k__raster_height, sizeof(__pyx_k__raster_height), 0, 0, 1, 1},
  {&__pyx_n_s__raster_width, __pyx_k__raster_width, sizeof(__pyx_k__raster_width), 0, 0, 1, 1},
  {&__pyx_n_s__read_as_array, __pyx_k__read_as_array, sizeof(__pyx_k__read_as_array), 0, 0, 1, 1},
  {&__pyx_n_s__read_raster, __pyx_k__read_raster, sizeof(__pyx_k__read_raster), 0, 0, 1, 1},
  {&__pyx_n_s__read_record, __pyx_k__read_record, sizeof(__pyx_k__read_record), 0, 0, 1, 1},
  {&__pyx_n_s__readonly, __pyx_k__readonly, sizeof(__pyx_k__readonly), 0, 0, 1, 1},
  {&__pyx_n_s__record, __pyx_k__record, sizeof(__pyx_k__record), 0, 0, 1, 1},
  {&__pyx_n_s__records, __pyx_k__records, sizeof(__pyx_k__records), 0, 0, 1, 1},
  {&__pyx_n_s__register, __pyx_k__register, sizeof(__pyx_k__register), 0, 0, 1, 1},
  {&__pyx_n_s__repr, __pyx_k__repr, sizeof(__pyx_k__repr), 0, 0, 1, 1},
  {&__pyx_n_s__sample_model, __pyx_k__sample_model, sizeof(__pyx_k__sample_model), 0, 0, 1, 1},
  {&__pyx_n_s__scaling_factor, __pyx_k__scaling_factor, sizeof(__pyx_k__scaling_factor), 0, 0, 1, 1},
  {&__pyx_n_s__scaling_method, __pyx_k__scaling_method, sizeof(__pyx_k__scaling_method), 0, 0, 1, 1},
  {&__pyx_n_s__scaling_offset, __pyx_k__scaling_offset, sizeof(__pyx_k__scaling_offset), 0, 0, 1, 1},
  {&__pyx_n_s__seconds, __pyx_k__seconds, sizeof(__pyx_k__seconds), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
  {&__pyx_n_s__short, __pyx_k__short, sizeof(__pyx_k__short), 0, 0, 1, 1},
  {&__pyx_n_s__source_height, __pyx_k__source_height, sizeof(__pyx_k__source_height), 0, 0, 1, 1},
  {&__pyx_n_s__source_step_x, __pyx_k__source_step_x, sizeof(__pyx_k__source_step_x), 0, 0, 1, 1},
  {&__pyx_n_s__source_step_y, __pyx_k__source_step_y, sizeof(__pyx_k__source_step_y), 0, 0, 1, 1},
  {&__pyx_n_s__source_width, __pyx_k__source_width, sizeof(__pyx_k__source_width), 0, 0, 1, 1},
  {&__pyx_n_s__spectr_band_index, __pyx_k__spectr_band_index, sizeof(__pyx_k__spectr_band_index), 0, 0, 1, 1},
  {&__pyx_n_s__src_height, __pyx_k__src_height, sizeof(__pyx_k__src_height), 0, 0, 1, 1},
  {&__pyx_n_s__src_width, __pyx_k__src_width, sizeof(__pyx_k__src_width), 0, 0, 1, 1},
  {&__pyx_n_s__stdout, __pyx_k__stdout, sizeof(__pyx_k__stdout), 0, 0, 1, 1},
  {&__pyx_n_s__strides, __pyx_k__strides, sizeof(__pyx_k__strides), 0, 0, 1, 1},
  {&__pyx_n_s__suboffsets, __pyx_k__suboffsets, sizeof(__pyx_k__suboffsets), 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_n_s__toarray, __pyx_k__toarray, sizeof(__pyx_k__toarray), 0, 0, 1, 1},
  {&__pyx_n_s__tot_size, __pyx_k__tot_size, sizeof(__pyx_k__tot_size), 0, 0, 1, 1},
  {&__pyx_n_s__type_num, __pyx_k__type_num, sizeof(__pyx_k__type_num), 0, 0, 1, 1},
  {&__pyx_n_s__uchar, __pyx_k__uchar, sizeof(__pyx_k__uchar), 0, 0, 1, 1},
  {&__pyx_n_s__uint, __pyx_k__uint, sizeof(__pyx_k__uint), 0, 0, 1, 1},
  {&__pyx_n_s__unit, __pyx_k__unit, sizeof(__pyx_k__unit), 0, 0, 1, 1},
  {&__pyx_n_s__ushort, __pyx_k__ushort, sizeof(__pyx_k__ushort), 0, 0, 1, 1},
  {&__pyx_n_s__width, __pyx_k__width, sizeof(__pyx_k__width), 0, 0, 1, 1},
  {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {&__pyx_n_s__xoffset, __pyx_k__xoffset, sizeof(__pyx_k__xoffset), 0, 0, 1, 1},
  {&__pyx_n_s__xstep, __pyx_k__xstep, sizeof(__pyx_k__xstep), 0, 0, 1, 1},
  {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1},
  {&__pyx_n_s__yoffset, __pyx_k__yoffset, sizeof(__pyx_k__yoffset), 0, 0, 1, 1},
  {&__pyx_n_s__ystep, __pyx_k__ystep, sizeof(__pyx_k__ystep), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_super = __Pyx_GetName(__pyx_b, __pyx_n_s__super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplemented = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_repr = __Pyx_GetName(__pyx_b, __pyx_n_s__repr); if (!__pyx_builtin_repr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  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_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__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 initepr(void); /*proto*/
PyMODINIT_FUNC initepr(void)
#else
PyMODINIT_FUNC PyInit_epr(void); /*proto*/
PyMODINIT_FUNC PyInit_epr(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __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");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_epr(void)", __LINE__, __FILE__);
  #endif
  __pyx_init_filenames();
  __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;}
  #if PY_MAJOR_VERSION < 3
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __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;}
  #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(__Pyx_NAMESTR("epr"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_85), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_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 (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_epr) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr_CLib *)Py_None); Py_INCREF(Py_None);
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_3epr_CLib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CLib", (PyObject *)&__pyx_type_3epr_CLib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_CLib = &__pyx_type_3epr_CLib;
  if (PyType_Ready(&__pyx_type_3epr_EprObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "EprObject", (PyObject *)&__pyx_type_3epr_EprObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_EprObject = &__pyx_type_3epr_EprObject;
  __pyx_type_3epr_DSD.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_DSD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "DSD", (PyObject *)&__pyx_type_3epr_DSD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_DSD = &__pyx_type_3epr_DSD;
  __pyx_type_3epr_Field.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Field) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Field", (PyObject *)&__pyx_type_3epr_Field) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Field = &__pyx_type_3epr_Field;
  __pyx_type_3epr_Record.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Record", (PyObject *)&__pyx_type_3epr_Record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Record = &__pyx_type_3epr_Record;
  __pyx_vtabptr_3epr_Raster = &__pyx_vtable_3epr_Raster;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_3epr_Raster.toarray = (PyArrayObject *(*)(struct __pyx_obj_3epr_Raster *))__pyx_f_3epr_6Raster_toarray;
  #else
  *(void(**)(void))&__pyx_vtable_3epr_Raster.toarray = (void(*)(void))__pyx_f_3epr_6Raster_toarray;
  #endif
  __pyx_type_3epr_Raster.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Raster) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_3epr_Raster.tp_dict, __pyx_vtabptr_3epr_Raster) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Raster", (PyObject *)&__pyx_type_3epr_Raster) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Raster = &__pyx_type_3epr_Raster;
  __pyx_vtabptr_3epr_Band = &__pyx_vtable_3epr_Band;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_3epr_Band.read_raster = (PyObject *(*)(struct __pyx_obj_3epr_Band *, int __pyx_skip_dispatch, struct __pyx_opt_args_3epr_4Band_read_raster *__pyx_optional_args))__pyx_f_3epr_4Band_read_raster;
  #else
  *(void(**)(void))&__pyx_vtable_3epr_Band.read_raster = (void(*)(void))__pyx_f_3epr_4Band_read_raster;
  #endif
  __pyx_type_3epr_Band.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_3epr_Band.tp_dict, __pyx_vtabptr_3epr_Band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Band", (PyObject *)&__pyx_type_3epr_Band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Band = &__pyx_type_3epr_Band;
  __pyx_type_3epr_Dataset.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Dataset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Dataset", (PyObject *)&__pyx_type_3epr_Dataset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Dataset = &__pyx_type_3epr_Dataset;
  __pyx_type_3epr_Product.tp_base = __pyx_ptype_3epr_EprObject;
  if (PyType_Ready(&__pyx_type_3epr_Product) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Product", (PyObject *)&__pyx_type_3epr_Product) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_3epr_Product = &__pyx_type_3epr_Product;
  /*--- Type import code ---*/
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __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[1]; __pyx_lineno = 158; __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[1]; __pyx_lineno = 162; __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[1]; __pyx_lineno = 171; __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[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/home/antonio/projects/pyepr/src/epr.pyx":44
 * '''
 * 
 * __revision__ = '$Id: e4dc1f8c3a4e817448126dc5e2846c90517e728a $'             # <<<<<<<<<<<<<<
 * __version__  = '0.3'
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____revision__, ((PyObject *)__pyx_kp_s_86)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/antonio/projects/pyepr/src/epr.pyx":45
 * 
 * __revision__ = '$Id: e4dc1f8c3a4e817448126dc5e2846c90517e728a $'
 * __version__  = '0.3'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_87)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/antonio/projects/pyepr/src/epr.pyx":364
 * 
 * 
 * import sys             # <<<<<<<<<<<<<<
 * import collections
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":365
 * 
 * import sys
 * import collections             # <<<<<<<<<<<<<<
 * import numpy as np
 * cimport numpy as np
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":366
 * import sys
 * import collections
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * np.import_array()
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":368
 * import numpy as np
 * cimport numpy as np
 * np.import_array()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  import_array();

  /* "/home/antonio/projects/pyepr/src/epr.pyx":372
 * 
 * # utils
 * EPRTime = collections.namedtuple('EPRTime', ('days', 'seconds', 'microseconds'))             # <<<<<<<<<<<<<<
 * 
 * EPR_C_API_VERSION = EPR_PRODUCT_API_VERSION_STR
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__collections); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__days));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__days));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__days));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seconds));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__seconds));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seconds));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__microseconds));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__microseconds));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__microseconds));
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EPRTime));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__EPRTime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EPRTime));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPRTime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":374
 * EPRTime = collections.namedtuple('EPRTime', ('days', 'seconds', 'microseconds'))
 * 
 * EPR_C_API_VERSION = EPR_PRODUCT_API_VERSION_STR             # <<<<<<<<<<<<<<
 * 
 * # EPR_DataTypeId
 */
  __pyx_t_1 = __Pyx_PyBytes_FromString(EPR_PRODUCT_API_VERSION_STR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPR_C_API_VERSION, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":377
 * 
 * # EPR_DataTypeId
 * E_TID_UNKNOWN = e_tid_unknown             # <<<<<<<<<<<<<<
 * E_TID_UCHAR   = e_tid_uchar
 * E_TID_CHAR    = e_tid_char
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_UNKNOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":378
 * # EPR_DataTypeId
 * E_TID_UNKNOWN = e_tid_unknown
 * E_TID_UCHAR   = e_tid_uchar             # <<<<<<<<<<<<<<
 * E_TID_CHAR    = e_tid_char
 * E_TID_USHORT  = e_tid_ushort
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uchar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_UCHAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":379
 * E_TID_UNKNOWN = e_tid_unknown
 * E_TID_UCHAR   = e_tid_uchar
 * E_TID_CHAR    = e_tid_char             # <<<<<<<<<<<<<<
 * E_TID_USHORT  = e_tid_ushort
 * E_TID_SHORT   = e_tid_short
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_CHAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":380
 * E_TID_UCHAR   = e_tid_uchar
 * E_TID_CHAR    = e_tid_char
 * E_TID_USHORT  = e_tid_ushort             # <<<<<<<<<<<<<<
 * E_TID_SHORT   = e_tid_short
 * E_TID_UINT    = e_tid_uint
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_ushort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_USHORT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":381
 * E_TID_CHAR    = e_tid_char
 * E_TID_USHORT  = e_tid_ushort
 * E_TID_SHORT   = e_tid_short             # <<<<<<<<<<<<<<
 * E_TID_UINT    = e_tid_uint
 * E_TID_INT     = e_tid_int
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_short); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_SHORT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":382
 * E_TID_USHORT  = e_tid_ushort
 * E_TID_SHORT   = e_tid_short
 * E_TID_UINT    = e_tid_uint             # <<<<<<<<<<<<<<
 * E_TID_INT     = e_tid_int
 * E_TID_FLOAT   = e_tid_float
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_uint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_UINT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":383
 * E_TID_SHORT   = e_tid_short
 * E_TID_UINT    = e_tid_uint
 * E_TID_INT     = e_tid_int             # <<<<<<<<<<<<<<
 * E_TID_FLOAT   = e_tid_float
 * E_TID_DOUBLE  = e_tid_double
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_INT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":384
 * E_TID_UINT    = e_tid_uint
 * E_TID_INT     = e_tid_int
 * E_TID_FLOAT   = e_tid_float             # <<<<<<<<<<<<<<
 * E_TID_DOUBLE  = e_tid_double
 * E_TID_STRING  = e_tid_string
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_float); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_FLOAT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":385
 * E_TID_INT     = e_tid_int
 * E_TID_FLOAT   = e_tid_float
 * E_TID_DOUBLE  = e_tid_double             # <<<<<<<<<<<<<<
 * E_TID_STRING  = e_tid_string
 * E_TID_SPARE   = e_tid_spare
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_DOUBLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":386
 * E_TID_FLOAT   = e_tid_float
 * E_TID_DOUBLE  = e_tid_double
 * E_TID_STRING  = e_tid_string             # <<<<<<<<<<<<<<
 * E_TID_SPARE   = e_tid_spare
 * E_TID_TIME    = e_tid_time
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_STRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":387
 * E_TID_DOUBLE  = e_tid_double
 * E_TID_STRING  = e_tid_string
 * E_TID_SPARE   = e_tid_spare             # <<<<<<<<<<<<<<
 * E_TID_TIME    = e_tid_time
 * 
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_spare); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_SPARE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":388
 * E_TID_STRING  = e_tid_string
 * E_TID_SPARE   = e_tid_spare
 * E_TID_TIME    = e_tid_time             # <<<<<<<<<<<<<<
 * 
 * # EPR_SampleModel
 */
  __pyx_t_1 = PyInt_FromLong(e_tid_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_TID_TIME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":391
 * 
 * # EPR_SampleModel
 * E_SMOD_1OF1 = e_smod_1OF1             # <<<<<<<<<<<<<<
 * E_SMOD_1OF2 = e_smod_1OF2
 * E_SMOD_2OF2 = e_smod_2OF2
 */
  __pyx_t_1 = PyInt_FromLong(e_smod_1OF1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_1OF1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":392
 * # EPR_SampleModel
 * E_SMOD_1OF1 = e_smod_1OF1
 * E_SMOD_1OF2 = e_smod_1OF2             # <<<<<<<<<<<<<<
 * E_SMOD_2OF2 = e_smod_2OF2
 * E_SMOD_3TOI = e_smod_3TOI
 */
  __pyx_t_1 = PyInt_FromLong(e_smod_1OF2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_1OF2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":393
 * E_SMOD_1OF1 = e_smod_1OF1
 * E_SMOD_1OF2 = e_smod_1OF2
 * E_SMOD_2OF2 = e_smod_2OF2             # <<<<<<<<<<<<<<
 * E_SMOD_3TOI = e_smod_3TOI
 * E_SMOD_2TOF = e_smod_2TOF
 */
  __pyx_t_1 = PyInt_FromLong(e_smod_2OF2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_2OF2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":394
 * E_SMOD_1OF2 = e_smod_1OF2
 * E_SMOD_2OF2 = e_smod_2OF2
 * E_SMOD_3TOI = e_smod_3TOI             # <<<<<<<<<<<<<<
 * E_SMOD_2TOF = e_smod_2TOF
 * 
 */
  __pyx_t_1 = PyInt_FromLong(e_smod_3TOI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_3TOI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":395
 * E_SMOD_2OF2 = e_smod_2OF2
 * E_SMOD_3TOI = e_smod_3TOI
 * E_SMOD_2TOF = e_smod_2TOF             # <<<<<<<<<<<<<<
 * 
 * # EPR_ScalingMethod
 */
  __pyx_t_1 = PyInt_FromLong(e_smod_2TOF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMOD_2TOF, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":398
 * 
 * # EPR_ScalingMethod
 * E_SMID_NON = e_smid_non             # <<<<<<<<<<<<<<
 * E_SMID_LIN = e_smid_lin
 * E_SMID_LOG = e_smid_log
 */
  __pyx_t_1 = PyInt_FromLong(e_smid_non); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMID_NON, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":399
 * # EPR_ScalingMethod
 * E_SMID_NON = e_smid_non
 * E_SMID_LIN = e_smid_lin             # <<<<<<<<<<<<<<
 * E_SMID_LOG = e_smid_log
 * 
 */
  __pyx_t_1 = PyInt_FromLong(e_smid_lin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMID_LIN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":400
 * E_SMID_NON = e_smid_non
 * E_SMID_LIN = e_smid_lin
 * E_SMID_LOG = e_smid_log             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyInt_FromLong(e_smid_log); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__E_SMID_LOG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":428
 * 
 * 
 * class EPRError(Exception):             # <<<<<<<<<<<<<<
 *     '''EPR API error'''
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_88)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_1), __pyx_n_s__EPRError, "epr"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":431
 *     '''EPR API error'''
 * 
 *     def __init__(self, message='', code=None, *args, **kargs):             # <<<<<<<<<<<<<<
 *         super(EPRError, self).__init__(message, code, *args, **kargs)
 * 
 */
  __pyx_t_3 = PyCFunction_New(&__pyx_mdef_3epr_8EPRError___init__, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPRError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":438
 * 
 * 
 * class EPRValueError(EPRError, ValueError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPRError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_ValueError);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_builtin_ValueError);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__EPRValueError, "epr"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPRValueError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":495
 * 
 * # global CLib instance
 * cdef CLib _EPR_C_LIB = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GOTREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_DECREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(Py_None);
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr_CLib *)Py_None);

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2296
 * 
 * # library initialization/finalization
 * _EPR_C_LIB = CLib()             # <<<<<<<<<<<<<<
 * 
 * # @TODO: check
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3epr_CLib)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_DECREF(((PyObject *)__pyx_v_3epr__EPR_C_LIB));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_v_3epr__EPR_C_LIB = ((struct __pyx_obj_3epr_CLib *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2299
 * 
 * # @TODO: check
 * import atexit             # <<<<<<<<<<<<<<
 * 
 * @atexit.register
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__atexit), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__atexit, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2301
 * import atexit
 * 
 * @atexit.register             # <<<<<<<<<<<<<<
 * def _close_api():
 *     global _EPR_C_LIB
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__atexit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__register); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2302
 * 
 * @atexit.register
 * def _close_api():             # <<<<<<<<<<<<<<
 *     global _EPR_C_LIB
 *     _EPR_C_LIB = None
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___close_api); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2302; __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 = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___close_api, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/antonio/projects/pyepr/src/epr.pyx":2305
 *     global _EPR_C_LIB
 *     _EPR_C_LIB = None
 * del atexit             # <<<<<<<<<<<<<<
 */
  if (__Pyx_DelAttrString(__pyx_m, "atexit") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/antonio/projects/pyepr/src/epr.pyx":1
 * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
 * 
 * # PyEPR - Python bindings for ENVISAT Product Reader API
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__get_data_type_size); 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);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_89), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__data_type_id_to_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_90), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s_92); 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);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_91), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s_94); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_93), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_95), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_unit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_96), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_97), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_num_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_98), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_99), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_100), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_elem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_101), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Field); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_elems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_102), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Record); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_num_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_103), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Record); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_104), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Record); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_element); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_105), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Record); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_field); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_106), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Record); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_field_at); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_107), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Record); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_field_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_108), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Record); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_109), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Raster); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_110), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Raster); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_111), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Raster); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_elem_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_112), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Raster); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_pixel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_113), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__create_raster); 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);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_114), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s_116); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_115), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Band); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_117), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Band); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s_34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_118), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Band); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__read_raster); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_119), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Band); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__read_as_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_120), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Dataset); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_121), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Dataset); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_dsd_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_122), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Dataset); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_num_records); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_123), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Dataset); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_dsd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_124), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Dataset); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__create_record); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_125), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Dataset); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__read_record); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_126), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Dataset); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__records); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_127), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_scene_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_128), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_scene_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_129), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_num_datasets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_130), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_num_dsds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_131), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_num_bands); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_132), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_dataset_at); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_133), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_dataset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_134), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_dsd_at); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_135), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_mph); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_136), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_sph); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_137), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_band); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_138), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_band_at); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_139), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_dataset_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_140), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__get_band_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_141), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__datasets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_142), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Product); 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);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__bands); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __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_GetAttrString(__pyx_t_2, "__doc__");
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_143), __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;
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__open); 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);
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_144), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/usr/lib/pymodules/python2.6/Cython/Includes/stdlib.pxd":2
 * 
 * cdef extern from "stdlib.h" nogil:             # <<<<<<<<<<<<<<
 *     void free(void *ptr)
 *     void *malloc(size_t size)
 */
  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) {
    __Pyx_AddTraceback("init epr");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init epr");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

static const char *__pyx_filenames[] = {
  "epr.pyx",
  "numpy.pxd",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

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_AS_STRING(kw_name));
        #endif
}

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 *number, *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";
    }
    number = (num_expected == 1) ? "" : "s";
    PyErr_Format(PyExc_TypeError,
        #if PY_VERSION_HEX < 0x02050000
            "%s() takes %s %d positional argument%s (%d given)",
        #else
            "%s() takes %s %zd positional argument%s (%zd given)",
        #endif
        func_name, more_or_less, num_expected, number, num_found);
}

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;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static PyObject* __Pyx_PyEval_CallObjectWithKeywords(PyObject *callable, PyObject *args, PyObject *kwargs) {
    PyObject* result;
    if (likely(PyDict_Check(kwargs))) {
        return PyEval_CallObjectWithKeywords(callable, args, kwargs);
    } else {
        PyObject* real_dict;
        real_dict = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, kwargs, NULL);
        if (unlikely(!real_dict))
            return NULL;
        result = PyEval_CallObjectWithKeywords(callable, args, real_dict);
        Py_DECREF(real_dict);
        return result; /* may be NULL */
    }
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #else
        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
        #endif
            goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    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;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    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;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}


static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(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 CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
        #if PY_VERSION_HEX < 0x02050000
                 "need more than %d value%s to unpack", (int)index,
        #else
                 "need more than %zd value%s to unpack", index,
        #endif
                 (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) {
    PyErr_SetString(PyExc_ValueError, "too many values to unpack");
}

static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred()) {
            __Pyx_RaiseNeedMoreValuesError(index);
        }
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_RaiseTooManyValuesError();
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError();
    }
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    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);
}

static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    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);
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!__import__)
        goto bad;
    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;
    module = PyObject_CallFunctionObjArgs(__import__,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static PyObject *__Pyx_CreateClass(
    PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
{
    PyObject *py_modname;
    PyObject *result = 0;

    #if PY_MAJOR_VERSION < 3
    py_modname = PyString_FromString(modname);
    #else
    py_modname = PyUnicode_FromString(modname);
    #endif
    if (!py_modname)
        goto bad;
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    result = PyClass_New(bases, dict, name);
    #else
    result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
    #endif
bad:
    Py_XDECREF(py_modname);
    return result;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    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);
}

static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    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;
}


#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            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;
            }
        #endif
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    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)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    PyErr_SetObject(type, value);

    if (tb) {
        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);
        }
    }

bad:
    return;
}
#endif

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint(uint val) {
    const uint neg_one = (uint)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(uint) <  sizeof(long)) {
        return PyInt_FromLong((long)val);
    } else if (sizeof(uint) == sizeof(long)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else { /* (sizeof(uint) > sizeof(long)) */
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uchar(uchar val) {
    const uchar neg_one = (uchar)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(uchar) <  sizeof(long)) {
        return PyInt_FromLong((long)val);
    } else if (sizeof(uchar) == sizeof(long)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else { /* (sizeof(uchar) > sizeof(long)) */
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ushort(ushort val) {
    const ushort neg_one = (ushort)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(ushort) <  sizeof(long)) {
        return PyInt_FromLong((long)val);
    } else if (sizeof(ushort) == sizeof(long)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else { /* (sizeof(ushort) > sizeof(long)) */
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    }
}

#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;
    }
/*
    static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
#if HAVE_HYPOT
        return hypotf(z.real, z.imag);
#else
        return sqrtf(z.real*z.real + z.imag*z.imag);
#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;
    }
/*
    static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
#if HAVE_HYPOT
        return hypot(z.real, z.imag);
#else
        return sqrt(z.real*z.real + z.imag*z.imag);
#endif
    }
*/
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #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);
    }
}

static CYTHON_INLINE uint __Pyx_PyInt_from_py_uint(PyObject* x) {
    const uint neg_one = (uint)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(uint) == sizeof(char)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (uint)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(uint) == sizeof(short)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (uint)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(uint) == sizeof(int)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (uint)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(uint) == sizeof(long)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (uint)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(uint) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (uint)__Pyx_PyInt_AsSignedLongLong(x);
#if 0
    } else if (sizeof(uint) > sizeof(short) &&
               sizeof(uint) < sizeof(int)) { /*  __int32 ILP64 ? */
        if (is_unsigned)
            return (uint)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (uint)__Pyx_PyInt_AsSignedInt(x);
#endif
    }
    PyErr_SetString(PyExc_TypeError, "uint");
    return (uint)-1;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX < 0x03010000
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#else
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    long size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    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, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning), 
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        PyErr_WarnEx(NULL, warning, 0);
    }
    else if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return 0;
}
#endif

#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;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    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

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #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_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

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  /* Python 3+ has unicode identifiers */
        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;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   if (x == Py_True) return 1;
   else if ((x == Py_False) | (x == Py_None)) return 0;
   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_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  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_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (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 = 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) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
