/* Generated by Cython 0.29.14 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h",
            "/private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h"
        ],
        "include_dirs": [
            "/private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/numpy/core/include"
        ],
        "name": "openpiv.process",
        "sources": [
            "./openpiv/process.pyx"
        ]
    },
    "module_name": "openpiv.process"
}
END: Cython Metadata */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_14"
#define CYTHON_HEX_VERSION 0x001D0EF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

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

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #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 CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
  #define PyObject_Unicode             PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

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


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

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

#define __PYX_HAVE__openpiv__process
#define __PYX_HAVE_API__openpiv__process
/* Early includes */
#include <string.h>
#include <stdio.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

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

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


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

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

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


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


/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":776
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":777
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":778
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":779
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":783
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":784
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":785
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":786
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":790
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":791
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":800
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":801
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":804
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":805
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":806
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":808
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":809
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":811
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":812
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

/* "openpiv/process.pyx":17
 * 
 * DTYPEi = np.int32
 * ctypedef np.int32_t DTYPEi_t             # <<<<<<<<<<<<<<
 * 
 * DTYPEf = np.float64
 */
typedef __pyx_t_5numpy_int32_t __pyx_t_7openpiv_7process_DTYPEi_t;

/* "openpiv/process.pyx":20
 * 
 * DTYPEf = np.float64
 * ctypedef np.float64_t DTYPEf_t             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_5numpy_float64_t __pyx_t_7openpiv_7process_DTYPEf_t;
/* Declarations.proto */
#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
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#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
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":815
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":816
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":817
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":819
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;

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

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

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

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

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

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type);

/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
    ((obj == Py_None || obj == NULL) ?\
    (__Pyx_ZeroBuffer(buf), 0) :\
    __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };

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

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

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

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

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

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
/* None.proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

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

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

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

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_TrueDivideObjC(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
/* None.proto */
static CYTHON_INLINE __pyx_t_7openpiv_7process_DTYPEi_t __Pyx_div___pyx_t_7openpiv_7process_DTYPEi_t(__pyx_t_7openpiv_7process_DTYPEi_t, __pyx_t_7openpiv_7process_DTYPEi_t);

/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

#define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

#define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

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

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

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

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


/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);

/* Print.proto */
static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

/* RealImag.proto */
#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(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #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

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);

/* PrintOne.proto */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* CStringEquals.proto */
static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


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

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

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

/* Module declarations from '__builtin__' */

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

/* Module declarations from 'cpython' */

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

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

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

/* Module declarations from 'numpy' */

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

/* Module declarations from 'cython' */

/* Module declarations from 'openpiv.process' */
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t = { "DTYPEi_t", NULL, sizeof(__pyx_t_7openpiv_7process_DTYPEi_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_7openpiv_7process_DTYPEi_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_7openpiv_7process_DTYPEi_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t = { "DTYPEf_t", NULL, sizeof(__pyx_t_7openpiv_7process_DTYPEf_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
#define __Pyx_MODULE_NAME "openpiv.process"
extern int __pyx_module_is_main_openpiv__process;
int __pyx_module_is_main_openpiv__process = 0;

/* Implementation of 'openpiv.process' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_any;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_ImportError;
static const char __pyx_k_F[] = "F";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_J[] = "J";
static const char __pyx_k_K[] = "K";
static const char __pyx_k_L[] = "L";
static const char __pyx_k_M[] = "M";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_P[] = "P";
static const char __pyx_k_W[] = "W";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_l[] = "l";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_u[] = "u";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_Q1[] = "Q1";
static const char __pyx_k_Q4[] = "Q4";
static const char __pyx_k_cd[] = "cd";
static const char __pyx_k_cl[] = "cl";
static const char __pyx_k_cr[] = "cr";
static const char __pyx_k_cu[] = "cu";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_f1[] = "f1";
static const char __pyx_k_f2[] = "f2";
static const char __pyx_k_f3[] = "f3";
static const char __pyx_k_f4[] = "f4";
static const char __pyx_k_ma[] = "ma";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_x1[] = "x1";
static const char __pyx_k_x2[] = "x2";
static const char __pyx_k_y1[] = "y1";
static const char __pyx_k_y2[] = "y2";
static const char __pyx_k__11[] = " ";
static const char __pyx_k__12[] = "//////////////////////////////////////////////////////////////////";
static const char __pyx_k__16[] = "----------------------------------------------------------";
static const char __pyx_k__17[] = "-----------------------------------";
static const char __pyx_k__18[] = "     ";
static const char __pyx_k__19[] = " | ";
static const char __pyx_k__20[] = "-------------------------------------------------------------";
static const char __pyx_k__28[] = "*";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_any[] = "any";
static const char __pyx_k_arg[] = "arg";
static const char __pyx_k_dat[] = "dat";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_fft[] = "fft";
static const char __pyx_k_ind[] = "ind";
static const char __pyx_k_inf[] = "inf";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_log[] = "log";
static const char __pyx_k_low[] = "low";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_s2n[] = "s2n";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_tmp[] = "tmp";
static const char __pyx_k_DONE[] = "..[DONE]";
static const char __pyx_k_Imax[] = "Imax";
static const char __pyx_k_Jmax[] = "Jmax";
static const char __pyx_k_Ncol[] = "Ncol";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_Nrow[] = "Nrow";
static const char __pyx_k_arr1[] = "arr1";
static const char __pyx_k_axes[] = "axes";
static const char __pyx_k_bool[] = "bool";
static const char __pyx_k_conj[] = "conj";
static const char __pyx_k_corr[] = "corr";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_full[] = "full";
static const char __pyx_k_high[] = "high";
static const char __pyx_k_ifin[] = "ifin";
static const char __pyx_k_iini[] = "iini";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_jfin[] = "jfin";
static const char __pyx_k_jini[] = "jini";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mark[] = "mark";
static const char __pyx_k_mask[] = "mask";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_mean[] = "mean";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_peak[] = "peak";
static const char __pyx_k_real[] = "real";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_side[] = "side";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_view[] = "view";
static const char __pyx_k_WiDIM[] = "WiDIM";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_float[] = "float";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_isnan[] = "isnan";
static const char __pyx_k_low_x[] = "low_x";
static const char __pyx_k_low_y[] = "low_y";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_nfftx[] = "nfftx";
static const char __pyx_k_nffty[] = "nffty";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_peak1[] = "peak1";
static const char __pyx_k_peak2[] = "peak2";
static const char __pyx_k_power[] = "power";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rfft2[] = "rfft2";
static const char __pyx_k_rms_u[] = "rms_u";
static const char __pyx_k_rms_v[] = "rms_v";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_width[] = "width";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_DONE_2[] = "...[DONE]";
static const char __pyx_k_DTYPEf[] = "DTYPEf";
static const char __pyx_k_DTYPEi[] = "DTYPEi";
static const char __pyx_k_arange[] = "arange";
static const char __pyx_k_argmax[] = "argmax";
static const char __pyx_k_direct[] = "direct";
static const char __pyx_k_high_x[] = "high_x";
static const char __pyx_k_high_y[] = "high_y";
static const char __pyx_k_i_peak[] = "i_peak";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_irfft2[] = "irfft2";
static const char __pyx_k_j_peak[] = "j_peak";
static const char __pyx_k_launch[] = "launch";
static const char __pyx_k_masked[] = "masked";
static const char __pyx_k_mean_u[] = "mean_u";
static const char __pyx_k_mean_v[] = "mean_v";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_minlow[] = "minlow";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_n_cols[] = "n_cols";
static const char __pyx_k_n_rows[] = "n_rows";
static const char __pyx_k_nbwind[] = "nbwind";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_window[] = "window";
static const char __pyx_k_x_axis[] = "x_axis";
static const char __pyx_k_y_axis[] = "y_axis";
static const char __pyx_k_Overlap[] = "Overlap";
static const char __pyx_k_flatten[] = "flatten";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_frame_a[] = "frame_a";
static const char __pyx_k_frame_b[] = "frame_b";
static const char __pyx_k_maxhigh[] = "maxhigh";
static const char __pyx_k_openpiv[] = "openpiv";
static const char __pyx_k_overlap[] = "overlap";
static const char __pyx_k_pos_now[] = "pos_now";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_seconds[] = "seconds ";
static const char __pyx_k_STARTING[] = "|           STARTING              |";
static const char __pyx_k_centroid[] = "centroid";
static const char __pyx_k_convolve[] = "convolve";
static const char __pyx_k_fftshift[] = "fftshift";
static const char __pyx_k_gaussian[] = "gaussian";
static const char __pyx_k_meshgrid[] = "meshgrid";
static const char __pyx_k_numpy_ma[] = "numpy.ma";
static const char __pyx_k_overlaps[] = "overlaps";
static const char __pyx_k_pic_size[] = "pic_size";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_residual[] = " --residual : ";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_window_a[] = "window_a";
static const char __pyx_k_window_b[] = "window_b";
static const char __pyx_k_Algorithm[] = "Algorithm : ";
static const char __pyx_k_ITERATION[] = "ITERATION # ";
static const char __pyx_k_StartTime[] = "StartTime";
static const char __pyx_k_corr_max1[] = "corr_max1";
static const char __pyx_k_corr_max2[] = "corr_max2";
static const char __pyx_k_find_peak[] = "_find_peak";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_numpy_fft[] = "numpy.fft";
static const char __pyx_k_parabolic[] = "parabolic";
static const char __pyx_k_peak2mean[] = "peak2mean";
static const char __pyx_k_peak2peak[] = "peak2peak";
static const char __pyx_k_pos_now_x[] = "pos_now_x";
static const char __pyx_k_pos_now_y[] = "pos_now_y";
static const char __pyx_k_searching[] = "searching";
static const char __pyx_k_sig2noise[] = "sig2noise";
static const char __pyx_k_startTime[] = "startTime";
static const char __pyx_k_time_step[] = "time step";
static const char __pyx_k_tolerance[] = "tolerance";
static const char __pyx_k_DONE_after[] = "[DONE] ..after ";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_Parameters[] = "Parameters   ";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_image_size[] = "image_size";
static const char __pyx_k_neighbours[] = "neighbours";
static const char __pyx_k_residual_0[] = "residual_0";
static const char __pyx_k_residual_2[] = "residual";
static const char __pyx_k_F_dichotomy[] = "F_dichotomy";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_MaskedArray[] = "MaskedArray";
static const char __pyx_k_Open_I_mage[] = "| Open      ||                    I mage                 |";
static const char __pyx_k_corr_method[] = "corr_method";
static const char __pyx_k_field_shape[] = "field_shape";
static const char __pyx_k_nb_iter_max[] = "nb_iter_max";
static const char __pyx_k_progressbar[] = "progressbar";
static const char __pyx_k_search_area[] = "search_area";
static const char __pyx_k_window_size[] = "window_size";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_Window_sizes[] = "Window sizes";
static const char __pyx_k_scipy_signal[] = "scipy.signal";
static const char __pyx_k_Size_of_image[] = "Size of image";
static const char __pyx_k_coarse_factor[] = "coarse_factor";
static const char __pyx_k_mean_velocity[] = "mean_velocity";
static const char __pyx_k_overlap_ratio[] = "overlap_ratio";
static const char __pyx_k_WiDIM_line_536[] = "WiDIM (line 536)";
static const char __pyx_k_define_windows[] = "define_windows";
static const char __pyx_k_trust_1st_iter[] = "trust_1st_iter";
static const char __pyx_k_coarse_factor_2[] = "coarse factor";
static const char __pyx_k_find_neighbours[] = "find_neighbours";
static const char __pyx_k_get_coordinates[] = "get_coordinates";
static const char __pyx_k_get_field_shape[] = "get_field_shape";
static const char __pyx_k_min_window_size[] = "min_window_size";
static const char __pyx_k_openpiv_process[] = "openpiv.process";
static const char __pyx_k_overlap_ratio_2[] = "overlap ratio";
static const char __pyx_k_sig2noise_ratio[] = "sig2noise_ratio";
static const char __pyx_k_subpixel_method[] = "subpixel_method";
static const char __pyx_k_sumsquare_array[] = "sumsquare_array";
static const char __pyx_k_validation_iter[] = "validation_iter";
static const char __pyx_k_find_second_peak[] = "_find_second_peak";
static const char __pyx_k_search_area_size[] = "search_area_size";
static const char __pyx_k_sig2noise_method[] = "sig2noise_method";
static const char __pyx_k_correlate_windows[] = "correlate_windows";
static const char __pyx_k_validation_method[] = "validation_method";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_neighbours_present[] = "neighbours_present";
static const char __pyx_k_subp_peak_position[] = "subp_peak_position";
static const char __pyx_k_CorrelationFunction[] = "CorrelationFunction";
static const char __pyx_k_Starting_validation[] = "Starting validation..";
static const char __pyx_k_normalize_intensity[] = "normalize_intensity";
static const char __pyx_k_openpiv_process_pyx[] = "openpiv/process.pyx";
static const char __pyx_k_validation_method_2[] = "validation method";
static const char __pyx_k_linear_interpolation[] = "linear_interpolation";
static const char __pyx_k_lower_lim_previous_x[] = "lower_lim_previous_x";
static const char __pyx_k_lower_lim_previous_y[] = "lower_lim_previous_y";
static const char __pyx_k_upper_lim_previous_x[] = "upper_lim_previous_x";
static const char __pyx_k_upper_lim_previous_y[] = "upper_lim_previous_y";
static const char __pyx_k_bilinear_interpolation[] = "bilinear_interpolation";
static const char __pyx_k_subpixel_peak_position[] = "subpixel_peak_position";
static const char __pyx_k_wrong_sig2noise_method[] = "wrong sig2noise_method";
static const char __pyx_k_DONE_going_to_iteration[] = "..[DONE] -----> going to iteration ";
static const char __pyx_k_going_to_next_iteration[] = "going to next iteration.. ";
static const char __pyx_k_PIV_V_elocimetry_Toolbox[] = "|     PIV   ||                    V elocimetry  Toolbox  |";
static const char __pyx_k_extended_search_area_piv[] = "extended_search_area_piv";
static const char __pyx_k_interpolate_surroundings[] = "interpolate_surroundings";
static const char __pyx_k_The_Open_Source_P_article[] = "|----->     ||   The Open Source  P article              |";
static const char __pyx_k_method_is_not_implemented[] = "method is not implemented";
static const char __pyx_k_CorrelationFunction___init[] = "CorrelationFunction.__init__";
static const char __pyx_k_total_number_of_iterations[] = "total number of iterations";
static const char __pyx_k_Validation_iteration_number[] = "Validation, iteration number ";
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static const char __pyx_k_www_openpiv_net_version_1_0[] = "|     <-----||   www.openpiv.net          version 1.0    |";
static const char __pyx_k_no_valid_side_for_F_dichotomy[] = "no valid side for F-dichotomy!";
static const char __pyx_k_CorrelationFunction__find_peak[] = "CorrelationFunction._find_peak";
static const char __pyx_k_Implementation_of_the_WiDIM_alg[] = "\n    Implementation of the WiDIM algorithm (Window Displacement Iterative Method).\n    This is an iterative  method to cope with  the lost of pairs due to particles \n    motion and get rid of the limitation in velocity range due to the window size.\n    The possibility of window size coarsening is implemented.\n    Example : minimum window size of 16*16 pixels and coarse_level of 2 gives a 1st\n    iteration with a window size of 64*64 pixels, then 32*32 then 16*16.\n        ----Algorithm : At each step, a predictor of the displacement (dp) is applied based on the results of the previous iteration.\n                        Each window is correlated with a shifted window.\n                        The displacement obtained from this correlation is the residual displacement (dc)\n                        The new displacement (d) is obtained with dx = dpx + dcx and dy = dpy + dcy\n                        The velocity field is validated and wrong vectors are replaced by mean value of surrounding vectors from the previous iteration (or by bilinear interpolation if the window size of previous iteration was different)\n                        The new predictor is obtained by bilinear interpolation of the displacements of the previous iteration:\n                            dpx_k+1 = dx_k\n\n    Reference:\n        F. Scarano & M. L. Riethmuller, Iterative multigrid approach in PIV image processing with discrete window offset, Experiments in Fluids 26 (1999) 513-523\n    \n    Parameters\n    ----------\n    frame_a : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the first frame.\n        \n    frame_b : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the second frame.\n        \n    mark : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers with values 0 for the background, 1 for the flow-field. If the center of a window is"" on a 0 value the velocity is set to 0.\n\n    min_window_size : int\n        the size of the minimum (final) (square) interrogation window.\n        \n    overlap_ratio : float\n        the ratio of overlap between two windows (between 0 and 1).\n        \n    dt : float\n        the time delay separating the two frames.\n    \n    validation_method : string\n        the method used for validation (in addition to the sig2noise method). Only the mean velocity method is implemented now\n    \n    trust_1st_iter : int = 0 or 1\n        0 if the first iteration need to be validated. With a first window size following the 1/4 rule, the 1st iteration can be trusted and the value should be 1 (Default value)\n     \n    validation_iter : int\n        number of iterations per validation cycle.\n       \n    tolerance : float\n        the threshold for the validation method chosen. This does not concern the sig2noise for which the threshold is 1.5; [nb: this could change in the future]\n    \n    nb_iter_max : int\n        global number of iterations.\n       \n    subpixel_method : string\n         one of the following methods to estimate subpixel location of the peak: \n         'centroid' [replaces default if correlation map is negative], \n         'gaussian' [default if correlation map is positive], \n         'parabolic'.\n    \n    sig2noise_method : string \n        defines the method of signal-to-noise-ratio measure,\n        ('peak2peak' or 'peak2mean'. If None, no measure is performed.)\n        \n    width : int\n        the half size of the region around the first\n        correlation peak to ignore for finding the second\n        peak. [default: 2]. Only used if ``sig2noise_method==peak2peak``.\n        \n    nfftx   : int\n        the size of the 2D FFT in x-direction, \n        [default: 2 x windows_a.shape[0] is recommended]\n        \n    nffty   : int\n        the size of the 2D FFT in y-direction, \n        [default: 2 x windows_a.shape[1] is recommended]""\n\n    \n    Returns\n    -------\n\n    x : 2d np.ndarray\n        a two dimensional array containing the x-axis component of the interpolations locations.\n        \n    y : 2d np.ndarray\n        a two dimensional array containing the y-axis component of the interpolations locations.\n        \n    u : 2d np.ndarray\n        a two dimensional array containing the u velocity component,\n        in pixels/seconds.\n        \n    v : 2d np.ndarray\n        a two dimensional array containing the v velocity component,\n        in pixels/seconds.\n        \n    mask : 2d np.ndarray\n        a two dimensional array containing the boolean values (True for vectors interpolated from previous iteration)\n        \n    Example\n    --------\n    \n    >>> x,y,u,v, mask = openpiv.process.WiDIM( frame_a, frame_b, mark, min_window_size=16, overlap_ratio=0.25, coarse_factor=2, dt=0.02, validation_method='mean_velocity', trust_1st_iter=1, validation_iter=2, tolerance=0.7, nb_iter_max=4, sig2noise_method='peak2peak')\n\n    --------------------------------------\n    Method of implementation : to improve the speed of the programm,\n    all data have been placed in the same huge 4-dimensions 'F' array.\n    (this prevent the definition of a new array for each iteration)\n    However, during the coarsening process a large part of the array is not used.\n    Structure of array F:\n    --The 1st index is the main iteration (K)   --> length is nb_iter_max\n        -- 2nd index (I) is row (of the map of the interpolations locations of iteration K) --> length (effectively used) is Nrow[K]\n            --3rd index (J) is column  --> length (effectively used) is Ncol[K]\n                --4th index represent the type of data stored at this point:\n                            | 0 --> x         |\n                            | 1 --> y         | \n                            | 2 --> xb        |\n                            | 3 --> yb        | \n                            | 4 --> dx        |""\n                            | 5 --> dy        | \n                            | 6 --> dpx       |\n                            | 7 --> dpy       | \n                            | 8 --> dcx       |\n                            | 9 --> dcy       | \n                            | 10 --> u        |\n                            | 11 --> v        | \n                            | 12 --> si2noise | \n    Storage of data with indices is not good for comprehension so its very important to comment on each single operation.\n    A python dictionary type could have been used (and would be much more intuitive)\n    but its equivalent in c language (type map) is very slow compared to a numpy ndarray.\n    ";
static const char __pyx_k_The_implementation_of_the_one_s[] = "\n    The implementation of the one-step direct correlation with different \n    size of the interrogation window and the search area. The increased\n    size of the search areas cope with the problem of loss of pairs due\n    to in-plane motion, allowing for a smaller interrogation window size,\n    without increasing the number of outlier vectors.\n    \n    See:\n    \n    Particle-Imaging Techniques for Experimental Fluid Mechanics\n\n    Annual Review of Fluid Mechanics\n    Vol. 23: 261-304 (Volume publication date January 1991)\n    DOI: 10.1146/annurev.fl.23.010191.001401    \n    \n    Parameters\n    ----------\n    frame_a : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the first frame.\n        \n    frame_b : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the second frame.\n        \n    window_size : int\n        the size of the (square) interrogation window.\n        \n    overlap : int\n        the number of pixels by which two adjacent windows overlap.\n        \n    dt : float\n        the time delay separating the two frames.\n    \n    search_area_size : int\n        the size of the (square) interrogation window from the second frame\n    \n    subpixel_method : string\n         one of the following methods to estimate subpixel location of the peak: \n         'centroid' [replaces default if correlation map is negative], \n         'gaussian' [default if correlation map is positive], \n         'parabolic'.\n    \n    sig2noise_method : string \n        defines the method of signal-to-noise-ratio measure,\n        ('peak2peak' or 'peak2mean'. If None, no measure is performed.)\n        \n    width : int\n        the half size of the region around the first\n        correlation peak to ignore for finding the second\n        peak. [default: 2]. Only used if ``sig2noise_method==peak2peak``.\n        \n    nfftx   : int""\n        the size of the 2D FFT in x-direction, \n        [default: 2 x windows_a.shape[0] is recommended]\n        \n    nffty   : int\n        the size of the 2D FFT in y-direction, \n        [default: 2 x windows_a.shape[1] is recommended]\n\n    \n    Returns\n    -------\n    u : 2d np.ndarray\n        a two dimensional array containing the u velocity component,\n        in pixels/seconds.\n        \n    v : 2d np.ndarray\n        a two dimensional array containing the v velocity component,\n        in pixels/seconds.\n        \n    sig2noise : 2d np.ndarray, optional\n        a two dimensional array containing the signal to noise ratio\n        from the cross correlation function. This array is returned if\n        sig2noise_method is not None.\n        \n    Examples\n    --------\n    \n    >>> u, v = openpiv.process.extended_search_area_piv( frame_a, frame_b, window_size=16, overlap=8, search_area_size=48, dt=0.1)\n    ";
static const char __pyx_k_number_of_validation_iterations[] = "number of validation iterations";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_performing_interpolation_of_the[] = "performing interpolation of the displacement field";
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static const char __pyx_k_CorrelationFunction__find_second[] = "CorrelationFunction._find_second_peak";
static const char __pyx_k_CorrelationFunction_sig2noise_ra[] = "CorrelationFunction.sig2noise_ratio";
static const char __pyx_k_CorrelationFunction_subpixel_pea[] = "CorrelationFunction.subpixel_peak_position";
static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static const char __pyx_k_Overlap_has_to_be_smaller_than_t[] = "Overlap has to be smaller than the window_size";
static const char __pyx_k_Please_provide_a_nb_iter_max_tha[] = "Please provide a nb_iter_max that is greater than the coarse_level";
static const char __pyx_k_Search_size_cannot_be_smaller_th[] = "Search size cannot be smaller than the window_size";
static const char __pyx_k_This_module_is_dedicated_to_adva[] = "This module is dedicated to advanced algorithms for PIV image analysis.";
static const char __pyx_k_cannot_perform_interpolation_a_p[] = "cannot perform interpolation, a problem occured";
static const char __pyx_k_end_of_iterative_process_Re_arra[] = "end of iterative process.. Re-arranging vector fields..";
static const char __pyx_k_extended_search_area_piv_line_23[] = "extended_search_area_piv (line 23)";
static const char __pyx_k_method_not_understood_Can_be_gau[] = "method not understood. Can be 'gaussian', 'centroid', 'parabolic'.";
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static const char __pyx_k_no_validation_trusting_1st_itera[] = "no validation : trusting 1st iteration";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_window_size_cannot_be_larger_tha[] = "window size cannot be larger than the image";
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_kp_s_Algorithm;
static PyObject *__pyx_n_s_CorrelationFunction;
static PyObject *__pyx_n_s_CorrelationFunction___init;
static PyObject *__pyx_n_s_CorrelationFunction__find_peak;
static PyObject *__pyx_n_s_CorrelationFunction__find_second;
static PyObject *__pyx_n_s_CorrelationFunction_sig2noise_ra;
static PyObject *__pyx_n_s_CorrelationFunction_subpixel_pea;
static PyObject *__pyx_kp_s_DONE;
static PyObject *__pyx_kp_s_DONE_2;
static PyObject *__pyx_kp_s_DONE_after;
static PyObject *__pyx_kp_s_DONE_going_to_iteration;
static PyObject *__pyx_n_s_DTYPEf;
static PyObject *__pyx_n_s_DTYPEi;
static PyObject *__pyx_n_s_F;
static PyObject *__pyx_n_s_F_dichotomy;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_n_s_I;
static PyObject *__pyx_kp_s_ITERATION;
static PyObject *__pyx_n_s_Imax;
static PyObject *__pyx_kp_u_Implementation_of_the_WiDIM_alg;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_J;
static PyObject *__pyx_n_s_Jmax;
static PyObject *__pyx_n_s_K;
static PyObject *__pyx_n_s_L;
static PyObject *__pyx_n_s_M;
static PyObject *__pyx_n_s_MaskedArray;
static PyObject *__pyx_n_s_N;
static PyObject *__pyx_n_s_Ncol;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_None;
static PyObject *__pyx_n_s_Nrow;
static PyObject *__pyx_n_s_O;
static PyObject *__pyx_kp_s_Open_I_mage;
static PyObject *__pyx_n_s_Overlap;
static PyObject *__pyx_kp_s_Overlap_has_to_be_smaller_than_t;
static PyObject *__pyx_n_s_P;
static PyObject *__pyx_kp_s_PIV_V_elocimetry_Toolbox;
static PyObject *__pyx_kp_s_Parameters;
static PyObject *__pyx_kp_s_Please_provide_a_nb_iter_max_tha;
static PyObject *__pyx_n_s_Q1;
static PyObject *__pyx_n_s_Q4;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_kp_s_STARTING;
static PyObject *__pyx_kp_s_Search_size_cannot_be_smaller_th;
static PyObject *__pyx_kp_s_Size_of_image;
static PyObject *__pyx_n_s_StartTime;
static PyObject *__pyx_kp_s_Starting_validation;
static PyObject *__pyx_kp_s_The_Open_Source_P_article;
static PyObject *__pyx_kp_u_The_implementation_of_the_one_s;
static PyObject *__pyx_kp_s_Validation_iteration_number;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_W;
static PyObject *__pyx_n_s_WiDIM;
static PyObject *__pyx_kp_u_WiDIM_line_536;
static PyObject *__pyx_kp_s_Window_sizes;
static PyObject *__pyx_kp_s__11;
static PyObject *__pyx_kp_s__12;
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__20;
static PyObject *__pyx_n_s__28;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_any;
static PyObject *__pyx_n_s_arange;
static PyObject *__pyx_n_s_arg;
static PyObject *__pyx_n_s_argmax;
static PyObject *__pyx_n_s_arr1;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_axes;
static PyObject *__pyx_n_s_bilinear_interpolation;
static PyObject *__pyx_n_s_bool;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_kp_s_cannot_perform_interpolation_a_p;
static PyObject *__pyx_n_s_cd;
static PyObject *__pyx_n_s_centroid;
static PyObject *__pyx_n_s_cl;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_coarse_factor;
static PyObject *__pyx_kp_s_coarse_factor_2;
static PyObject *__pyx_n_s_conj;
static PyObject *__pyx_n_s_convolve;
static PyObject *__pyx_n_s_corr;
static PyObject *__pyx_n_s_corr_max1;
static PyObject *__pyx_n_s_corr_max2;
static PyObject *__pyx_n_s_corr_method;
static PyObject *__pyx_n_s_correlate_windows;
static PyObject *__pyx_n_s_cr;
static PyObject *__pyx_n_s_cu;
static PyObject *__pyx_n_s_dat;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_define_windows;
static PyObject *__pyx_n_s_direct;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_kp_s_end_of_iterative_process_Re_arra;
static PyObject *__pyx_n_s_extended_search_area_piv;
static PyObject *__pyx_kp_u_extended_search_area_piv_line_23;
static PyObject *__pyx_n_s_f1;
static PyObject *__pyx_n_s_f2;
static PyObject *__pyx_n_s_f3;
static PyObject *__pyx_n_s_f4;
static PyObject *__pyx_n_s_fft;
static PyObject *__pyx_n_s_fftshift;
static PyObject *__pyx_n_s_field_shape;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_find_neighbours;
static PyObject *__pyx_n_s_find_peak;
static PyObject *__pyx_n_s_find_second_peak;
static PyObject *__pyx_n_s_flatten;
static PyObject *__pyx_n_s_float;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_floor;
static PyObject *__pyx_n_s_frame_a;
static PyObject *__pyx_n_s_frame_b;
static PyObject *__pyx_n_s_full;
static PyObject *__pyx_n_s_gaussian;
static PyObject *__pyx_n_s_get_coordinates;
static PyObject *__pyx_n_s_get_field_shape;
static PyObject *__pyx_kp_s_going_to_next_iteration;
static PyObject *__pyx_n_s_high;
static PyObject *__pyx_n_s_high_x;
static PyObject *__pyx_n_s_high_y;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_i_peak;
static PyObject *__pyx_n_s_ifin;
static PyObject *__pyx_n_s_iini;
static PyObject *__pyx_n_s_image_size;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_ind;
static PyObject *__pyx_n_s_inf;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_interpolate_surroundings;
static PyObject *__pyx_n_s_irfft2;
static PyObject *__pyx_n_s_isnan;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_j_peak;
static PyObject *__pyx_n_s_jfin;
static PyObject *__pyx_n_s_jini;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_launch;
static PyObject *__pyx_n_s_linear_interpolation;
static PyObject *__pyx_n_s_log;
static PyObject *__pyx_n_s_low;
static PyObject *__pyx_n_s_low_x;
static PyObject *__pyx_n_s_low_y;
static PyObject *__pyx_n_s_lower_lim_previous_x;
static PyObject *__pyx_n_s_lower_lim_previous_y;
static PyObject *__pyx_n_s_ma;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_mark;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_masked;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_maxhigh;
static PyObject *__pyx_n_s_mean;
static PyObject *__pyx_n_s_mean_u;
static PyObject *__pyx_n_s_mean_v;
static PyObject *__pyx_n_s_mean_velocity;
static PyObject *__pyx_n_s_meshgrid;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_method;
static PyObject *__pyx_kp_s_method_is_not_implemented;
static PyObject *__pyx_kp_s_method_not_understood_Can_be_gau;
static PyObject *__pyx_n_s_min_window_size;
static PyObject *__pyx_n_s_minlow;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_n_cols;
static PyObject *__pyx_n_s_n_rows;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_names;
static PyObject *__pyx_n_s_nb_iter_max;
static PyObject *__pyx_n_s_nbwind;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_neighbours;
static PyObject *__pyx_n_s_neighbours_present;
static PyObject *__pyx_n_s_nfftx;
static PyObject *__pyx_n_s_nffty;
static PyObject *__pyx_kp_s_no_valid_side_for_F_dichotomy;
static PyObject *__pyx_kp_s_no_validation_trusting_1st_itera;
static PyObject *__pyx_n_s_normalize_intensity;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_kp_s_number_of_validation_iterations;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_numpy_fft;
static PyObject *__pyx_n_s_numpy_ma;
static PyObject *__pyx_n_s_openpiv;
static PyObject *__pyx_n_s_openpiv_process;
static PyObject *__pyx_kp_s_openpiv_process_pyx;
static PyObject *__pyx_n_s_overlap;
static PyObject *__pyx_n_s_overlap_ratio;
static PyObject *__pyx_kp_s_overlap_ratio_2;
static PyObject *__pyx_n_s_overlaps;
static PyObject *__pyx_n_s_parabolic;
static PyObject *__pyx_n_s_peak;
static PyObject *__pyx_n_s_peak1;
static PyObject *__pyx_n_s_peak2;
static PyObject *__pyx_n_s_peak2mean;
static PyObject *__pyx_n_s_peak2peak;
static PyObject *__pyx_kp_s_performing_interpolation_of_the;
static PyObject *__pyx_n_s_pic_size;
static PyObject *__pyx_n_s_pos_now;
static PyObject *__pyx_n_s_pos_now_x;
static PyObject *__pyx_n_s_pos_now_y;
static PyObject *__pyx_n_s_power;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_progressbar;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_real;
static PyObject *__pyx_kp_s_residual;
static PyObject *__pyx_n_s_residual_0;
static PyObject *__pyx_n_s_residual_2;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_rfft2;
static PyObject *__pyx_n_s_rms_u;
static PyObject *__pyx_n_s_rms_v;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_n_s_s2n;
static PyObject *__pyx_n_s_scipy_signal;
static PyObject *__pyx_n_s_search_area;
static PyObject *__pyx_n_s_search_area_size;
static PyObject *__pyx_n_s_searching;
static PyObject *__pyx_kp_s_seconds;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_side;
static PyObject *__pyx_n_s_sig2noise;
static PyObject *__pyx_n_s_sig2noise_method;
static PyObject *__pyx_n_s_sig2noise_ratio;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_sqrt;
static PyObject *__pyx_n_s_startTime;
static PyObject *__pyx_n_s_subp_peak_position;
static PyObject *__pyx_n_s_subpixel_method;
static PyObject *__pyx_n_s_subpixel_peak_position;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_sumsquare_array;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_kp_s_time_step;
static PyObject *__pyx_n_s_tmp;
static PyObject *__pyx_n_s_tolerance;
static PyObject *__pyx_kp_s_total_number_of_iterations;
static PyObject *__pyx_n_s_trust_1st_iter;
static PyObject *__pyx_n_s_u;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_upper_lim_previous_x;
static PyObject *__pyx_n_s_upper_lim_previous_y;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_validation_iter;
static PyObject *__pyx_n_s_validation_method;
static PyObject *__pyx_kp_s_validation_method_2;
static PyObject *__pyx_n_s_view;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_window;
static PyObject *__pyx_n_s_window_a;
static PyObject *__pyx_n_s_window_b;
static PyObject *__pyx_n_s_window_size;
static PyObject *__pyx_kp_s_window_size_cannot_be_larger_tha;
static PyObject *__pyx_kp_s_wrong_sig2noise_method;
static PyObject *__pyx_kp_s_www_openpiv_net_version_1_0;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x1;
static PyObject *__pyx_n_s_x2;
static PyObject *__pyx_n_s_x_axis;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_y1;
static PyObject *__pyx_n_s_y2;
static PyObject *__pyx_n_s_y_axis;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_pf_7openpiv_7process_extended_search_area_piv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_frame_a, PyArrayObject *__pyx_v_frame_b, int __pyx_v_window_size, int __pyx_v_overlap, float __pyx_v_dt, int __pyx_v_search_area_size, PyObject *__pyx_v_subpixel_method, PyObject *__pyx_v_sig2noise_method, int __pyx_v_width, PyObject *__pyx_v_nfftx, PyObject *__pyx_v_nffty); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_corr); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_2_find_peak(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_4_find_second_peak(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_6subpixel_peak_position(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_8sig2noise_ratio(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_2get_coordinates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image_size, PyObject *__pyx_v_window_size, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_4get_field_shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image_size, PyObject *__pyx_v_window_size, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_6correlate_windows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_window_a, PyObject *__pyx_v_window_b, PyObject *__pyx_v_corr_method, PyObject *__pyx_v_nfftx, PyObject *__pyx_v_nffty); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_8normalize_intensity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_window); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_10WiDIM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_frame_a, PyArrayObject *__pyx_v_frame_b, PyArrayObject *__pyx_v_mark, int __pyx_v_min_window_size, float __pyx_v_overlap_ratio, int __pyx_v_coarse_factor, float __pyx_v_dt, PyObject *__pyx_v_validation_method, int __pyx_v_trust_1st_iter, int __pyx_v_validation_iter, float __pyx_v_tolerance, int __pyx_v_nb_iter_max, PyObject *__pyx_v_subpixel_method, PyObject *__pyx_v_sig2noise_method, int __pyx_v_width, PyObject *__pyx_v_nfftx, PyObject *__pyx_v_nffty); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_12interpolate_surroundings(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_F, PyArrayObject *__pyx_v_Nrow, PyArrayObject *__pyx_v_Ncol, int __pyx_v_K, int __pyx_v_I, int __pyx_v_J, int __pyx_v_dat); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_14bilinear_interpolation(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_x1, int __pyx_v_x2, int __pyx_v_y1, int __pyx_v_y2, int __pyx_v_x, int __pyx_v_y, float __pyx_v_f1, float __pyx_v_f2, float __pyx_v_f3, float __pyx_v_f4); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_16linear_interpolation(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_x1, int __pyx_v_x2, int __pyx_v_x, int __pyx_v_f1, int __pyx_v_f2); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_18F_dichotomy(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_F, int __pyx_v_K, PyArrayObject *__pyx_v_N, PyObject *__pyx_v_side, int __pyx_v_pos_now); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_20define_windows(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_size); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_22find_neighbours(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_I, int __pyx_v_J, int __pyx_v_Imax, int __pyx_v_Jmax); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_24sumsquare_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr1); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_26launch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method, PyObject *__pyx_v_names, PyObject *__pyx_v_arg); /* proto */
static PyObject *__pyx_pf_7openpiv_7process_28end(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_startTime); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_2_0;
static PyObject *__pyx_float_1eneg_3;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_11;
static PyObject *__pyx_int_14;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__6;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__34;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__44;
static PyObject *__pyx_codeobj__46;
static PyObject *__pyx_codeobj__48;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__52;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__56;
static PyObject *__pyx_codeobj__58;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__64;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
/* Late includes */

/* "openpiv/process.pyx":23
 * 
 * 
 * def extended_search_area_piv( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *                               np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *                               int window_size,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_1extended_search_area_piv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_extended_search_area_piv[] = "\n    The implementation of the one-step direct correlation with different \n    size of the interrogation window and the search area. The increased\n    size of the search areas cope with the problem of loss of pairs due\n    to in-plane motion, allowing for a smaller interrogation window size,\n    without increasing the number of outlier vectors.\n    \n    See:\n    \n    Particle-Imaging Techniques for Experimental Fluid Mechanics\n\n    Annual Review of Fluid Mechanics\n    Vol. 23: 261-304 (Volume publication date January 1991)\n    DOI: 10.1146/annurev.fl.23.010191.001401    \n    \n    Parameters\n    ----------\n    frame_a : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the first frame.\n        \n    frame_b : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the second frame.\n        \n    window_size : int\n        the size of the (square) interrogation window.\n        \n    overlap : int\n        the number of pixels by which two adjacent windows overlap.\n        \n    dt : float\n        the time delay separating the two frames.\n    \n    search_area_size : int\n        the size of the (square) interrogation window from the second frame\n    \n    subpixel_method : string\n         one of the following methods to estimate subpixel location of the peak: \n         'centroid' [replaces default if correlation map is negative], \n         'gaussian' [default if correlation map is positive], \n         'parabolic'.\n    \n    sig2noise_method : string \n        defines the method of signal-to-noise-ratio measure,\n        ('peak2peak' or 'peak2mean'. If None, no measure is performed.)\n        \n    width : int\n        the half size of the region around the first\n        correlation peak to ignore for finding the second\n        peak. [default: 2]. Only used if ``sig2noise_method==peak2peak``.\n        \n    nfftx   : int""\n        the size of the 2D FFT in x-direction, \n        [default: 2 x windows_a.shape[0] is recommended]\n        \n    nffty   : int\n        the size of the 2D FFT in y-direction, \n        [default: 2 x windows_a.shape[1] is recommended]\n\n    \n    Returns\n    -------\n    u : 2d np.ndarray\n        a two dimensional array containing the u velocity component,\n        in pixels/seconds.\n        \n    v : 2d np.ndarray\n        a two dimensional array containing the v velocity component,\n        in pixels/seconds.\n        \n    sig2noise : 2d np.ndarray, optional\n        a two dimensional array containing the signal to noise ratio\n        from the cross correlation function. This array is returned if\n        sig2noise_method is not None.\n        \n    Examples\n    --------\n    \n    >>> u, v = openpiv.process.extended_search_area_piv( frame_a, frame_b, window_size=16, overlap=8, search_area_size=48, dt=0.1)\n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_1extended_search_area_piv = {"extended_search_area_piv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_1extended_search_area_piv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_extended_search_area_piv};
static PyObject *__pyx_pw_7openpiv_7process_1extended_search_area_piv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_frame_a = 0;
  PyArrayObject *__pyx_v_frame_b = 0;
  int __pyx_v_window_size;
  int __pyx_v_overlap;
  float __pyx_v_dt;
  int __pyx_v_search_area_size;
  PyObject *__pyx_v_subpixel_method = 0;
  PyObject *__pyx_v_sig2noise_method = 0;
  int __pyx_v_width;
  PyObject *__pyx_v_nfftx = 0;
  PyObject *__pyx_v_nffty = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extended_search_area_piv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame_a,&__pyx_n_s_frame_b,&__pyx_n_s_window_size,&__pyx_n_s_overlap,&__pyx_n_s_dt,&__pyx_n_s_search_area_size,&__pyx_n_s_subpixel_method,&__pyx_n_s_sig2noise_method,&__pyx_n_s_width,&__pyx_n_s_nfftx,&__pyx_n_s_nffty,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    values[6] = ((PyObject*)__pyx_n_s_gaussian);

    /* "openpiv/process.pyx":30
 *                               int search_area_size=0,
 *                               str subpixel_method='gaussian',
 *                               sig2noise_method=None,             # <<<<<<<<<<<<<<
 *                               int width=2,
 *                               nfftx=None,
 */
    values[7] = ((PyObject *)Py_None);

    /* "openpiv/process.pyx":32
 *                               sig2noise_method=None,
 *                               int width=2,
 *                               nfftx=None,             # <<<<<<<<<<<<<<
 *                               nffty=None):
 *     """
 */
    values[9] = ((PyObject *)Py_None);

    /* "openpiv/process.pyx":33
 *                               int width=2,
 *                               nfftx=None,
 *                               nffty=None):             # <<<<<<<<<<<<<<
 *     """
 *     The implementation of the one-step direct correlation with different
 */
    values[10] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extended_search_area_piv", 0, 3, 11, 1); __PYX_ERR(0, 23, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extended_search_area_piv", 0, 3, 11, 2); __PYX_ERR(0, 23, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dt);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_area_size);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subpixel_method);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sig2noise_method);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nfftx);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nffty);
          if (value) { values[10] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extended_search_area_piv") < 0)) __PYX_ERR(0, 23, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frame_a = ((PyArrayObject *)values[0]);
    __pyx_v_frame_b = ((PyArrayObject *)values[1]);
    __pyx_v_window_size = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_window_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_overlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_overlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error)
    } else {
      __pyx_v_overlap = ((int)0);
    }
    if (values[4]) {
      __pyx_v_dt = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_dt == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
    } else {
      __pyx_v_dt = ((float)1.0);
    }
    if (values[5]) {
      __pyx_v_search_area_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_search_area_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
    } else {
      __pyx_v_search_area_size = ((int)0);
    }
    __pyx_v_subpixel_method = ((PyObject*)values[6]);
    __pyx_v_sig2noise_method = values[7];
    if (values[8]) {
      __pyx_v_width = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
    } else {
      __pyx_v_width = ((int)2);
    }
    __pyx_v_nfftx = values[9];
    __pyx_v_nffty = values[10];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extended_search_area_piv", 0, 3, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 23, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.extended_search_area_piv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame_a), __pyx_ptype_5numpy_ndarray, 1, "frame_a", 0))) __PYX_ERR(0, 23, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame_b), __pyx_ptype_5numpy_ndarray, 1, "frame_b", 0))) __PYX_ERR(0, 24, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subpixel_method), (&PyString_Type), 1, "subpixel_method", 1))) __PYX_ERR(0, 29, __pyx_L1_error)
  __pyx_r = __pyx_pf_7openpiv_7process_extended_search_area_piv(__pyx_self, __pyx_v_frame_a, __pyx_v_frame_b, __pyx_v_window_size, __pyx_v_overlap, __pyx_v_dt, __pyx_v_search_area_size, __pyx_v_subpixel_method, __pyx_v_sig2noise_method, __pyx_v_width, __pyx_v_nfftx, __pyx_v_nffty);

  /* "openpiv/process.pyx":23
 * 
 * 
 * def extended_search_area_piv( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *                               np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *                               int window_size,
 */

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

static PyObject *__pyx_pf_7openpiv_7process_extended_search_area_piv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_frame_a, PyArrayObject *__pyx_v_frame_b, int __pyx_v_window_size, int __pyx_v_overlap, float __pyx_v_dt, int __pyx_v_search_area_size, PyObject *__pyx_v_subpixel_method, PyObject *__pyx_v_sig2noise_method, int __pyx_v_width, PyObject *__pyx_v_nfftx, PyObject *__pyx_v_nffty) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  int __pyx_v_l;
  int __pyx_v_I;
  int __pyx_v_J;
  float __pyx_v_i_peak;
  float __pyx_v_j_peak;
  int __pyx_v_n_cols;
  int __pyx_v_n_rows;
  PyArrayObject *__pyx_v_window_a = 0;
  PyArrayObject *__pyx_v_search_area = 0;
  PyArrayObject *__pyx_v_corr = 0;
  PyArrayObject *__pyx_v_u = 0;
  PyArrayObject *__pyx_v_v = 0;
  PyArrayObject *__pyx_v_sig2noise = 0;
  PyObject *__pyx_v_c = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_corr;
  __Pyx_Buffer __pyx_pybuffer_corr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_frame_a;
  __Pyx_Buffer __pyx_pybuffer_frame_a;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_frame_b;
  __Pyx_Buffer __pyx_pybuffer_frame_b;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_search_area;
  __Pyx_Buffer __pyx_pybuffer_search_area;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sig2noise;
  __Pyx_Buffer __pyx_pybuffer_sig2noise;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_u;
  __Pyx_Buffer __pyx_pybuffer_u;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
  __Pyx_Buffer __pyx_pybuffer_v;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_window_a;
  __Pyx_Buffer __pyx_pybuffer_window_a;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  PyArrayObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  PyArrayObject *__pyx_t_15 = NULL;
  PyArrayObject *__pyx_t_16 = NULL;
  PyArrayObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  PyObject *(*__pyx_t_20)(PyObject *);
  Py_ssize_t __pyx_t_21;
  PyObject *(*__pyx_t_22)(PyObject *);
  int __pyx_t_23;
  int __pyx_t_24;
  int __pyx_t_25;
  int __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  int __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  PyObject *__pyx_t_40 = NULL;
  PyObject *__pyx_t_41 = NULL;
  PyObject *__pyx_t_42 = NULL;
  float __pyx_t_43;
  float __pyx_t_44;
  double __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  __pyx_t_7openpiv_7process_DTYPEf_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  __Pyx_RefNannySetupContext("extended_search_area_piv", 0);
  __pyx_pybuffer_window_a.pybuffer.buf = NULL;
  __pyx_pybuffer_window_a.refcount = 0;
  __pyx_pybuffernd_window_a.data = NULL;
  __pyx_pybuffernd_window_a.rcbuffer = &__pyx_pybuffer_window_a;
  __pyx_pybuffer_search_area.pybuffer.buf = NULL;
  __pyx_pybuffer_search_area.refcount = 0;
  __pyx_pybuffernd_search_area.data = NULL;
  __pyx_pybuffernd_search_area.rcbuffer = &__pyx_pybuffer_search_area;
  __pyx_pybuffer_corr.pybuffer.buf = NULL;
  __pyx_pybuffer_corr.refcount = 0;
  __pyx_pybuffernd_corr.data = NULL;
  __pyx_pybuffernd_corr.rcbuffer = &__pyx_pybuffer_corr;
  __pyx_pybuffer_u.pybuffer.buf = NULL;
  __pyx_pybuffer_u.refcount = 0;
  __pyx_pybuffernd_u.data = NULL;
  __pyx_pybuffernd_u.rcbuffer = &__pyx_pybuffer_u;
  __pyx_pybuffer_v.pybuffer.buf = NULL;
  __pyx_pybuffer_v.refcount = 0;
  __pyx_pybuffernd_v.data = NULL;
  __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
  __pyx_pybuffer_sig2noise.pybuffer.buf = NULL;
  __pyx_pybuffer_sig2noise.refcount = 0;
  __pyx_pybuffernd_sig2noise.data = NULL;
  __pyx_pybuffernd_sig2noise.rcbuffer = &__pyx_pybuffer_sig2noise;
  __pyx_pybuffer_frame_a.pybuffer.buf = NULL;
  __pyx_pybuffer_frame_a.refcount = 0;
  __pyx_pybuffernd_frame_a.data = NULL;
  __pyx_pybuffernd_frame_a.rcbuffer = &__pyx_pybuffer_frame_a;
  __pyx_pybuffer_frame_b.pybuffer.buf = NULL;
  __pyx_pybuffer_frame_b.refcount = 0;
  __pyx_pybuffernd_frame_b.data = NULL;
  __pyx_pybuffernd_frame_b.rcbuffer = &__pyx_pybuffer_frame_b;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_frame_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_frame_a, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error)
  }
  __pyx_pybuffernd_frame_a.diminfo[0].strides = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_frame_a.diminfo[0].shape = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_frame_a.diminfo[1].strides = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_frame_a.diminfo[1].shape = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_frame_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_frame_b, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 23, __pyx_L1_error)
  }
  __pyx_pybuffernd_frame_b.diminfo[0].strides = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_frame_b.diminfo[0].shape = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_frame_b.diminfo[1].strides = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_frame_b.diminfo[1].shape = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.shape[1];

  /* "openpiv/process.pyx":118
 *     # check the inputs for validity
 * 
 *     if search_area_size == 0:             # <<<<<<<<<<<<<<
 *         search_area_size = window_size
 * 
 */
  __pyx_t_1 = ((__pyx_v_search_area_size == 0) != 0);
  if (__pyx_t_1) {

    /* "openpiv/process.pyx":119
 * 
 *     if search_area_size == 0:
 *         search_area_size = window_size             # <<<<<<<<<<<<<<
 * 
 *     if overlap >= window_size:
 */
    __pyx_v_search_area_size = __pyx_v_window_size;

    /* "openpiv/process.pyx":118
 *     # check the inputs for validity
 * 
 *     if search_area_size == 0:             # <<<<<<<<<<<<<<
 *         search_area_size = window_size
 * 
 */
  }

  /* "openpiv/process.pyx":121
 *         search_area_size = window_size
 * 
 *     if overlap >= window_size:             # <<<<<<<<<<<<<<
 *         raise ValueError('Overlap has to be smaller than the window_size')
 * 
 */
  __pyx_t_1 = ((__pyx_v_overlap >= __pyx_v_window_size) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "openpiv/process.pyx":122
 * 
 *     if overlap >= window_size:
 *         raise ValueError('Overlap has to be smaller than the window_size')             # <<<<<<<<<<<<<<
 * 
 *     if search_area_size < window_size:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 122, __pyx_L1_error)

    /* "openpiv/process.pyx":121
 *         search_area_size = window_size
 * 
 *     if overlap >= window_size:             # <<<<<<<<<<<<<<
 *         raise ValueError('Overlap has to be smaller than the window_size')
 * 
 */
  }

  /* "openpiv/process.pyx":124
 *         raise ValueError('Overlap has to be smaller than the window_size')
 * 
 *     if search_area_size < window_size:             # <<<<<<<<<<<<<<
 *         raise ValueError('Search size cannot be smaller than the window_size')
 * 
 */
  __pyx_t_1 = ((__pyx_v_search_area_size < __pyx_v_window_size) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "openpiv/process.pyx":125
 * 
 *     if search_area_size < window_size:
 *         raise ValueError('Search size cannot be smaller than the window_size')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 125, __pyx_L1_error)

    /* "openpiv/process.pyx":124
 *         raise ValueError('Overlap has to be smaller than the window_size')
 * 
 *     if search_area_size < window_size:             # <<<<<<<<<<<<<<
 *         raise ValueError('Search size cannot be smaller than the window_size')
 * 
 */
  }

  /* "openpiv/process.pyx":128
 * 
 * 
 *     if (window_size > frame_a.shape[0]) or (window_size > frame_a.shape[1]):             # <<<<<<<<<<<<<<
 *         raise ValueError('window size cannot be larger than the image')
 * 
 */
  __pyx_t_3 = ((__pyx_v_window_size > (__pyx_v_frame_a->dimensions[0])) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_window_size > (__pyx_v_frame_a->dimensions[1])) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "openpiv/process.pyx":129
 * 
 *     if (window_size > frame_a.shape[0]) or (window_size > frame_a.shape[1]):
 *         raise ValueError('window size cannot be larger than the image')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 129, __pyx_L1_error)

    /* "openpiv/process.pyx":128
 * 
 * 
 *     if (window_size > frame_a.shape[0]) or (window_size > frame_a.shape[1]):             # <<<<<<<<<<<<<<
 *         raise ValueError('window size cannot be larger than the image')
 * 
 */
  }

  /* "openpiv/process.pyx":144
 * 
 *     # get field shape
 *     n_rows, n_cols = get_field_shape( (frame_a.shape[0], frame_a.shape[1]), window_size, overlap )             # <<<<<<<<<<<<<<
 * 
 *     # define arrays
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_field_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_frame_a->dimensions[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_frame_a->dimensions[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_overlap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 144, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_10);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_10)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 144, __pyx_L1_error)
    __pyx_L10_unpacking_done:;
  }
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_n_rows = __pyx_t_9;
  __pyx_v_n_cols = __pyx_t_12;

  /* "openpiv/process.pyx":147
 * 
 *     # define arrays
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_a = np.zeros([window_size, window_size], dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=2] search_area = np.zeros([search_area_size, search_area_size], dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] corr = np.zeros([search_area_size, search_area_size], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_window_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 147, __pyx_L1_error)
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_window_a.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_window_a = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_window_a.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 147, __pyx_L1_error)
    } else {__pyx_pybuffernd_window_a.diminfo[0].strides = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_window_a.diminfo[0].shape = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_window_a.diminfo[1].strides = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_window_a.diminfo[1].shape = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_13 = 0;
  __pyx_v_window_a = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":148
 *     # define arrays
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_a = np.zeros([window_size, window_size], dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=2] search_area = np.zeros([search_area_size, search_area_size], dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEf_t, ndim=2] corr = np.zeros([search_area_size, search_area_size], dtype=DTYPEf)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_search_area_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_search_area_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 148, __pyx_L1_error)
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_search_area.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_search_area = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_search_area.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 148, __pyx_L1_error)
    } else {__pyx_pybuffernd_search_area.diminfo[0].strides = __pyx_pybuffernd_search_area.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_search_area.diminfo[0].shape = __pyx_pybuffernd_search_area.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_search_area.diminfo[1].strides = __pyx_pybuffernd_search_area.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_search_area.diminfo[1].shape = __pyx_pybuffernd_search_area.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_14 = 0;
  __pyx_v_search_area = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":149
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_a = np.zeros([window_size, window_size], dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=2] search_area = np.zeros([search_area_size, search_area_size], dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] corr = np.zeros([search_area_size, search_area_size], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([n_rows, n_cols], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_search_area_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_search_area_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error)
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_corr.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_corr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_corr.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 149, __pyx_L1_error)
    } else {__pyx_pybuffernd_corr.diminfo[0].strides = __pyx_pybuffernd_corr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_corr.diminfo[0].shape = __pyx_pybuffernd_corr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_corr.diminfo[1].strides = __pyx_pybuffernd_corr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_corr.diminfo[1].shape = __pyx_pybuffernd_corr.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_15 = 0;
  __pyx_v_corr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":151
 *     cdef np.ndarray[DTYPEf_t, ndim=2] corr = np.zeros([search_area_size, search_area_size], dtype=DTYPEf)
 * 
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([n_rows, n_cols], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEf_t, ndim=2] v = np.zeros([n_rows, n_cols], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] sig2noise = np.zeros([n_rows, n_cols], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_cols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 151, __pyx_L1_error)
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_u = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_u.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 151, __pyx_L1_error)
    } else {__pyx_pybuffernd_u.diminfo[0].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u.diminfo[0].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u.diminfo[1].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u.diminfo[1].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_16 = 0;
  __pyx_v_u = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":152
 * 
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([n_rows, n_cols], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] v = np.zeros([n_rows, n_cols], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEf_t, ndim=2] sig2noise = np.zeros([n_rows, n_cols], dtype=DTYPEf)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_cols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 152, __pyx_L1_error)
  __pyx_t_17 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 152, __pyx_L1_error)
    } else {__pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_17 = 0;
  __pyx_v_v = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":153
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([n_rows, n_cols], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] v = np.zeros([n_rows, n_cols], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] sig2noise = np.zeros([n_rows, n_cols], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 * 
 *     # loop over the interrogation windows
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_cols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 153, __pyx_L1_error)
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sig2noise.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_sig2noise = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_sig2noise.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 153, __pyx_L1_error)
    } else {__pyx_pybuffernd_sig2noise.diminfo[0].strides = __pyx_pybuffernd_sig2noise.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sig2noise.diminfo[0].shape = __pyx_pybuffernd_sig2noise.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sig2noise.diminfo[1].strides = __pyx_pybuffernd_sig2noise.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sig2noise.diminfo[1].shape = __pyx_pybuffernd_sig2noise.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_18 = 0;
  __pyx_v_sig2noise = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":157
 *     # loop over the interrogation windows
 *     # i, j are the row, column indices of the top left corner
 *     I = 0             # <<<<<<<<<<<<<<
 *     for i in range( 0, frame_a.shape[0]-window_size+1, window_size-overlap ):
 *         J = 0
 */
  __pyx_v_I = 0;

  /* "openpiv/process.pyx":158
 *     # i, j are the row, column indices of the top left corner
 *     I = 0
 *     for i in range( 0, frame_a.shape[0]-window_size+1, window_size-overlap ):             # <<<<<<<<<<<<<<
 *         J = 0
 *         for j in range( 0, frame_a.shape[1]-window_size+1, window_size-overlap ):
 */
  __pyx_t_2 = __Pyx_PyInt_From_long((((__pyx_v_frame_a->dimensions[0]) - __pyx_v_window_size) + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyInt_From_int((__pyx_v_window_size - __pyx_v_overlap)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10);
  __pyx_t_2 = 0;
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
    __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4); __pyx_t_19 = 0;
    __pyx_t_20 = NULL;
  } else {
    __pyx_t_19 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 158, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (likely(!__pyx_t_20)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_19); __Pyx_INCREF(__pyx_t_10); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      } else {
        if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_19); __Pyx_INCREF(__pyx_t_10); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      }
    } else {
      __pyx_t_10 = __pyx_t_20(__pyx_t_4);
      if (unlikely(!__pyx_t_10)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 158, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_i = __pyx_t_12;

    /* "openpiv/process.pyx":159
 *     I = 0
 *     for i in range( 0, frame_a.shape[0]-window_size+1, window_size-overlap ):
 *         J = 0             # <<<<<<<<<<<<<<
 *         for j in range( 0, frame_a.shape[1]-window_size+1, window_size-overlap ):
 * 
 */
    __pyx_v_J = 0;

    /* "openpiv/process.pyx":160
 *     for i in range( 0, frame_a.shape[0]-window_size+1, window_size-overlap ):
 *         J = 0
 *         for j in range( 0, frame_a.shape[1]-window_size+1, window_size-overlap ):             # <<<<<<<<<<<<<<
 * 
 *             # get interrogation window matrix from frame a
 */
    __pyx_t_10 = __Pyx_PyInt_From_long((((__pyx_v_frame_a->dimensions[1]) - __pyx_v_window_size) + 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_window_size - __pyx_v_overlap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __pyx_t_10 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_21 = 0;
      __pyx_t_22 = NULL;
    } else {
      __pyx_t_21 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_22 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 160, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_22)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_21); __Pyx_INCREF(__pyx_t_2); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_21 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_21); __Pyx_INCREF(__pyx_t_2); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_22(__pyx_t_5);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 160, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_j = __pyx_t_12;

      /* "openpiv/process.pyx":163
 * 
 *             # get interrogation window matrix from frame a
 *             for k in range( window_size ):             # <<<<<<<<<<<<<<
 *                 for l in range( window_size ):
 *                     window_a[k,l] = frame_a[i+k, j+l]
 */
      __pyx_t_12 = __pyx_v_window_size;
      __pyx_t_9 = __pyx_t_12;
      for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_9; __pyx_t_23+=1) {
        __pyx_v_k = __pyx_t_23;

        /* "openpiv/process.pyx":164
 *             # get interrogation window matrix from frame a
 *             for k in range( window_size ):
 *                 for l in range( window_size ):             # <<<<<<<<<<<<<<
 *                     window_a[k,l] = frame_a[i+k, j+l]
 * 
 */
        __pyx_t_24 = __pyx_v_window_size;
        __pyx_t_25 = __pyx_t_24;
        for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
          __pyx_v_l = __pyx_t_26;

          /* "openpiv/process.pyx":165
 *             for k in range( window_size ):
 *                 for l in range( window_size ):
 *                     window_a[k,l] = frame_a[i+k, j+l]             # <<<<<<<<<<<<<<
 * 
 *             # get search area using frame b
 */
          __pyx_t_27 = (__pyx_v_i + __pyx_v_k);
          __pyx_t_28 = (__pyx_v_j + __pyx_v_l);
          __pyx_t_29 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_pybuffernd_frame_a.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_29 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_frame_a.diminfo[0].shape)) __pyx_t_29 = 0;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_frame_a.diminfo[1].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_29 = 1;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_frame_a.diminfo[1].shape)) __pyx_t_29 = 1;
          if (unlikely(__pyx_t_29 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_29);
            __PYX_ERR(0, 165, __pyx_L1_error)
          }
          __pyx_t_30 = __pyx_v_k;
          __pyx_t_31 = __pyx_v_l;
          __pyx_t_29 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_window_a.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_29 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_window_a.diminfo[0].shape)) __pyx_t_29 = 0;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_window_a.diminfo[1].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_29 = 1;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_window_a.diminfo[1].shape)) __pyx_t_29 = 1;
          if (unlikely(__pyx_t_29 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_29);
            __PYX_ERR(0, 165, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_window_a.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_window_a.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_window_a.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_frame_a.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_frame_a.diminfo[1].strides));
        }
      }

      /* "openpiv/process.pyx":168
 * 
 *             # get search area using frame b
 *             for k in range( search_area_size ):             # <<<<<<<<<<<<<<
 *                 for l in range( search_area_size ):
 * 
 */
      __pyx_t_12 = __pyx_v_search_area_size;
      __pyx_t_9 = __pyx_t_12;
      for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_9; __pyx_t_23+=1) {
        __pyx_v_k = __pyx_t_23;

        /* "openpiv/process.pyx":169
 *             # get search area using frame b
 *             for k in range( search_area_size ):
 *                 for l in range( search_area_size ):             # <<<<<<<<<<<<<<
 * 
 *                     # fill with zeros if we are out of the borders
 */
        __pyx_t_24 = __pyx_v_search_area_size;
        __pyx_t_25 = __pyx_t_24;
        for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
          __pyx_v_l = __pyx_t_26;

          /* "openpiv/process.pyx":172
 * 
 *                     # fill with zeros if we are out of the borders
 *                     if i+window_size/2-search_area_size//2+k < 0 or \             # <<<<<<<<<<<<<<
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:
 *                         search_area[k,l] = 0
 */
          __pyx_t_3 = (((((__pyx_v_i + (((double)__pyx_v_window_size) / 2.0)) - __Pyx_div_long(__pyx_v_search_area_size, 2)) + __pyx_v_k) < 0.0) != 0);
          if (!__pyx_t_3) {
          } else {
            __pyx_t_1 = __pyx_t_3;
            goto __pyx_L24_bool_binop_done;
          }

          /* "openpiv/process.pyx":173
 *                     # fill with zeros if we are out of the borders
 *                     if i+window_size/2-search_area_size//2+k < 0 or \
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:             # <<<<<<<<<<<<<<
 *                         search_area[k,l] = 0
 *                     elif j+window_size//2-search_area_size//2+l < 0 or \
 */
          __pyx_t_3 = (((((__pyx_v_i + __Pyx_div_long(__pyx_v_window_size, 2)) - __Pyx_div_long(__pyx_v_search_area_size, 2)) + __pyx_v_k) >= (__pyx_v_frame_b->dimensions[0])) != 0);
          __pyx_t_1 = __pyx_t_3;
          __pyx_L24_bool_binop_done:;

          /* "openpiv/process.pyx":172
 * 
 *                     # fill with zeros if we are out of the borders
 *                     if i+window_size/2-search_area_size//2+k < 0 or \             # <<<<<<<<<<<<<<
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:
 *                         search_area[k,l] = 0
 */
          if (__pyx_t_1) {

            /* "openpiv/process.pyx":174
 *                     if i+window_size/2-search_area_size//2+k < 0 or \
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:
 *                         search_area[k,l] = 0             # <<<<<<<<<<<<<<
 *                     elif j+window_size//2-search_area_size//2+l < 0 or \
 *                         j+window_size//2-search_area_size//2+l >= frame_b.shape[1]:
 */
            __pyx_t_32 = __pyx_v_k;
            __pyx_t_33 = __pyx_v_l;
            __pyx_t_29 = -1;
            if (__pyx_t_32 < 0) {
              __pyx_t_32 += __pyx_pybuffernd_search_area.diminfo[0].shape;
              if (unlikely(__pyx_t_32 < 0)) __pyx_t_29 = 0;
            } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_search_area.diminfo[0].shape)) __pyx_t_29 = 0;
            if (__pyx_t_33 < 0) {
              __pyx_t_33 += __pyx_pybuffernd_search_area.diminfo[1].shape;
              if (unlikely(__pyx_t_33 < 0)) __pyx_t_29 = 1;
            } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_search_area.diminfo[1].shape)) __pyx_t_29 = 1;
            if (unlikely(__pyx_t_29 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_29);
              __PYX_ERR(0, 174, __pyx_L1_error)
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_search_area.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_search_area.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_search_area.diminfo[1].strides) = 0;

            /* "openpiv/process.pyx":172
 * 
 *                     # fill with zeros if we are out of the borders
 *                     if i+window_size/2-search_area_size//2+k < 0 or \             # <<<<<<<<<<<<<<
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:
 *                         search_area[k,l] = 0
 */
            goto __pyx_L23;
          }

          /* "openpiv/process.pyx":175
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:
 *                         search_area[k,l] = 0
 *                     elif j+window_size//2-search_area_size//2+l < 0 or \             # <<<<<<<<<<<<<<
 *                         j+window_size//2-search_area_size//2+l >= frame_b.shape[1]:
 *                         search_area[k,l] = 0
 */
          __pyx_t_3 = (((((__pyx_v_j + __Pyx_div_long(__pyx_v_window_size, 2)) - __Pyx_div_long(__pyx_v_search_area_size, 2)) + __pyx_v_l) < 0) != 0);
          if (!__pyx_t_3) {
          } else {
            __pyx_t_1 = __pyx_t_3;
            goto __pyx_L26_bool_binop_done;
          }

          /* "openpiv/process.pyx":176
 *                         search_area[k,l] = 0
 *                     elif j+window_size//2-search_area_size//2+l < 0 or \
 *                         j+window_size//2-search_area_size//2+l >= frame_b.shape[1]:             # <<<<<<<<<<<<<<
 *                         search_area[k,l] = 0
 *                     else:
 */
          __pyx_t_3 = (((((__pyx_v_j + __Pyx_div_long(__pyx_v_window_size, 2)) - __Pyx_div_long(__pyx_v_search_area_size, 2)) + __pyx_v_l) >= (__pyx_v_frame_b->dimensions[1])) != 0);
          __pyx_t_1 = __pyx_t_3;
          __pyx_L26_bool_binop_done:;

          /* "openpiv/process.pyx":175
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:
 *                         search_area[k,l] = 0
 *                     elif j+window_size//2-search_area_size//2+l < 0 or \             # <<<<<<<<<<<<<<
 *                         j+window_size//2-search_area_size//2+l >= frame_b.shape[1]:
 *                         search_area[k,l] = 0
 */
          if (__pyx_t_1) {

            /* "openpiv/process.pyx":177
 *                     elif j+window_size//2-search_area_size//2+l < 0 or \
 *                         j+window_size//2-search_area_size//2+l >= frame_b.shape[1]:
 *                         search_area[k,l] = 0             # <<<<<<<<<<<<<<
 *                     else:
 *                         search_area[k,l] = frame_b[ i+window_size//2-search_area_size//2+k,
 */
            __pyx_t_34 = __pyx_v_k;
            __pyx_t_35 = __pyx_v_l;
            __pyx_t_29 = -1;
            if (__pyx_t_34 < 0) {
              __pyx_t_34 += __pyx_pybuffernd_search_area.diminfo[0].shape;
              if (unlikely(__pyx_t_34 < 0)) __pyx_t_29 = 0;
            } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_search_area.diminfo[0].shape)) __pyx_t_29 = 0;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_pybuffernd_search_area.diminfo[1].shape;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_29 = 1;
            } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_search_area.diminfo[1].shape)) __pyx_t_29 = 1;
            if (unlikely(__pyx_t_29 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_29);
              __PYX_ERR(0, 177, __pyx_L1_error)
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_search_area.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_search_area.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_search_area.diminfo[1].strides) = 0;

            /* "openpiv/process.pyx":175
 *                         i+window_size//2-search_area_size//2+k >= frame_b.shape[0]:
 *                         search_area[k,l] = 0
 *                     elif j+window_size//2-search_area_size//2+l < 0 or \             # <<<<<<<<<<<<<<
 *                         j+window_size//2-search_area_size//2+l >= frame_b.shape[1]:
 *                         search_area[k,l] = 0
 */
            goto __pyx_L23;
          }

          /* "openpiv/process.pyx":179
 *                         search_area[k,l] = 0
 *                     else:
 *                         search_area[k,l] = frame_b[ i+window_size//2-search_area_size//2+k,             # <<<<<<<<<<<<<<
 *                             j+window_size//2-search_area_size//2+l ]
 * 
 */
          /*else*/ {

            /* "openpiv/process.pyx":180
 *                     else:
 *                         search_area[k,l] = frame_b[ i+window_size//2-search_area_size//2+k,
 *                             j+window_size//2-search_area_size//2+l ]             # <<<<<<<<<<<<<<
 * 
 *             # compute correlation map
 */
            __pyx_t_36 = (((__pyx_v_i + __Pyx_div_long(__pyx_v_window_size, 2)) - __Pyx_div_long(__pyx_v_search_area_size, 2)) + __pyx_v_k);
            __pyx_t_37 = (((__pyx_v_j + __Pyx_div_long(__pyx_v_window_size, 2)) - __Pyx_div_long(__pyx_v_search_area_size, 2)) + __pyx_v_l);
            __pyx_t_29 = -1;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_pybuffernd_frame_b.diminfo[0].shape;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_29 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_frame_b.diminfo[0].shape)) __pyx_t_29 = 0;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_pybuffernd_frame_b.diminfo[1].shape;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_29 = 1;
            } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_frame_b.diminfo[1].shape)) __pyx_t_29 = 1;
            if (unlikely(__pyx_t_29 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_29);
              __PYX_ERR(0, 179, __pyx_L1_error)
            }

            /* "openpiv/process.pyx":179
 *                         search_area[k,l] = 0
 *                     else:
 *                         search_area[k,l] = frame_b[ i+window_size//2-search_area_size//2+k,             # <<<<<<<<<<<<<<
 *                             j+window_size//2-search_area_size//2+l ]
 * 
 */
            __pyx_t_38 = __pyx_v_k;
            __pyx_t_39 = __pyx_v_l;
            __pyx_t_29 = -1;
            if (__pyx_t_38 < 0) {
              __pyx_t_38 += __pyx_pybuffernd_search_area.diminfo[0].shape;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_29 = 0;
            } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_search_area.diminfo[0].shape)) __pyx_t_29 = 0;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_pybuffernd_search_area.diminfo[1].shape;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_29 = 1;
            } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_search_area.diminfo[1].shape)) __pyx_t_29 = 1;
            if (unlikely(__pyx_t_29 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_29);
              __PYX_ERR(0, 179, __pyx_L1_error)
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_search_area.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_search_area.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_search_area.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_frame_b.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_frame_b.diminfo[1].strides));
          }
          __pyx_L23:;
        }
      }

      /* "openpiv/process.pyx":183
 * 
 *             # compute correlation map
 *             if any(window_a.flatten()):             # <<<<<<<<<<<<<<
 *                 corr = correlate_windows( search_area, window_a, nfftx=nfftx, nffty=nffty )
 *                 c = CorrelationFunction( corr )
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_window_a), __pyx_n_s_flatten); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_1) {

        /* "openpiv/process.pyx":184
 *             # compute correlation map
 *             if any(window_a.flatten()):
 *                 corr = correlate_windows( search_area, window_a, nfftx=nfftx, nffty=nffty )             # <<<<<<<<<<<<<<
 *                 c = CorrelationFunction( corr )
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_correlate_windows); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(((PyObject *)__pyx_v_search_area));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_search_area));
        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_search_area));
        __Pyx_INCREF(((PyObject *)__pyx_v_window_a));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_window_a));
        PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_window_a));
        __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_nfftx, __pyx_v_nfftx) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_nffty, __pyx_v_nffty) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 184, __pyx_L1_error)
        __pyx_t_15 = ((PyArrayObject *)__pyx_t_7);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_corr.rcbuffer->pybuffer);
          __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_corr.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
          if (unlikely(__pyx_t_12 < 0)) {
            PyErr_Fetch(&__pyx_t_40, &__pyx_t_41, &__pyx_t_42);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_corr.rcbuffer->pybuffer, (PyObject*)__pyx_v_corr, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_40); Py_XDECREF(__pyx_t_41); Py_XDECREF(__pyx_t_42);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_40, __pyx_t_41, __pyx_t_42);
            }
            __pyx_t_40 = __pyx_t_41 = __pyx_t_42 = 0;
          }
          __pyx_pybuffernd_corr.diminfo[0].strides = __pyx_pybuffernd_corr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_corr.diminfo[0].shape = __pyx_pybuffernd_corr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_corr.diminfo[1].strides = __pyx_pybuffernd_corr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_corr.diminfo[1].shape = __pyx_pybuffernd_corr.rcbuffer->pybuffer.shape[1];
          if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
        }
        __pyx_t_15 = 0;
        __Pyx_DECREF_SET(__pyx_v_corr, ((PyArrayObject *)__pyx_t_7));
        __pyx_t_7 = 0;

        /* "openpiv/process.pyx":185
 *             if any(window_a.flatten()):
 *                 corr = correlate_windows( search_area, window_a, nfftx=nfftx, nffty=nffty )
 *                 c = CorrelationFunction( corr )             # <<<<<<<<<<<<<<
 * 
 *                 # find subpixel approximation of the peak center
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_CorrelationFunction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, ((PyObject *)__pyx_v_corr)) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_corr));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "openpiv/process.pyx":188
 * 
 *                 # find subpixel approximation of the peak center
 *                 i_peak, j_peak = c.subpixel_peak_position( subpixel_method )             # <<<<<<<<<<<<<<
 * 
 *                 # velocities
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_subpixel_peak_position); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_subpixel_method) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_subpixel_method);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
          PyObject* sequence = __pyx_t_7;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 188, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 188, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_6)) goto __pyx_L29_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L29_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_2);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 188, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L30_unpacking_done;
          __pyx_L29_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 188, __pyx_L1_error)
          __pyx_L30_unpacking_done:;
        }
        __pyx_t_43 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_43 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_44 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_44 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_i_peak = __pyx_t_43;
        __pyx_v_j_peak = __pyx_t_44;

        /* "openpiv/process.pyx":191
 * 
 *                 # velocities
 *                 v[I,J] = -( (i_peak - corr.shape[0]/2) - (search_area_size-window_size)/2 ) / dt             # <<<<<<<<<<<<<<
 *                 u[I,J] =  ( (j_peak - corr.shape[0]/2) - (search_area_size-window_size)/2 ) / dt
 * 
 */
        __pyx_t_45 = (-((__pyx_v_i_peak - (((double)(__pyx_v_corr->dimensions[0])) / 2.0)) - (((double)(__pyx_v_search_area_size - __pyx_v_window_size)) / 2.0)));
        if (unlikely(__pyx_v_dt == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 191, __pyx_L1_error)
        }
        __pyx_t_46 = __pyx_v_I;
        __pyx_t_47 = __pyx_v_J;
        __pyx_t_12 = -1;
        if (__pyx_t_46 < 0) {
          __pyx_t_46 += __pyx_pybuffernd_v.diminfo[0].shape;
          if (unlikely(__pyx_t_46 < 0)) __pyx_t_12 = 0;
        } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
        if (__pyx_t_47 < 0) {
          __pyx_t_47 += __pyx_pybuffernd_v.diminfo[1].shape;
          if (unlikely(__pyx_t_47 < 0)) __pyx_t_12 = 1;
        } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
        if (unlikely(__pyx_t_12 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_12);
          __PYX_ERR(0, 191, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_v.diminfo[1].strides) = (__pyx_t_45 / ((double)__pyx_v_dt));

        /* "openpiv/process.pyx":192
 *                 # velocities
 *                 v[I,J] = -( (i_peak - corr.shape[0]/2) - (search_area_size-window_size)/2 ) / dt
 *                 u[I,J] =  ( (j_peak - corr.shape[0]/2) - (search_area_size-window_size)/2 ) / dt             # <<<<<<<<<<<<<<
 * 
 *                 # compute signal to noise ratio
 */
        __pyx_t_45 = ((__pyx_v_j_peak - (((double)(__pyx_v_corr->dimensions[0])) / 2.0)) - (((double)(__pyx_v_search_area_size - __pyx_v_window_size)) / 2.0));
        if (unlikely(__pyx_v_dt == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 192, __pyx_L1_error)
        }
        __pyx_t_48 = __pyx_v_I;
        __pyx_t_49 = __pyx_v_J;
        __pyx_t_12 = -1;
        if (__pyx_t_48 < 0) {
          __pyx_t_48 += __pyx_pybuffernd_u.diminfo[0].shape;
          if (unlikely(__pyx_t_48 < 0)) __pyx_t_12 = 0;
        } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_u.diminfo[0].shape)) __pyx_t_12 = 0;
        if (__pyx_t_49 < 0) {
          __pyx_t_49 += __pyx_pybuffernd_u.diminfo[1].shape;
          if (unlikely(__pyx_t_49 < 0)) __pyx_t_12 = 1;
        } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_u.diminfo[1].shape)) __pyx_t_12 = 1;
        if (unlikely(__pyx_t_12 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_12);
          __PYX_ERR(0, 192, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_u.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_u.diminfo[1].strides) = (__pyx_t_45 / ((double)__pyx_v_dt));

        /* "openpiv/process.pyx":195
 * 
 *                 # compute signal to noise ratio
 *                 if sig2noise_method:             # <<<<<<<<<<<<<<
 *                     sig2noise[I,J] = c.sig2noise_ratio( sig2noise_method, width )
 *             else:
 */
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sig2noise_method); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
        if (__pyx_t_1) {

          /* "openpiv/process.pyx":196
 *                 # compute signal to noise ratio
 *                 if sig2noise_method:
 *                     sig2noise[I,J] = c.sig2noise_ratio( sig2noise_method, width )             # <<<<<<<<<<<<<<
 *             else:
 *                 v[I,J] = 0.0
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_sig2noise_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = NULL;
          __pyx_t_12 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_12 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_sig2noise_method, __pyx_t_6};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_sig2noise_method, __pyx_t_6};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          {
            __pyx_t_8 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            if (__pyx_t_10) {
              __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
            }
            __Pyx_INCREF(__pyx_v_sig2noise_method);
            __Pyx_GIVEREF(__pyx_v_sig2noise_method);
            PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_12, __pyx_v_sig2noise_method);
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_12, __pyx_t_6);
            __pyx_t_6 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_50 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_50 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_51 = __pyx_v_I;
          __pyx_t_52 = __pyx_v_J;
          __pyx_t_12 = -1;
          if (__pyx_t_51 < 0) {
            __pyx_t_51 += __pyx_pybuffernd_sig2noise.diminfo[0].shape;
            if (unlikely(__pyx_t_51 < 0)) __pyx_t_12 = 0;
          } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_sig2noise.diminfo[0].shape)) __pyx_t_12 = 0;
          if (__pyx_t_52 < 0) {
            __pyx_t_52 += __pyx_pybuffernd_sig2noise.diminfo[1].shape;
            if (unlikely(__pyx_t_52 < 0)) __pyx_t_12 = 1;
          } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_sig2noise.diminfo[1].shape)) __pyx_t_12 = 1;
          if (unlikely(__pyx_t_12 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_12);
            __PYX_ERR(0, 196, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_sig2noise.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_sig2noise.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_sig2noise.diminfo[1].strides) = __pyx_t_50;

          /* "openpiv/process.pyx":195
 * 
 *                 # compute signal to noise ratio
 *                 if sig2noise_method:             # <<<<<<<<<<<<<<
 *                     sig2noise[I,J] = c.sig2noise_ratio( sig2noise_method, width )
 *             else:
 */
        }

        /* "openpiv/process.pyx":183
 * 
 *             # compute correlation map
 *             if any(window_a.flatten()):             # <<<<<<<<<<<<<<
 *                 corr = correlate_windows( search_area, window_a, nfftx=nfftx, nffty=nffty )
 *                 c = CorrelationFunction( corr )
 */
        goto __pyx_L28;
      }

      /* "openpiv/process.pyx":198
 *                     sig2noise[I,J] = c.sig2noise_ratio( sig2noise_method, width )
 *             else:
 *                 v[I,J] = 0.0             # <<<<<<<<<<<<<<
 *                 u[I,J] = 0.0
 *                 # compute signal to noise ratio
 */
      /*else*/ {
        __pyx_t_53 = __pyx_v_I;
        __pyx_t_54 = __pyx_v_J;
        __pyx_t_12 = -1;
        if (__pyx_t_53 < 0) {
          __pyx_t_53 += __pyx_pybuffernd_v.diminfo[0].shape;
          if (unlikely(__pyx_t_53 < 0)) __pyx_t_12 = 0;
        } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
        if (__pyx_t_54 < 0) {
          __pyx_t_54 += __pyx_pybuffernd_v.diminfo[1].shape;
          if (unlikely(__pyx_t_54 < 0)) __pyx_t_12 = 1;
        } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
        if (unlikely(__pyx_t_12 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_12);
          __PYX_ERR(0, 198, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_v.diminfo[1].strides) = 0.0;

        /* "openpiv/process.pyx":199
 *             else:
 *                 v[I,J] = 0.0
 *                 u[I,J] = 0.0             # <<<<<<<<<<<<<<
 *                 # compute signal to noise ratio
 *                 if sig2noise_method:
 */
        __pyx_t_55 = __pyx_v_I;
        __pyx_t_56 = __pyx_v_J;
        __pyx_t_12 = -1;
        if (__pyx_t_55 < 0) {
          __pyx_t_55 += __pyx_pybuffernd_u.diminfo[0].shape;
          if (unlikely(__pyx_t_55 < 0)) __pyx_t_12 = 0;
        } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_u.diminfo[0].shape)) __pyx_t_12 = 0;
        if (__pyx_t_56 < 0) {
          __pyx_t_56 += __pyx_pybuffernd_u.diminfo[1].shape;
          if (unlikely(__pyx_t_56 < 0)) __pyx_t_12 = 1;
        } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_u.diminfo[1].shape)) __pyx_t_12 = 1;
        if (unlikely(__pyx_t_12 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_12);
          __PYX_ERR(0, 199, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_u.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_u.diminfo[1].strides) = 0.0;

        /* "openpiv/process.pyx":201
 *                 u[I,J] = 0.0
 *                 # compute signal to noise ratio
 *                 if sig2noise_method:             # <<<<<<<<<<<<<<
 *                     sig2noise[I,J] = np.inf
 * 
 */
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sig2noise_method); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
        if (__pyx_t_1) {

          /* "openpiv/process.pyx":202
 *                 # compute signal to noise ratio
 *                 if sig2noise_method:
 *                     sig2noise[I,J] = np.inf             # <<<<<<<<<<<<<<
 * 
 *             # go to next vector
 */
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_50 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_50 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_57 = __pyx_v_I;
          __pyx_t_58 = __pyx_v_J;
          __pyx_t_12 = -1;
          if (__pyx_t_57 < 0) {
            __pyx_t_57 += __pyx_pybuffernd_sig2noise.diminfo[0].shape;
            if (unlikely(__pyx_t_57 < 0)) __pyx_t_12 = 0;
          } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_sig2noise.diminfo[0].shape)) __pyx_t_12 = 0;
          if (__pyx_t_58 < 0) {
            __pyx_t_58 += __pyx_pybuffernd_sig2noise.diminfo[1].shape;
            if (unlikely(__pyx_t_58 < 0)) __pyx_t_12 = 1;
          } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_sig2noise.diminfo[1].shape)) __pyx_t_12 = 1;
          if (unlikely(__pyx_t_12 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_12);
            __PYX_ERR(0, 202, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_sig2noise.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_sig2noise.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_sig2noise.diminfo[1].strides) = __pyx_t_50;

          /* "openpiv/process.pyx":201
 *                 u[I,J] = 0.0
 *                 # compute signal to noise ratio
 *                 if sig2noise_method:             # <<<<<<<<<<<<<<
 *                     sig2noise[I,J] = np.inf
 * 
 */
        }
      }
      __pyx_L28:;

      /* "openpiv/process.pyx":205
 * 
 *             # go to next vector
 *             J = J + 1             # <<<<<<<<<<<<<<
 * 
 *         # go to next vector
 */
      __pyx_v_J = (__pyx_v_J + 1);

      /* "openpiv/process.pyx":160
 *     for i in range( 0, frame_a.shape[0]-window_size+1, window_size-overlap ):
 *         J = 0
 *         for j in range( 0, frame_a.shape[1]-window_size+1, window_size-overlap ):             # <<<<<<<<<<<<<<
 * 
 *             # get interrogation window matrix from frame a
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "openpiv/process.pyx":208
 * 
 *         # go to next vector
 *         I = I + 1             # <<<<<<<<<<<<<<
 * 
 *     if sig2noise_method:
 */
    __pyx_v_I = (__pyx_v_I + 1);

    /* "openpiv/process.pyx":158
 *     # i, j are the row, column indices of the top left corner
 *     I = 0
 *     for i in range( 0, frame_a.shape[0]-window_size+1, window_size-overlap ):             # <<<<<<<<<<<<<<
 *         J = 0
 *         for j in range( 0, frame_a.shape[1]-window_size+1, window_size-overlap ):
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "openpiv/process.pyx":210
 *         I = I + 1
 * 
 *     if sig2noise_method:             # <<<<<<<<<<<<<<
 *         return u, v, sig2noise
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sig2noise_method); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "openpiv/process.pyx":211
 * 
 *     if sig2noise_method:
 *         return u, v, sig2noise             # <<<<<<<<<<<<<<
 *     else:
 *         return u, v
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_u));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_u));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_u));
    __Pyx_INCREF(((PyObject *)__pyx_v_v));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_v));
    __Pyx_INCREF(((PyObject *)__pyx_v_sig2noise));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_sig2noise));
    PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_sig2noise));
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":210
 *         I = I + 1
 * 
 *     if sig2noise_method:             # <<<<<<<<<<<<<<
 *         return u, v, sig2noise
 *     else:
 */
  }

  /* "openpiv/process.pyx":213
 *         return u, v, sig2noise
 *     else:
 *         return u, v             # <<<<<<<<<<<<<<
 * 
 * class CorrelationFunction( ):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_u));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_u));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_u));
    __Pyx_INCREF(((PyObject *)__pyx_v_v));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_v));
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "openpiv/process.pyx":23
 * 
 * 
 * def extended_search_area_piv( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *                               np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *                               int window_size,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_corr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_a.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_b.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_search_area.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sig2noise.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_window_a.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("openpiv.process.extended_search_area_piv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_corr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_a.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_b.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_search_area.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sig2noise.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_window_a.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_window_a);
  __Pyx_XDECREF((PyObject *)__pyx_v_search_area);
  __Pyx_XDECREF((PyObject *)__pyx_v_corr);
  __Pyx_XDECREF((PyObject *)__pyx_v_u);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF((PyObject *)__pyx_v_sig2noise);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":216
 * 
 * class CorrelationFunction( ):
 *     def __init__ ( self, corr ):             # <<<<<<<<<<<<<<
 *         """A class representing a cross correlation function.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_19CorrelationFunction___init__[] = "A class representing a cross correlation function.\n        \n        Parameters\n        ----------\n        corr : 2d np.ndarray\n            the correlation function array\n        \n        ";
static PyMethodDef __pyx_mdef_7openpiv_7process_19CorrelationFunction_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_19CorrelationFunction_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_19CorrelationFunction___init__};
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_corr = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_corr,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_corr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 216, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 216, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_corr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 216, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_19CorrelationFunction___init__(__pyx_self, __pyx_v_self, __pyx_v_corr);

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

static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_corr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "openpiv/process.pyx":225
 * 
 *         """
 *         self.data = corr             # <<<<<<<<<<<<<<
 *         self.shape = self.data.shape
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, __pyx_v_corr) < 0) __PYX_ERR(0, 225, __pyx_L1_error)

  /* "openpiv/process.pyx":226
 *         """
 *         self.data = corr
 *         self.shape = self.data.shape             # <<<<<<<<<<<<<<
 * 
 *         # get first peak
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_2) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":229
 * 
 *         # get first peak
 *         self.peak1, self.corr_max1 = self._find_peak( self.data )             # <<<<<<<<<<<<<<
 * 
 *     def _find_peak ( self, array ):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_peak); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 229, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 229, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_peak1, __pyx_t_1) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_corr_max1, __pyx_t_3) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "openpiv/process.pyx":216
 * 
 * class CorrelationFunction( ):
 *     def __init__ ( self, corr ):             # <<<<<<<<<<<<<<
 *         """A class representing a cross correlation function.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":231
 *         self.peak1, self.corr_max1 = self._find_peak( self.data )
 * 
 *     def _find_peak ( self, array ):             # <<<<<<<<<<<<<<
 *         """Find row and column indices of the highest peak in an array."""
 *         ind = array.argmax()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_3_find_peak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_19CorrelationFunction_2_find_peak[] = "Find row and column indices of the highest peak in an array.";
static PyMethodDef __pyx_mdef_7openpiv_7process_19CorrelationFunction_3_find_peak = {"_find_peak", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_19CorrelationFunction_3_find_peak, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_19CorrelationFunction_2_find_peak};
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_3_find_peak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_array = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_peak (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_array,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_find_peak", 1, 2, 2, 1); __PYX_ERR(0, 231, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_find_peak") < 0)) __PYX_ERR(0, 231, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_array = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_find_peak", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction._find_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_19CorrelationFunction_2_find_peak(__pyx_self, __pyx_v_self, __pyx_v_array);

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

static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_2_find_peak(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_array) {
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_find_peak", 0);

  /* "openpiv/process.pyx":233
 *     def _find_peak ( self, array ):
 *         """Find row and column indices of the highest peak in an array."""
 *         ind = array.argmax()             # <<<<<<<<<<<<<<
 *         s = array.shape[1]
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_argmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":234
 *         """Find row and column indices of the highest peak in an array."""
 *         ind = array.argmax()
 *         s = array.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         i = ind // s
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_s = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":236
 *         s = array.shape[1]
 * 
 *         i = ind // s             # <<<<<<<<<<<<<<
 *         j = ind %  s
 * 
 */
  __pyx_t_2 = PyNumber_FloorDivide(__pyx_v_ind, __pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_i = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":237
 * 
 *         i = ind // s
 *         j = ind %  s             # <<<<<<<<<<<<<<
 * 
 *         return  (i, j),  array.max()
 */
  __pyx_t_2 = PyNumber_Remainder(__pyx_v_ind, __pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_j = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":239
 *         j = ind %  s
 * 
 *         return  (i, j),  array.max()             # <<<<<<<<<<<<<<
 * 
 *     def _find_second_peak ( self, width ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_i);
  __Pyx_GIVEREF(__pyx_v_i);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
  __Pyx_INCREF(__pyx_v_j);
  __Pyx_GIVEREF(__pyx_v_j);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_j);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":231
 *         self.peak1, self.corr_max1 = self._find_peak( self.data )
 * 
 *     def _find_peak ( self, array ):             # <<<<<<<<<<<<<<
 *         """Find row and column indices of the highest peak in an array."""
 *         ind = array.argmax()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction._find_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":241
 *         return  (i, j),  array.max()
 * 
 *     def _find_second_peak ( self, width ):             # <<<<<<<<<<<<<<
 *         """
 *         Find the value of the second largest peak.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_5_find_second_peak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_19CorrelationFunction_4_find_second_peak[] = "\n        Find the value of the second largest peak.\n        \n        The second largest peak is the height of the peak in \n        the region outside a ``width * width`` submatrix around \n        the first correlation peak.\n        \n        Parameters\n        ----------\n        width : int\n            the half size of the region around the first correlation \n            peak to ignore for finding the second peak.\n              \n        Returns\n        -------\n        i, j : two elements tuple\n            the row, column index of the second correlation peak.\n            \n        corr_max2 : int\n            the value of the second correlation peak.\n        \n        ";
static PyMethodDef __pyx_mdef_7openpiv_7process_19CorrelationFunction_5_find_second_peak = {"_find_second_peak", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_19CorrelationFunction_5_find_second_peak, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_19CorrelationFunction_4_find_second_peak};
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_5_find_second_peak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_second_peak (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_width,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_find_second_peak", 1, 2, 2, 1); __PYX_ERR(0, 241, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_find_second_peak") < 0)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_find_second_peak", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction._find_second_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_19CorrelationFunction_4_find_second_peak(__pyx_self, __pyx_v_self, __pyx_v_width);

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

static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_4_find_second_peak(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width) {
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_v_iini = NULL;
  PyObject *__pyx_v_ifin = NULL;
  PyObject *__pyx_v_jini = NULL;
  PyObject *__pyx_v_jfin = NULL;
  PyObject *__pyx_v_peak = NULL;
  PyObject *__pyx_v_corr_max2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  int __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("_find_second_peak", 0);

  /* "openpiv/process.pyx":265
 *         """
 *         # create a masked view of the self.data array
 *         tmp = self.data.view(ma.MaskedArray)             # <<<<<<<<<<<<<<
 * 
 *         # set width x width square submatrix around the first correlation peak as masked.
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MaskedArray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_tmp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":269
 *         # set width x width square submatrix around the first correlation peak as masked.
 *         # Before check if we are not too close to the boundaries, otherwise we have negative indices
 *         iini = max(0, self.peak1[0]-width)             # <<<<<<<<<<<<<<
 *         ifin = min(self.peak1[0]+width+1, self.data.shape[0])
 *         jini = max(0, self.peak1[1]-width)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_iini = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":270
 *         # Before check if we are not too close to the boundaries, otherwise we have negative indices
 *         iini = max(0, self.peak1[0]-width)
 *         ifin = min(self.peak1[0]+width+1, self.data.shape[0])             # <<<<<<<<<<<<<<
 *         jini = max(0, self.peak1[1]-width)
 *         jfin = min(self.peak1[1]+width+1, self.data.shape[1])
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ifin = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":271
 *         iini = max(0, self.peak1[0]-width)
 *         ifin = min(self.peak1[0]+width+1, self.data.shape[0])
 *         jini = max(0, self.peak1[1]-width)             # <<<<<<<<<<<<<<
 *         jfin = min(self.peak1[1]+width+1, self.data.shape[1])
 *         tmp[ iini:ifin, jini:jfin ] = ma.masked
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_jini = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":272
 *         ifin = min(self.peak1[0]+width+1, self.data.shape[0])
 *         jini = max(0, self.peak1[1]-width)
 *         jfin = min(self.peak1[1]+width+1, self.data.shape[1])             # <<<<<<<<<<<<<<
 *         tmp[ iini:ifin, jini:jfin ] = ma.masked
 *         peak, corr_max2 = self._find_peak( tmp )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_jfin = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":273
 *         jini = max(0, self.peak1[1]-width)
 *         jfin = min(self.peak1[1]+width+1, self.data.shape[1])
 *         tmp[ iini:ifin, jini:jfin ] = ma.masked             # <<<<<<<<<<<<<<
 *         peak, corr_max2 = self._find_peak( tmp )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ma); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_masked); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PySlice_New(__pyx_v_iini, __pyx_v_ifin, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PySlice_New(__pyx_v_jini, __pyx_v_jfin, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_tmp, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "openpiv/process.pyx":274
 *         jfin = min(self.peak1[1]+width+1, self.data.shape[1])
 *         tmp[ iini:ifin, jini:jfin ] = ma.masked
 *         peak, corr_max2 = self._find_peak( tmp )             # <<<<<<<<<<<<<<
 * 
 *         return peak, corr_max2
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_peak); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_tmp);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 274, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_1), 2) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 274, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_peak = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_corr_max2 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "openpiv/process.pyx":276
 *         peak, corr_max2 = self._find_peak( tmp )
 * 
 *         return peak, corr_max2             # <<<<<<<<<<<<<<
 * 
 *     def subpixel_peak_position( self, method='gaussian' ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_peak);
  __Pyx_GIVEREF(__pyx_v_peak);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_peak);
  __Pyx_INCREF(__pyx_v_corr_max2);
  __Pyx_GIVEREF(__pyx_v_corr_max2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_corr_max2);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":241
 *         return  (i, j),  array.max()
 * 
 *     def _find_second_peak ( self, width ):             # <<<<<<<<<<<<<<
 *         """
 *         Find the value of the second largest peak.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction._find_second_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XDECREF(__pyx_v_iini);
  __Pyx_XDECREF(__pyx_v_ifin);
  __Pyx_XDECREF(__pyx_v_jini);
  __Pyx_XDECREF(__pyx_v_jfin);
  __Pyx_XDECREF(__pyx_v_peak);
  __Pyx_XDECREF(__pyx_v_corr_max2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":278
 *         return peak, corr_max2
 * 
 *     def subpixel_peak_position( self, method='gaussian' ):             # <<<<<<<<<<<<<<
 *         """
 *         Find subpixel approximation of the correlation peak.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_7subpixel_peak_position(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_19CorrelationFunction_6subpixel_peak_position[] = "\n        Find subpixel approximation of the correlation peak.\n        \n        This function returns a subpixels approximation of the correlation\n        peak by using one of the several methods available. \n        \n        Parameters\n        ----------            \n        method : string\n             one of the following methods to estimate subpixel location of the peak: \n             'centroid' [replaces default if correlation map is negative], \n             'gaussian' [default if correlation map is positive], \n             'parabolic'.\n             \n        Returns\n        -------\n        subp_peak_position : two elements tuple\n            the fractional row and column indices for the sub-pixel\n            approximation of the correlation peak.\n        ";
static PyMethodDef __pyx_mdef_7openpiv_7process_19CorrelationFunction_7subpixel_peak_position = {"subpixel_peak_position", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_19CorrelationFunction_7subpixel_peak_position, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_19CorrelationFunction_6subpixel_peak_position};
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_7subpixel_peak_position(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("subpixel_peak_position (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_method,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_n_s_gaussian));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subpixel_peak_position") < 0)) __PYX_ERR(0, 278, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_method = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("subpixel_peak_position", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 278, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction.subpixel_peak_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_19CorrelationFunction_6subpixel_peak_position(__pyx_self, __pyx_v_self, __pyx_v_method);

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

static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_6subpixel_peak_position(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_cl = NULL;
  PyObject *__pyx_v_cr = NULL;
  PyObject *__pyx_v_cd = NULL;
  PyObject *__pyx_v_cu = NULL;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_v_subp_peak_position = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("subpixel_peak_position", 0);
  __Pyx_INCREF(__pyx_v_method);

  /* "openpiv/process.pyx":301
 * 
 *         # the peak and its neighbours: left, right, down, up
 *         try:             # <<<<<<<<<<<<<<
 *             c  = self.data[self.peak1[0]  , self.peak1[1]  ]
 *             cl = self.data[self.peak1[0]-1, self.peak1[1]  ]
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "openpiv/process.pyx":302
 *         # the peak and its neighbours: left, right, down, up
 *         try:
 *             c  = self.data[self.peak1[0]  , self.peak1[1]  ]             # <<<<<<<<<<<<<<
 *             cl = self.data[self.peak1[0]-1, self.peak1[1]  ]
 *             cr = self.data[self.peak1[0]+1, self.peak1[1]  ]
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_c = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "openpiv/process.pyx":303
 *         try:
 *             c  = self.data[self.peak1[0]  , self.peak1[1]  ]
 *             cl = self.data[self.peak1[0]-1, self.peak1[1]  ]             # <<<<<<<<<<<<<<
 *             cr = self.data[self.peak1[0]+1, self.peak1[1]  ]
 *             cd = self.data[self.peak1[0]  , self.peak1[1]-1]
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cl = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "openpiv/process.pyx":304
 *             c  = self.data[self.peak1[0]  , self.peak1[1]  ]
 *             cl = self.data[self.peak1[0]-1, self.peak1[1]  ]
 *             cr = self.data[self.peak1[0]+1, self.peak1[1]  ]             # <<<<<<<<<<<<<<
 *             cd = self.data[self.peak1[0]  , self.peak1[1]-1]
 *             cu = self.data[self.peak1[0]  , self.peak1[1]+1]
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_cr = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "openpiv/process.pyx":305
 *             cl = self.data[self.peak1[0]-1, self.peak1[1]  ]
 *             cr = self.data[self.peak1[0]+1, self.peak1[1]  ]
 *             cd = self.data[self.peak1[0]  , self.peak1[1]-1]             # <<<<<<<<<<<<<<
 *             cu = self.data[self.peak1[0]  , self.peak1[1]+1]
 *         except IndexError:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cd = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "openpiv/process.pyx":306
 *             cr = self.data[self.peak1[0]+1, self.peak1[1]  ]
 *             cd = self.data[self.peak1[0]  , self.peak1[1]-1]
 *             cu = self.data[self.peak1[0]  , self.peak1[1]+1]             # <<<<<<<<<<<<<<
 *         except IndexError:
 *             # if the peak is near the border do not
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_cu = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "openpiv/process.pyx":301
 * 
 *         # the peak and its neighbours: left, right, down, up
 *         try:             # <<<<<<<<<<<<<<
 *             c  = self.data[self.peak1[0]  , self.peak1[1]  ]
 *             cl = self.data[self.peak1[0]-1, self.peak1[1]  ]
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "openpiv/process.pyx":307
 *             cd = self.data[self.peak1[0]  , self.peak1[1]-1]
 *             cu = self.data[self.peak1[0]  , self.peak1[1]+1]
 *         except IndexError:             # <<<<<<<<<<<<<<
 *             # if the peak is near the border do not
 *             # do subpixel approximation
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("openpiv.process.CorrelationFunction.subpixel_peak_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 307, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "openpiv/process.pyx":310
 *             # if the peak is near the border do not
 *             # do subpixel approximation
 *             return self.peak1             # <<<<<<<<<<<<<<
 * 
 *         # if all zero or some is NaN, don't do sub-pixel search:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "openpiv/process.pyx":301
 * 
 *         # the peak and its neighbours: left, right, down, up
 *         try:             # <<<<<<<<<<<<<<
 *             c  = self.data[self.peak1[0]  , self.peak1[1]  ]
 *             cl = self.data[self.peak1[0]-1, self.peak1[1]  ]
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "openpiv/process.pyx":313
 * 
 *         # if all zero or some is NaN, don't do sub-pixel search:
 *         tmp = np.array([c,cl,cr,cd,cu])             # <<<<<<<<<<<<<<
 *         if np.any( np.isnan(tmp) ) or np.all ( tmp == 0 ):
 *             return self.peak1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_c);
  __Pyx_GIVEREF(__pyx_v_c);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_c);
  __Pyx_INCREF(__pyx_v_cl);
  __Pyx_GIVEREF(__pyx_v_cl);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_v_cl);
  __Pyx_INCREF(__pyx_v_cr);
  __Pyx_GIVEREF(__pyx_v_cr);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_v_cr);
  __Pyx_INCREF(__pyx_v_cd);
  __Pyx_GIVEREF(__pyx_v_cd);
  PyList_SET_ITEM(__pyx_t_6, 3, __pyx_v_cd);
  __Pyx_INCREF(__pyx_v_cu);
  __Pyx_GIVEREF(__pyx_v_cu);
  PyList_SET_ITEM(__pyx_t_6, 4, __pyx_v_cu);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_tmp = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "openpiv/process.pyx":314
 *         # if all zero or some is NaN, don't do sub-pixel search:
 *         tmp = np.array([c,cl,cr,cd,cu])
 *         if np.any( np.isnan(tmp) ) or np.all ( tmp == 0 ):             # <<<<<<<<<<<<<<
 *             return self.peak1
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_any); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_5, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_tmp);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_11) {
  } else {
    __pyx_t_9 = __pyx_t_11;
    goto __pyx_L12_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_all); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_tmp, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __pyx_t_11;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_9) {

    /* "openpiv/process.pyx":315
 *         tmp = np.array([c,cl,cr,cd,cu])
 *         if np.any( np.isnan(tmp) ) or np.all ( tmp == 0 ):
 *             return self.peak1             # <<<<<<<<<<<<<<
 * 
 *         # if correlation is negative near the peak, fall back
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":314
 *         # if all zero or some is NaN, don't do sub-pixel search:
 *         tmp = np.array([c,cl,cr,cd,cu])
 *         if np.any( np.isnan(tmp) ) or np.all ( tmp == 0 ):             # <<<<<<<<<<<<<<
 *             return self.peak1
 * 
 */
  }

  /* "openpiv/process.pyx":319
 *         # if correlation is negative near the peak, fall back
 *         # to a centroid approximation
 *         if np.any ( tmp  < 0 ) and method == 'gaussian':             # <<<<<<<<<<<<<<
 *             method = 'centroid'
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_any); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_tmp, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_11) {
  } else {
    __pyx_t_9 = __pyx_t_11;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_gaussian, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_11;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_9) {

    /* "openpiv/process.pyx":320
 *         # to a centroid approximation
 *         if np.any ( tmp  < 0 ) and method == 'gaussian':
 *             method = 'centroid'             # <<<<<<<<<<<<<<
 * 
 *         # choose method
 */
    __Pyx_INCREF(__pyx_n_s_centroid);
    __Pyx_DECREF_SET(__pyx_v_method, __pyx_n_s_centroid);

    /* "openpiv/process.pyx":319
 *         # if correlation is negative near the peak, fall back
 *         # to a centroid approximation
 *         if np.any ( tmp  < 0 ) and method == 'gaussian':             # <<<<<<<<<<<<<<
 *             method = 'centroid'
 * 
 */
  }

  /* "openpiv/process.pyx":323
 * 
 *         # choose method
 *         if method == 'centroid':             # <<<<<<<<<<<<<<
 *             subp_peak_position = (((self.peak1[0]-1)*cl+self.peak1[0]*c+(self.peak1[0]+1)*cr)/(cl+c+cr),
 *                                 ((self.peak1[1]-1)*cd+self.peak1[1]*c+(self.peak1[1]+1)*cu)/(cd+c+cu))
 */
  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_centroid, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "openpiv/process.pyx":324
 *         # choose method
 *         if method == 'centroid':
 *             subp_peak_position = (((self.peak1[0]-1)*cl+self.peak1[0]*c+(self.peak1[0]+1)*cr)/(cl+c+cr),             # <<<<<<<<<<<<<<
 *                                 ((self.peak1[1]-1)*cd+self.peak1[1]*c+(self.peak1[1]+1)*cu)/(cd+c+cu))
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_v_cl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_c); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_v_cr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_v_cl, __pyx_v_c); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_v_cr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "openpiv/process.pyx":325
 *         if method == 'centroid':
 *             subp_peak_position = (((self.peak1[0]-1)*cl+self.peak1[0]*c+(self.peak1[0]+1)*cr)/(cl+c+cr),
 *                                 ((self.peak1[1]-1)*cd+self.peak1[1]*c+(self.peak1[1]+1)*cu)/(cd+c+cu))             # <<<<<<<<<<<<<<
 * 
 *         elif method == 'gaussian':
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_cd); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Multiply(__pyx_t_10, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_cu); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_v_cd, __pyx_v_c); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_v_cu); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "openpiv/process.pyx":324
 *         # choose method
 *         if method == 'centroid':
 *             subp_peak_position = (((self.peak1[0]-1)*cl+self.peak1[0]*c+(self.peak1[0]+1)*cr)/(cl+c+cr),             # <<<<<<<<<<<<<<
 *                                 ((self.peak1[1]-1)*cd+self.peak1[1]*c+(self.peak1[1]+1)*cu)/(cd+c+cu))
 * 
 */
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_v_subp_peak_position = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "openpiv/process.pyx":323
 * 
 *         # choose method
 *         if method == 'centroid':             # <<<<<<<<<<<<<<
 *             subp_peak_position = (((self.peak1[0]-1)*cl+self.peak1[0]*c+(self.peak1[0]+1)*cr)/(cl+c+cr),
 *                                 ((self.peak1[1]-1)*cd+self.peak1[1]*c+(self.peak1[1]+1)*cu)/(cd+c+cu))
 */
    goto __pyx_L17;
  }

  /* "openpiv/process.pyx":327
 *                                 ((self.peak1[1]-1)*cd+self.peak1[1]*c+(self.peak1[1]+1)*cu)/(cd+c+cu))
 * 
 *         elif method == 'gaussian':             # <<<<<<<<<<<<<<
 *             subp_peak_position = (self.peak1[0] + ( (np.log(cl)-np.log(cr) )/( 2*np.log(cl) - 4*np.log(c) + 2*np.log(cr) )),
 *                                 self.peak1[1] + ( (np.log(cd)-np.log(cu) )/( 2*np.log(cd) - 4*np.log(c) + 2*np.log(cu) )))
 */
  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_gaussian, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 327, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "openpiv/process.pyx":328
 * 
 *         elif method == 'gaussian':
 *             subp_peak_position = (self.peak1[0] + ( (np.log(cl)-np.log(cr) )/( 2*np.log(cl) - 4*np.log(c) + 2*np.log(cr) )),             # <<<<<<<<<<<<<<
 *                                 self.peak1[1] + ( (np.log(cd)-np.log(cu) )/( 2*np.log(cd) - 4*np.log(c) + 2*np.log(cu) )))
 * 
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_cl) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_cl);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_cr) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_cr);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_v_cl) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cl);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_int_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_log); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_10, __pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_c);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Multiply(__pyx_int_4, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_12 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_6, __pyx_v_cr) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_cr);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "openpiv/process.pyx":329
 *         elif method == 'gaussian':
 *             subp_peak_position = (self.peak1[0] + ( (np.log(cl)-np.log(cr) )/( 2*np.log(cl) - 4*np.log(c) + 2*np.log(cr) )),
 *                                 self.peak1[1] + ( (np.log(cd)-np.log(cu) )/( 2*np.log(cd) - 4*np.log(c) + 2*np.log(cu) )))             # <<<<<<<<<<<<<<
 * 
 *         elif method == 'parabolic':
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_10 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_cd) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_cd);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_cu) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cu);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_v_cd) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_cd);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_log); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_10, __pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_c);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Multiply(__pyx_int_4, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_13 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_5, __pyx_v_cu) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_cu);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "openpiv/process.pyx":328
 * 
 *         elif method == 'gaussian':
 *             subp_peak_position = (self.peak1[0] + ( (np.log(cl)-np.log(cr) )/( 2*np.log(cl) - 4*np.log(c) + 2*np.log(cr) )),             # <<<<<<<<<<<<<<
 *                                 self.peak1[1] + ( (np.log(cd)-np.log(cu) )/( 2*np.log(cd) - 4*np.log(c) + 2*np.log(cu) )))
 * 
 */
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_13);
    __pyx_t_12 = 0;
    __pyx_t_13 = 0;
    __pyx_v_subp_peak_position = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "openpiv/process.pyx":327
 *                                 ((self.peak1[1]-1)*cd+self.peak1[1]*c+(self.peak1[1]+1)*cu)/(cd+c+cu))
 * 
 *         elif method == 'gaussian':             # <<<<<<<<<<<<<<
 *             subp_peak_position = (self.peak1[0] + ( (np.log(cl)-np.log(cr) )/( 2*np.log(cl) - 4*np.log(c) + 2*np.log(cr) )),
 *                                 self.peak1[1] + ( (np.log(cd)-np.log(cu) )/( 2*np.log(cd) - 4*np.log(c) + 2*np.log(cu) )))
 */
    goto __pyx_L17;
  }

  /* "openpiv/process.pyx":331
 *                                 self.peak1[1] + ( (np.log(cd)-np.log(cu) )/( 2*np.log(cd) - 4*np.log(c) + 2*np.log(cu) )))
 * 
 *         elif method == 'parabolic':             # <<<<<<<<<<<<<<
 *             subp_peak_position = (self.peak1[0] +  (cl-cr)/(2*cl-4*c+2*cr),
 *                                     self.peak1[1] +  (cd-cu)/(2*cd-4*c+2*cu))
 */
  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_parabolic, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
  if (likely(__pyx_t_9)) {

    /* "openpiv/process.pyx":332
 * 
 *         elif method == 'parabolic':
 *             subp_peak_position = (self.peak1[0] +  (cl-cr)/(2*cl-4*c+2*cr),             # <<<<<<<<<<<<<<
 *                                     self.peak1[1] +  (cd-cu)/(2*cd-4*c+2*cu))
 *         else:
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Subtract(__pyx_v_cl, __pyx_v_cr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = PyNumber_Multiply(__pyx_int_2, __pyx_v_cl); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = PyNumber_Multiply(__pyx_int_4, __pyx_v_c); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Multiply(__pyx_int_2, __pyx_v_cr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "openpiv/process.pyx":333
 *         elif method == 'parabolic':
 *             subp_peak_position = (self.peak1[0] +  (cl-cr)/(2*cl-4*c+2*cr),
 *                                     self.peak1[1] +  (cd-cu)/(2*cd-4*c+2*cu))             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError( "method not understood. Can be 'gaussian', 'centroid', 'parabolic'." )
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Subtract(__pyx_v_cd, __pyx_v_cu); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, __pyx_v_cd); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = PyNumber_Multiply(__pyx_int_4, __pyx_v_c); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_int_2, __pyx_v_cu); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Add(__pyx_t_13, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "openpiv/process.pyx":332
 * 
 *         elif method == 'parabolic':
 *             subp_peak_position = (self.peak1[0] +  (cl-cr)/(2*cl-4*c+2*cr),             # <<<<<<<<<<<<<<
 *                                     self.peak1[1] +  (cd-cu)/(2*cd-4*c+2*cu))
 *         else:
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
    __pyx_t_12 = 0;
    __pyx_t_10 = 0;
    __pyx_v_subp_peak_position = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "openpiv/process.pyx":331
 *                                 self.peak1[1] + ( (np.log(cd)-np.log(cu) )/( 2*np.log(cd) - 4*np.log(c) + 2*np.log(cu) )))
 * 
 *         elif method == 'parabolic':             # <<<<<<<<<<<<<<
 *             subp_peak_position = (self.peak1[0] +  (cl-cr)/(2*cl-4*c+2*cr),
 *                                     self.peak1[1] +  (cd-cu)/(2*cd-4*c+2*cu))
 */
    goto __pyx_L17;
  }

  /* "openpiv/process.pyx":335
 *                                     self.peak1[1] +  (cd-cu)/(2*cd-4*c+2*cu))
 *         else:
 *             raise ValueError( "method not understood. Can be 'gaussian', 'centroid', 'parabolic'." )             # <<<<<<<<<<<<<<
 * 
 *         return subp_peak_position
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 335, __pyx_L1_error)
  }
  __pyx_L17:;

  /* "openpiv/process.pyx":337
 *             raise ValueError( "method not understood. Can be 'gaussian', 'centroid', 'parabolic'." )
 * 
 *         return subp_peak_position             # <<<<<<<<<<<<<<
 * 
 *     def sig2noise_ratio( self, method='peak2peak', width=2 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_subp_peak_position);
  __pyx_r = __pyx_v_subp_peak_position;
  goto __pyx_L0;

  /* "openpiv/process.pyx":278
 *         return peak, corr_max2
 * 
 *     def subpixel_peak_position( self, method='gaussian' ):             # <<<<<<<<<<<<<<
 *         """
 *         Find subpixel approximation of the correlation peak.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction.subpixel_peak_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_cl);
  __Pyx_XDECREF(__pyx_v_cr);
  __Pyx_XDECREF(__pyx_v_cd);
  __Pyx_XDECREF(__pyx_v_cu);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XDECREF(__pyx_v_subp_peak_position);
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":339
 *         return subp_peak_position
 * 
 *     def sig2noise_ratio( self, method='peak2peak', width=2 ):             # <<<<<<<<<<<<<<
 *         """Computes the signal to noise ratio.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_9sig2noise_ratio(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_19CorrelationFunction_8sig2noise_ratio[] = "Computes the signal to noise ratio.\n        \n        The signal to noise ratio is computed from the correlation map with\n        one of two available method. It is a measure of the quality of the \n        matching between two interogation windows.\n        \n        Parameters\n        ----------\n        sig2noise_method: string\n            the method for evaluating the signal to noise ratio value from \n            the correlation map. Can be `peak2peak`, `peak2mean` or None\n            if no evaluation should be made.\n            \n        width : int, optional\n            the half size of the region around the first\n            correlation peak to ignore for finding the second\n            peak. [default: 2]. Only used if ``sig2noise_method==peak2peak``.\n            \n        Returns\n        -------\n        sig2noise : float \n            the signal to noise ratio from the correlation map.\n            \n        ";
static PyMethodDef __pyx_mdef_7openpiv_7process_19CorrelationFunction_9sig2noise_ratio = {"sig2noise_ratio", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_19CorrelationFunction_9sig2noise_ratio, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_19CorrelationFunction_8sig2noise_ratio};
static PyObject *__pyx_pw_7openpiv_7process_19CorrelationFunction_9sig2noise_ratio(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sig2noise_ratio (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_method,&__pyx_n_s_width,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_n_s_peak2peak));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_2));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sig2noise_ratio") < 0)) __PYX_ERR(0, 339, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_method = values[1];
    __pyx_v_width = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sig2noise_ratio", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 339, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction.sig2noise_ratio", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_19CorrelationFunction_8sig2noise_ratio(__pyx_self, __pyx_v_self, __pyx_v_method, __pyx_v_width);

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

static PyObject *__pyx_pf_7openpiv_7process_19CorrelationFunction_8sig2noise_ratio(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_width) {
  CYTHON_UNUSED PyObject *__pyx_v_peak2 = NULL;
  PyObject *__pyx_v_corr_max2 = NULL;
  PyObject *__pyx_v_sig2noise = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("sig2noise_ratio", 0);

  /* "openpiv/process.pyx":367
 *         # if the image is lacking particles, totally black it will correlate to very low value, but not zero
 *         # return zero, since we have no signal.
 *         if self.corr_max1 <  1e-3:             # <<<<<<<<<<<<<<
 *             return 0.0
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_corr_max1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_float_1eneg_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
  __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_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "openpiv/process.pyx":368
 *         # return zero, since we have no signal.
 *         if self.corr_max1 <  1e-3:
 *             return 0.0             # <<<<<<<<<<<<<<
 * 
 *         # if the first peak is on the borders, the correlation map is wrong
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_float_0_0);
    __pyx_r = __pyx_float_0_0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":367
 *         # if the image is lacking particles, totally black it will correlate to very low value, but not zero
 *         # return zero, since we have no signal.
 *         if self.corr_max1 <  1e-3:             # <<<<<<<<<<<<<<
 *             return 0.0
 * 
 */
  }

  /* "openpiv/process.pyx":372
 *         # if the first peak is on the borders, the correlation map is wrong
 *         # return zero, since we have no signal.
 *         if ( 0 in self.peak1 or self.data.shape[0] in self.peak1 or self.data.shape[1] in self.peak1):             # <<<<<<<<<<<<<<
 *             return 0.0
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_int_0, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_peak1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "openpiv/process.pyx":373
 *         # return zero, since we have no signal.
 *         if ( 0 in self.peak1 or self.data.shape[0] in self.peak1 or self.data.shape[1] in self.peak1):
 *             return 0.0             # <<<<<<<<<<<<<<
 * 
 *         # now compute signal to noise ratio
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_float_0_0);
    __pyx_r = __pyx_float_0_0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":372
 *         # if the first peak is on the borders, the correlation map is wrong
 *         # return zero, since we have no signal.
 *         if ( 0 in self.peak1 or self.data.shape[0] in self.peak1 or self.data.shape[1] in self.peak1):             # <<<<<<<<<<<<<<
 *             return 0.0
 * 
 */
  }

  /* "openpiv/process.pyx":376
 * 
 *         # now compute signal to noise ratio
 *         if method == 'peak2peak':             # <<<<<<<<<<<<<<
 *             # find second peak height
 *             peak2, corr_max2 = self._find_second_peak( width=width )
 */
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_peak2peak, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "openpiv/process.pyx":378
 *         if method == 'peak2peak':
 *             # find second peak height
 *             peak2, corr_max2 = self._find_second_peak( width=width )             # <<<<<<<<<<<<<<
 * 
 *         elif method == 'peak2mean':
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_second_peak); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_width, __pyx_v_width) < 0) __PYX_ERR(0, 378, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __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;
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 378, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 378, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 378, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __pyx_v_peak2 = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_corr_max2 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "openpiv/process.pyx":376
 * 
 *         # now compute signal to noise ratio
 *         if method == 'peak2peak':             # <<<<<<<<<<<<<<
 *             # find second peak height
 *             peak2, corr_max2 = self._find_second_peak( width=width )
 */
    goto __pyx_L8;
  }

  /* "openpiv/process.pyx":380
 *             peak2, corr_max2 = self._find_second_peak( width=width )
 * 
 *         elif method == 'peak2mean':             # <<<<<<<<<<<<<<
 *             # find mean of the correlation map
 *             corr_max2 = self.data.mean()
 */
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_peak2mean, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 380, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "openpiv/process.pyx":382
 *         elif method == 'peak2mean':
 *             # find mean of the correlation map
 *             corr_max2 = self.data.mean()             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mean); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_corr_max2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "openpiv/process.pyx":380
 *             peak2, corr_max2 = self._find_second_peak( width=width )
 * 
 *         elif method == 'peak2mean':             # <<<<<<<<<<<<<<
 *             # find mean of the correlation map
 *             corr_max2 = self.data.mean()
 */
    goto __pyx_L8;
  }

  /* "openpiv/process.pyx":385
 * 
 *         else:
 *             raise ValueError('wrong sig2noise_method')             # <<<<<<<<<<<<<<
 * 
 *         # avoid dividing by zero
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 385, __pyx_L1_error)
  }
  __pyx_L8:;

  /* "openpiv/process.pyx":388
 * 
 *         # avoid dividing by zero
 *         try:             # <<<<<<<<<<<<<<
 *             sig2noise = self.corr_max1/corr_max2
 *         except ValueError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "openpiv/process.pyx":389
 *         # avoid dividing by zero
 *         try:
 *             sig2noise = self.corr_max1/corr_max2             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             sig2noise = np.inf
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_corr_max1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_corr_max2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_sig2noise = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "openpiv/process.pyx":388
 * 
 *         # avoid dividing by zero
 *         try:             # <<<<<<<<<<<<<<
 *             sig2noise = self.corr_max1/corr_max2
 *         except ValueError:
 */
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L16_try_end;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "openpiv/process.pyx":390
 *         try:
 *             sig2noise = self.corr_max1/corr_max2
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             sig2noise = np.inf
 * 
 */
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("openpiv.process.CorrelationFunction.sig2noise_ratio", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 390, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_2);

      /* "openpiv/process.pyx":391
 *             sig2noise = self.corr_max1/corr_max2
 *         except ValueError:
 *             sig2noise = np.inf             # <<<<<<<<<<<<<<
 * 
 *         return sig2noise
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_inf); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 391, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sig2noise, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L12_exception_handled;
    }
    goto __pyx_L13_except_error;
    __pyx_L13_except_error:;

    /* "openpiv/process.pyx":388
 * 
 *         # avoid dividing by zero
 *         try:             # <<<<<<<<<<<<<<
 *             sig2noise = self.corr_max1/corr_max2
 *         except ValueError:
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L12_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L16_try_end:;
  }

  /* "openpiv/process.pyx":393
 *             sig2noise = np.inf
 * 
 *         return sig2noise             # <<<<<<<<<<<<<<
 * 
 * def get_coordinates( image_size, window_size, overlap ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_sig2noise);
  __pyx_r = __pyx_v_sig2noise;
  goto __pyx_L0;

  /* "openpiv/process.pyx":339
 *         return subp_peak_position
 * 
 *     def sig2noise_ratio( self, method='peak2peak', width=2 ):             # <<<<<<<<<<<<<<
 *         """Computes the signal to noise ratio.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("openpiv.process.CorrelationFunction.sig2noise_ratio", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_peak2);
  __Pyx_XDECREF(__pyx_v_corr_max2);
  __Pyx_XDECREF(__pyx_v_sig2noise);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":395
 *         return sig2noise
 * 
 * def get_coordinates( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the x, y coordinates of the centers of the interrogation windows.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_3get_coordinates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_2get_coordinates[] = "Compute the x, y coordinates of the centers of the interrogation windows.\n    \n    Parameters\n    ----------\n    image_size: two elements tuple\n        a two dimensional tuple for the pixel size of the image\n        first element is number of rows, second element is \n        the number of columns.\n        \n    window_size: int\n        the size of the interrogation windows.\n        \n    overlap: int\n        the number of pixel by which two adjacent interrogation\n        windows overlap.\n        \n        \n    Returns\n    -------\n    x : 2d np.ndarray\n        a two dimensional array containing the x coordinates of the \n        interrogation window centers, in pixels.\n        \n    y : 2d np.ndarray\n        a two dimensional array containing the y coordinates of the \n        interrogation window centers, in pixels.\n        \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_3get_coordinates = {"get_coordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_3get_coordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_2get_coordinates};
static PyObject *__pyx_pw_7openpiv_7process_3get_coordinates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_image_size = 0;
  PyObject *__pyx_v_window_size = 0;
  PyObject *__pyx_v_overlap = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_coordinates (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_image_size,&__pyx_n_s_window_size,&__pyx_n_s_overlap,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_coordinates", 1, 3, 3, 1); __PYX_ERR(0, 395, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_coordinates", 1, 3, 3, 2); __PYX_ERR(0, 395, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_coordinates") < 0)) __PYX_ERR(0, 395, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_image_size = values[0];
    __pyx_v_window_size = values[1];
    __pyx_v_overlap = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_coordinates", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.get_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_2get_coordinates(__pyx_self, __pyx_v_image_size, __pyx_v_window_size, __pyx_v_overlap);

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

static PyObject *__pyx_pf_7openpiv_7process_2get_coordinates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image_size, PyObject *__pyx_v_window_size, PyObject *__pyx_v_overlap) {
  PyObject *__pyx_v_field_shape = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("get_coordinates", 0);

  /* "openpiv/process.pyx":426
 * 
 *     # get shape of the resulting flow field
 *     field_shape = get_field_shape( image_size, window_size, overlap )             # <<<<<<<<<<<<<<
 * 
 *     # compute grid coordinates of the interrogation window centers
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_field_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_image_size, __pyx_v_window_size, __pyx_v_overlap};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_image_size, __pyx_v_window_size, __pyx_v_overlap};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_image_size);
    __Pyx_GIVEREF(__pyx_v_image_size);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_image_size);
    __Pyx_INCREF(__pyx_v_window_size);
    __Pyx_GIVEREF(__pyx_v_window_size);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_window_size);
    __Pyx_INCREF(__pyx_v_overlap);
    __Pyx_GIVEREF(__pyx_v_overlap);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_overlap);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_field_shape = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":429
 * 
 *     # compute grid coordinates of the interrogation window centers
 *     x = np.arange( field_shape[1] )*(window_size-overlap) + window_size/2.0             # <<<<<<<<<<<<<<
 *     y = np.arange( field_shape[0] )*(window_size-overlap) + window_size/2.0
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Subtract(__pyx_v_window_size, __pyx_v_overlap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_window_size, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":430
 *     # compute grid coordinates of the interrogation window centers
 *     x = np.arange( field_shape[1] )*(window_size-overlap) + window_size/2.0
 *     y = np.arange( field_shape[0] )*(window_size-overlap) + window_size/2.0             # <<<<<<<<<<<<<<
 * 
 *     return np.meshgrid(x,y[::-1])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_field_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_window_size, __pyx_v_overlap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_window_size, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":432
 *     y = np.arange( field_shape[0] )*(window_size-overlap) + window_size/2.0
 * 
 *     return np.meshgrid(x,y[::-1])             # <<<<<<<<<<<<<<
 * 
 * def get_field_shape ( image_size, window_size, overlap ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_y, __pyx_slice__6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":395
 *         return sig2noise
 * 
 * def get_coordinates( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the x, y coordinates of the centers of the interrogation windows.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("openpiv.process.get_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_field_shape);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":434
 *     return np.meshgrid(x,y[::-1])
 * 
 * def get_field_shape ( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the shape of the resulting flow field.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_5get_field_shape(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_4get_field_shape[] = "Compute the shape of the resulting flow field.\n    \n    Given the image size, the interrogation window size and\n    the overlap size, it is possible to calculate the number \n    of rows and columns of the resulting flow field.\n    \n    Parameters\n    ----------\n    image_size: two elements tuple\n        a two dimensional tuple for the pixel size of the image\n        first element is number of rows, second element is \n        the number of columns.\n        \n    window_size: int\n        the size of the interrogation window.\n        \n    overlap: int\n        the number of pixel by which two adjacent interrogation\n        windows overlap.\n        \n        \n    Returns\n    -------\n    field_shape : two elements tuple\n        the shape of the resulting flow field\n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_5get_field_shape = {"get_field_shape", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_5get_field_shape, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_4get_field_shape};
static PyObject *__pyx_pw_7openpiv_7process_5get_field_shape(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_image_size = 0;
  PyObject *__pyx_v_window_size = 0;
  PyObject *__pyx_v_overlap = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_field_shape (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_image_size,&__pyx_n_s_window_size,&__pyx_n_s_overlap,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_field_shape", 1, 3, 3, 1); __PYX_ERR(0, 434, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_field_shape", 1, 3, 3, 2); __PYX_ERR(0, 434, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_field_shape") < 0)) __PYX_ERR(0, 434, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_image_size = values[0];
    __pyx_v_window_size = values[1];
    __pyx_v_overlap = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_field_shape", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 434, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.get_field_shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_4get_field_shape(__pyx_self, __pyx_v_image_size, __pyx_v_window_size, __pyx_v_overlap);

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

static PyObject *__pyx_pf_7openpiv_7process_4get_field_shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image_size, PyObject *__pyx_v_window_size, PyObject *__pyx_v_overlap) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_field_shape", 0);

  /* "openpiv/process.pyx":462
 *     """
 * 
 *     return ( (image_size[0] - window_size)//(window_size-overlap)+1,             # <<<<<<<<<<<<<<
 *              (image_size[1] - window_size)//(window_size-overlap)+1 )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_image_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_window_size, __pyx_v_overlap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __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_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "openpiv/process.pyx":463
 * 
 *     return ( (image_size[0] - window_size)//(window_size-overlap)+1,
 *              (image_size[1] - window_size)//(window_size-overlap)+1 )             # <<<<<<<<<<<<<<
 * 
 * def correlate_windows( window_a, window_b, corr_method = 'fft', nfftx = None, nffty = None ):
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_image_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_v_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_window_size, __pyx_v_overlap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "openpiv/process.pyx":462
 *     """
 * 
 *     return ( (image_size[0] - window_size)//(window_size-overlap)+1,             # <<<<<<<<<<<<<<
 *              (image_size[1] - window_size)//(window_size-overlap)+1 )
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":434
 *     return np.meshgrid(x,y[::-1])
 * 
 * def get_field_shape ( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the shape of the resulting flow field.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("openpiv.process.get_field_shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":465
 *              (image_size[1] - window_size)//(window_size-overlap)+1 )
 * 
 * def correlate_windows( window_a, window_b, corr_method = 'fft', nfftx = None, nffty = None ):             # <<<<<<<<<<<<<<
 *     """Compute correlation function between two interrogation windows.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_7correlate_windows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_6correlate_windows[] = "Compute correlation function between two interrogation windows.\n    \n    The correlation function can be computed by using the correlation \n    theorem to speed up the computation.\n    \n    Parameters\n    ----------\n    window_a : 2d np.ndarray\n        a two dimensions array for the first interrogation window.\n        \n    window_b : 2d np.ndarray\n        a two dimensions array for the second interrogation window.\n        \n    corr_method   : string\n        one of the two methods currently implemented: 'fft' or 'direct'.\n        Default is 'fft', which is much faster.\n        \n    nfftx   : int\n        the size of the 2D FFT in x-direction, \n        [default: 2 x windows_a.shape[0] is recommended].\n        \n    nffty   : int\n        the size of the 2D FFT in y-direction, \n        [default: 2 x windows_a.shape[1] is recommended].\n        \n        \n    Returns\n    -------\n    corr : 2d np.ndarray\n        a two dimensions array for the correlation function.\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_7correlate_windows = {"correlate_windows", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_7correlate_windows, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_6correlate_windows};
static PyObject *__pyx_pw_7openpiv_7process_7correlate_windows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_window_a = 0;
  PyObject *__pyx_v_window_b = 0;
  PyObject *__pyx_v_corr_method = 0;
  PyObject *__pyx_v_nfftx = 0;
  PyObject *__pyx_v_nffty = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("correlate_windows (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window_a,&__pyx_n_s_window_b,&__pyx_n_s_corr_method,&__pyx_n_s_nfftx,&__pyx_n_s_nffty,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_s_fft);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("correlate_windows", 0, 2, 5, 1); __PYX_ERR(0, 465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_corr_method);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nfftx);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nffty);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "correlate_windows") < 0)) __PYX_ERR(0, 465, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_window_a = values[0];
    __pyx_v_window_b = values[1];
    __pyx_v_corr_method = values[2];
    __pyx_v_nfftx = values[3];
    __pyx_v_nffty = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("correlate_windows", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 465, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.correlate_windows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_6correlate_windows(__pyx_self, __pyx_v_window_a, __pyx_v_window_b, __pyx_v_corr_method, __pyx_v_nfftx, __pyx_v_nffty);

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

static PyObject *__pyx_pf_7openpiv_7process_6correlate_windows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_window_a, PyObject *__pyx_v_window_b, PyObject *__pyx_v_corr_method, PyObject *__pyx_v_nfftx, PyObject *__pyx_v_nffty) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("correlate_windows", 0);
  __Pyx_INCREF(__pyx_v_nfftx);
  __Pyx_INCREF(__pyx_v_nffty);

  /* "openpiv/process.pyx":499
 *     """
 * 
 *     if corr_method == 'fft':             # <<<<<<<<<<<<<<
 *         if nfftx is None:
 *             nfftx = 2*window_a.shape[0]
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_corr_method, __pyx_n_s_fft, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 499, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "openpiv/process.pyx":500
 * 
 *     if corr_method == 'fft':
 *         if nfftx is None:             # <<<<<<<<<<<<<<
 *             nfftx = 2*window_a.shape[0]
 *         if nffty is None:
 */
    __pyx_t_1 = (__pyx_v_nfftx == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "openpiv/process.pyx":501
 *     if corr_method == 'fft':
 *         if nfftx is None:
 *             nfftx = 2*window_a.shape[0]             # <<<<<<<<<<<<<<
 *         if nffty is None:
 *             nffty = 2*window_a.shape[1]
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_window_a, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_nfftx, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "openpiv/process.pyx":500
 * 
 *     if corr_method == 'fft':
 *         if nfftx is None:             # <<<<<<<<<<<<<<
 *             nfftx = 2*window_a.shape[0]
 *         if nffty is None:
 */
    }

    /* "openpiv/process.pyx":502
 *         if nfftx is None:
 *             nfftx = 2*window_a.shape[0]
 *         if nffty is None:             # <<<<<<<<<<<<<<
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 */
    __pyx_t_2 = (__pyx_v_nffty == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "openpiv/process.pyx":503
 *             nfftx = 2*window_a.shape[0]
 *         if nffty is None:
 *             nffty = 2*window_a.shape[1]             # <<<<<<<<<<<<<<
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_window_a, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_nffty, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "openpiv/process.pyx":502
 *         if nfftx is None:
 *             nfftx = 2*window_a.shape[0]
 *         if nffty is None:             # <<<<<<<<<<<<<<
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 */
    }

    /* "openpiv/process.pyx":504
 *         if nffty is None:
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\             # <<<<<<<<<<<<<<
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_fftshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_irfft2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rfft2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_normalize_intensity); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_window_a) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_window_a);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __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_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "openpiv/process.pyx":505
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\             # <<<<<<<<<<<<<<
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 *     elif corr_method == 'direct':
 */
    __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_nfftx);
    __Pyx_GIVEREF(__pyx_v_nfftx);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_nfftx);
    __Pyx_INCREF(__pyx_v_nffty);
    __Pyx_GIVEREF(__pyx_v_nffty);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_nffty);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_s, __pyx_t_9) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "openpiv/process.pyx":504
 *         if nffty is None:
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\             # <<<<<<<<<<<<<<
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "openpiv/process.pyx":505
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\             # <<<<<<<<<<<<<<
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 *     elif corr_method == 'direct':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_conj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_rfft2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_normalize_intensity); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_10 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_v_window_b) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_window_b);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "openpiv/process.pyx":506
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )             # <<<<<<<<<<<<<<
 *     elif corr_method == 'direct':
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 */
    __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v_nfftx);
    __Pyx_GIVEREF(__pyx_v_nfftx);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_nfftx);
    __Pyx_INCREF(__pyx_v_nffty);
    __Pyx_GIVEREF(__pyx_v_nffty);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_nffty);
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_s, __pyx_t_12) < 0) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "openpiv/process.pyx":505
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\             # <<<<<<<<<<<<<<
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 *     elif corr_method == 'direct':
 */
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "openpiv/process.pyx":506
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )             # <<<<<<<<<<<<<<
 *     elif corr_method == 'direct':
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_real); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "openpiv/process.pyx":504
 *         if nffty is None:
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\             # <<<<<<<<<<<<<<
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "openpiv/process.pyx":506
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )             # <<<<<<<<<<<<<<
 *     elif corr_method == 'direct':
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_axes, __pyx_tuple__7) < 0) __PYX_ERR(0, 506, __pyx_L1_error)

    /* "openpiv/process.pyx":504
 *         if nffty is None:
 *             nffty = 2*window_a.shape[1]
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\             # <<<<<<<<<<<<<<
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":499
 *     """
 * 
 *     if corr_method == 'fft':             # <<<<<<<<<<<<<<
 *         if nfftx is None:
 *             nfftx = 2*window_a.shape[0]
 */
  }

  /* "openpiv/process.pyx":507
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 *     elif corr_method == 'direct':             # <<<<<<<<<<<<<<
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_corr_method, __pyx_n_s_direct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "openpiv/process.pyx":508
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 *     elif corr_method == 'direct':
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('method is not implemented')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_convolve); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_normalize_intensity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_v_window_a) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_window_a);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_normalize_intensity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_window_b, __pyx_tuple__8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_3 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_13 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_13 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_3, __pyx_n_s_full};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_3, __pyx_n_s_full};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_13, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_13, __pyx_t_3);
      __Pyx_INCREF(__pyx_n_s_full);
      __Pyx_GIVEREF(__pyx_n_s_full);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_13, __pyx_n_s_full);
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":507
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 *     elif corr_method == 'direct':             # <<<<<<<<<<<<<<
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 *     else:
 */
  }

  /* "openpiv/process.pyx":510
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 *     else:
 *         raise ValueError('method is not implemented')             # <<<<<<<<<<<<<<
 * 
 * def normalize_intensity( window ):
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 510, __pyx_L1_error)
  }

  /* "openpiv/process.pyx":465
 *              (image_size[1] - window_size)//(window_size-overlap)+1 )
 * 
 * def correlate_windows( window_a, window_b, corr_method = 'fft', nfftx = None, nffty = None ):             # <<<<<<<<<<<<<<
 *     """Compute correlation function between two interrogation windows.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("openpiv.process.correlate_windows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nfftx);
  __Pyx_XDECREF(__pyx_v_nffty);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":512
 *         raise ValueError('method is not implemented')
 * 
 * def normalize_intensity( window ):             # <<<<<<<<<<<<<<
 *     """Normalize interrogation window by removing the mean value.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_9normalize_intensity(PyObject *__pyx_self, PyObject *__pyx_v_window); /*proto*/
static char __pyx_doc_7openpiv_7process_8normalize_intensity[] = "Normalize interrogation window by removing the mean value.\n    \n    Parameters\n    ----------\n    window :  2d np.ndarray\n        the interrogation window array\n        \n    Returns\n    -------\n    window :  2d np.ndarray\n        the interrogation window array, with mean value equal to zero.\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_9normalize_intensity = {"normalize_intensity", (PyCFunction)__pyx_pw_7openpiv_7process_9normalize_intensity, METH_O, __pyx_doc_7openpiv_7process_8normalize_intensity};
static PyObject *__pyx_pw_7openpiv_7process_9normalize_intensity(PyObject *__pyx_self, PyObject *__pyx_v_window) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("normalize_intensity (wrapper)", 0);
  __pyx_r = __pyx_pf_7openpiv_7process_8normalize_intensity(__pyx_self, ((PyObject *)__pyx_v_window));

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

static PyObject *__pyx_pf_7openpiv_7process_8normalize_intensity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_window) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("normalize_intensity", 0);

  /* "openpiv/process.pyx":526
 * 
 *     """
 *     return window - window.mean()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_window, __pyx_n_s_mean); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_window, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __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;

  /* "openpiv/process.pyx":512
 *         raise ValueError('method is not implemented')
 * 
 * def normalize_intensity( window ):             # <<<<<<<<<<<<<<
 *     """Normalize interrogation window by removing the mean value.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("openpiv.process.normalize_intensity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":536
 * 
 * ##################################################################
 * def WiDIM( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *            np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *            np.ndarray[DTYPEi_t, ndim=2] mark,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_11WiDIM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_10WiDIM[] = "\n    Implementation of the WiDIM algorithm (Window Displacement Iterative Method).\n    This is an iterative  method to cope with  the lost of pairs due to particles \n    motion and get rid of the limitation in velocity range due to the window size.\n    The possibility of window size coarsening is implemented.\n    Example : minimum window size of 16*16 pixels and coarse_level of 2 gives a 1st\n    iteration with a window size of 64*64 pixels, then 32*32 then 16*16.\n        ----Algorithm : At each step, a predictor of the displacement (dp) is applied based on the results of the previous iteration.\n                        Each window is correlated with a shifted window.\n                        The displacement obtained from this correlation is the residual displacement (dc)\n                        The new displacement (d) is obtained with dx = dpx + dcx and dy = dpy + dcy\n                        The velocity field is validated and wrong vectors are replaced by mean value of surrounding vectors from the previous iteration (or by bilinear interpolation if the window size of previous iteration was different)\n                        The new predictor is obtained by bilinear interpolation of the displacements of the previous iteration:\n                            dpx_k+1 = dx_k\n\n    Reference:\n        F. Scarano & M. L. Riethmuller, Iterative multigrid approach in PIV image processing with discrete window offset, Experiments in Fluids 26 (1999) 513-523\n    \n    Parameters\n    ----------\n    frame_a : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the first frame.\n        \n    frame_b : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers containing grey levels of \n        the second frame.\n        \n    mark : 2d np.ndarray, dtype=np.int32\n        an two dimensions array of integers with values 0 for the background, 1 for the flow-field. If the center of a window is"" on a 0 value the velocity is set to 0.\n\n    min_window_size : int\n        the size of the minimum (final) (square) interrogation window.\n        \n    overlap_ratio : float\n        the ratio of overlap between two windows (between 0 and 1).\n        \n    dt : float\n        the time delay separating the two frames.\n    \n    validation_method : string\n        the method used for validation (in addition to the sig2noise method). Only the mean velocity method is implemented now\n    \n    trust_1st_iter : int = 0 or 1\n        0 if the first iteration need to be validated. With a first window size following the 1/4 rule, the 1st iteration can be trusted and the value should be 1 (Default value)\n     \n    validation_iter : int\n        number of iterations per validation cycle.\n       \n    tolerance : float\n        the threshold for the validation method chosen. This does not concern the sig2noise for which the threshold is 1.5; [nb: this could change in the future]\n    \n    nb_iter_max : int\n        global number of iterations.\n       \n    subpixel_method : string\n         one of the following methods to estimate subpixel location of the peak: \n         'centroid' [replaces default if correlation map is negative], \n         'gaussian' [default if correlation map is positive], \n         'parabolic'.\n    \n    sig2noise_method : string \n        defines the method of signal-to-noise-ratio measure,\n        ('peak2peak' or 'peak2mean'. If None, no measure is performed.)\n        \n    width : int\n        the half size of the region around the first\n        correlation peak to ignore for finding the second\n        peak. [default: 2]. Only used if ``sig2noise_method==peak2peak``.\n        \n    nfftx   : int\n        the size of the 2D FFT in x-direction, \n        [default: 2 x windows_a.shape[0] is recommended]\n        \n    nffty   : int\n        the size of the 2D FFT in y-direction, \n        [default: 2 x windows_a.shape[1] is recommended]""\n\n    \n    Returns\n    -------\n\n    x : 2d np.ndarray\n        a two dimensional array containing the x-axis component of the interpolations locations.\n        \n    y : 2d np.ndarray\n        a two dimensional array containing the y-axis component of the interpolations locations.\n        \n    u : 2d np.ndarray\n        a two dimensional array containing the u velocity component,\n        in pixels/seconds.\n        \n    v : 2d np.ndarray\n        a two dimensional array containing the v velocity component,\n        in pixels/seconds.\n        \n    mask : 2d np.ndarray\n        a two dimensional array containing the boolean values (True for vectors interpolated from previous iteration)\n        \n    Example\n    --------\n    \n    >>> x,y,u,v, mask = openpiv.process.WiDIM( frame_a, frame_b, mark, min_window_size=16, overlap_ratio=0.25, coarse_factor=2, dt=0.02, validation_method='mean_velocity', trust_1st_iter=1, validation_iter=2, tolerance=0.7, nb_iter_max=4, sig2noise_method='peak2peak')\n\n    --------------------------------------\n    Method of implementation : to improve the speed of the programm,\n    all data have been placed in the same huge 4-dimensions 'F' array.\n    (this prevent the definition of a new array for each iteration)\n    However, during the coarsening process a large part of the array is not used.\n    Structure of array F:\n    --The 1st index is the main iteration (K)   --> length is nb_iter_max\n        -- 2nd index (I) is row (of the map of the interpolations locations of iteration K) --> length (effectively used) is Nrow[K]\n            --3rd index (J) is column  --> length (effectively used) is Ncol[K]\n                --4th index represent the type of data stored at this point:\n                            | 0 --> x         |\n                            | 1 --> y         | \n                            | 2 --> xb        |\n                            | 3 --> yb        | \n                            | 4 --> dx        |""\n                            | 5 --> dy        | \n                            | 6 --> dpx       |\n                            | 7 --> dpy       | \n                            | 8 --> dcx       |\n                            | 9 --> dcy       | \n                            | 10 --> u        |\n                            | 11 --> v        | \n                            | 12 --> si2noise | \n    Storage of data with indices is not good for comprehension so its very important to comment on each single operation.\n    A python dictionary type could have been used (and would be much more intuitive)\n    but its equivalent in c language (type map) is very slow compared to a numpy ndarray.\n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_11WiDIM = {"WiDIM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_11WiDIM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_10WiDIM};
static PyObject *__pyx_pw_7openpiv_7process_11WiDIM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_frame_a = 0;
  PyArrayObject *__pyx_v_frame_b = 0;
  PyArrayObject *__pyx_v_mark = 0;
  int __pyx_v_min_window_size;
  float __pyx_v_overlap_ratio;
  int __pyx_v_coarse_factor;
  float __pyx_v_dt;
  PyObject *__pyx_v_validation_method = 0;
  int __pyx_v_trust_1st_iter;
  int __pyx_v_validation_iter;
  float __pyx_v_tolerance;
  int __pyx_v_nb_iter_max;
  PyObject *__pyx_v_subpixel_method = 0;
  PyObject *__pyx_v_sig2noise_method = 0;
  int __pyx_v_width;
  PyObject *__pyx_v_nfftx = 0;
  PyObject *__pyx_v_nffty = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("WiDIM (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame_a,&__pyx_n_s_frame_b,&__pyx_n_s_mark,&__pyx_n_s_min_window_size,&__pyx_n_s_overlap_ratio,&__pyx_n_s_coarse_factor,&__pyx_n_s_dt,&__pyx_n_s_validation_method,&__pyx_n_s_trust_1st_iter,&__pyx_n_s_validation_iter,&__pyx_n_s_tolerance,&__pyx_n_s_nb_iter_max,&__pyx_n_s_subpixel_method,&__pyx_n_s_sig2noise_method,&__pyx_n_s_width,&__pyx_n_s_nfftx,&__pyx_n_s_nffty,0};
    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    values[7] = ((PyObject*)__pyx_n_s_mean_velocity);
    values[12] = ((PyObject*)__pyx_n_s_gaussian);
    values[13] = ((PyObject*)__pyx_n_s_peak2peak);

    /* "openpiv/process.pyx":551
 *            str sig2noise_method='peak2peak',
 *            int width=2,
 *            nfftx=None,             # <<<<<<<<<<<<<<
 *            nffty=None):
 *     """
 */
    values[15] = ((PyObject *)Py_None);

    /* "openpiv/process.pyx":552
 *            int width=2,
 *            nfftx=None,
 *            nffty=None):             # <<<<<<<<<<<<<<
 *     """
 *     Implementation of the WiDIM algorithm (Window Displacement Iterative Method).
 */
    values[16] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("WiDIM", 0, 7, 17, 1); __PYX_ERR(0, 536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mark)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("WiDIM", 0, 7, 17, 2); __PYX_ERR(0, 536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_window_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("WiDIM", 0, 7, 17, 3); __PYX_ERR(0, 536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap_ratio)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("WiDIM", 0, 7, 17, 4); __PYX_ERR(0, 536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coarse_factor)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("WiDIM", 0, 7, 17, 5); __PYX_ERR(0, 536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("WiDIM", 0, 7, 17, 6); __PYX_ERR(0, 536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_validation_method);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trust_1st_iter);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_validation_iter);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tolerance);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nb_iter_max);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subpixel_method);
          if (value) { values[12] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sig2noise_method);
          if (value) { values[13] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[14] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nfftx);
          if (value) { values[15] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nffty);
          if (value) { values[16] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "WiDIM") < 0)) __PYX_ERR(0, 536, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frame_a = ((PyArrayObject *)values[0]);
    __pyx_v_frame_b = ((PyArrayObject *)values[1]);
    __pyx_v_mark = ((PyArrayObject *)values[2]);
    __pyx_v_min_window_size = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_min_window_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error)
    __pyx_v_overlap_ratio = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_overlap_ratio == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L3_error)
    __pyx_v_coarse_factor = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_coarse_factor == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_dt == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L3_error)
    __pyx_v_validation_method = ((PyObject*)values[7]);
    if (values[8]) {
      __pyx_v_trust_1st_iter = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_trust_1st_iter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 544, __pyx_L3_error)
    } else {
      __pyx_v_trust_1st_iter = ((int)1);
    }
    if (values[9]) {
      __pyx_v_validation_iter = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_validation_iter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L3_error)
    } else {
      __pyx_v_validation_iter = ((int)1);
    }
    if (values[10]) {
      __pyx_v_tolerance = __pyx_PyFloat_AsFloat(values[10]); if (unlikely((__pyx_v_tolerance == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L3_error)
    } else {
      __pyx_v_tolerance = ((float)1.5);
    }
    if (values[11]) {
      __pyx_v_nb_iter_max = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nb_iter_max == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error)
    } else {
      __pyx_v_nb_iter_max = ((int)3);
    }
    __pyx_v_subpixel_method = ((PyObject*)values[12]);
    __pyx_v_sig2noise_method = ((PyObject*)values[13]);
    if (values[14]) {
      __pyx_v_width = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
    } else {
      __pyx_v_width = ((int)2);
    }
    __pyx_v_nfftx = values[15];
    __pyx_v_nffty = values[16];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("WiDIM", 0, 7, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 536, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.WiDIM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame_a), __pyx_ptype_5numpy_ndarray, 1, "frame_a", 0))) __PYX_ERR(0, 536, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame_b), __pyx_ptype_5numpy_ndarray, 1, "frame_b", 0))) __PYX_ERR(0, 537, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mark), __pyx_ptype_5numpy_ndarray, 1, "mark", 0))) __PYX_ERR(0, 538, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_method), (&PyString_Type), 1, "validation_method", 1))) __PYX_ERR(0, 543, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subpixel_method), (&PyString_Type), 1, "subpixel_method", 1))) __PYX_ERR(0, 548, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sig2noise_method), (&PyString_Type), 1, "sig2noise_method", 1))) __PYX_ERR(0, 549, __pyx_L1_error)
  __pyx_r = __pyx_pf_7openpiv_7process_10WiDIM(__pyx_self, __pyx_v_frame_a, __pyx_v_frame_b, __pyx_v_mark, __pyx_v_min_window_size, __pyx_v_overlap_ratio, __pyx_v_coarse_factor, __pyx_v_dt, __pyx_v_validation_method, __pyx_v_trust_1st_iter, __pyx_v_validation_iter, __pyx_v_tolerance, __pyx_v_nb_iter_max, __pyx_v_subpixel_method, __pyx_v_sig2noise_method, __pyx_v_width, __pyx_v_nfftx, __pyx_v_nffty);

  /* "openpiv/process.pyx":536
 * 
 * ##################################################################
 * def WiDIM( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *            np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *            np.ndarray[DTYPEi_t, ndim=2] mark,
 */

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

static PyObject *__pyx_pf_7openpiv_7process_10WiDIM(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_frame_a, PyArrayObject *__pyx_v_frame_b, PyArrayObject *__pyx_v_mark, int __pyx_v_min_window_size, float __pyx_v_overlap_ratio, int __pyx_v_coarse_factor, float __pyx_v_dt, PyObject *__pyx_v_validation_method, int __pyx_v_trust_1st_iter, int __pyx_v_validation_iter, float __pyx_v_tolerance, int __pyx_v_nb_iter_max, PyObject *__pyx_v_subpixel_method, PyObject *__pyx_v_sig2noise_method, int __pyx_v_width, PyObject *__pyx_v_nfftx, PyObject *__pyx_v_nffty) {
  int __pyx_v_K;
  int __pyx_v_I;
  int __pyx_v_J;
  int __pyx_v_L;
  int __pyx_v_M;
  int __pyx_v_i;
  float __pyx_v_i_peak;
  float __pyx_v_j_peak;
  float __pyx_v_mean_u;
  float __pyx_v_mean_v;
  float __pyx_v_rms_u;
  float __pyx_v_rms_v;
  float __pyx_v_residual_0;
  int __pyx_v_residual;
  PyArrayObject *__pyx_v_Nrow = 0;
  PyArrayObject *__pyx_v_Ncol = 0;
  PyArrayObject *__pyx_v_W = 0;
  PyArrayObject *__pyx_v_Overlap = 0;
  npy_intp *__pyx_v_pic_size;
  float __pyx_v_startTime;
  PyArrayObject *__pyx_v_F = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_u = 0;
  PyArrayObject *__pyx_v_v = 0;
  PyArrayObject *__pyx_v_x = 0;
  PyArrayObject *__pyx_v_y = 0;
  PyArrayObject *__pyx_v_neighbours = 0;
  PyArrayObject *__pyx_v_neighbours_present = 0;
  PyObject *__pyx_v_window_a = NULL;
  PyObject *__pyx_v_window_b = NULL;
  PyObject *__pyx_v_corr = NULL;
  PyObject *__pyx_v_c = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_F;
  __Pyx_Buffer __pyx_pybuffer_F;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_Ncol;
  __Pyx_Buffer __pyx_pybuffer_Ncol;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_Nrow;
  __Pyx_Buffer __pyx_pybuffer_Nrow;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_Overlap;
  __Pyx_Buffer __pyx_pybuffer_Overlap;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_W;
  __Pyx_Buffer __pyx_pybuffer_W;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_frame_a;
  __Pyx_Buffer __pyx_pybuffer_frame_a;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_frame_b;
  __Pyx_Buffer __pyx_pybuffer_frame_b;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mark;
  __Pyx_Buffer __pyx_pybuffer_mark;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_neighbours;
  __Pyx_Buffer __pyx_pybuffer_neighbours;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_neighbours_present;
  __Pyx_Buffer __pyx_pybuffer_neighbours_present;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_u;
  __Pyx_Buffer __pyx_pybuffer_u;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
  __Pyx_Buffer __pyx_pybuffer_v;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  __Pyx_Buffer __pyx_pybuffer_x;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_y;
  __Pyx_Buffer __pyx_pybuffer_y;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  npy_intp *__pyx_t_10;
  long __pyx_t_11;
  long __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  PyObject *__pyx_t_33 = NULL;
  PyObject *__pyx_t_34 = NULL;
  PyObject *__pyx_t_35 = NULL;
  PyObject *__pyx_t_36 = NULL;
  float __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  PyArrayObject *__pyx_t_40 = NULL;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  PyArrayObject *__pyx_t_43 = NULL;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  PyArrayObject *__pyx_t_46 = NULL;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  PyArrayObject *__pyx_t_49 = NULL;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  PyArrayObject *__pyx_t_52 = NULL;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  PyArrayObject *__pyx_t_55 = NULL;
  PyArrayObject *__pyx_t_56 = NULL;
  PyArrayObject *__pyx_t_57 = NULL;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  int __pyx_t_60;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_61;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  int __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  PyObject *(*__pyx_t_95)(PyObject *);
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  __pyx_t_7openpiv_7process_DTYPEf_t __pyx_t_106;
  Py_ssize_t __pyx_t_107;
  Py_ssize_t __pyx_t_108;
  Py_ssize_t __pyx_t_109;
  Py_ssize_t __pyx_t_110;
  Py_ssize_t __pyx_t_111;
  Py_ssize_t __pyx_t_112;
  Py_ssize_t __pyx_t_113;
  Py_ssize_t __pyx_t_114;
  Py_ssize_t __pyx_t_115;
  Py_ssize_t __pyx_t_116;
  Py_ssize_t __pyx_t_117;
  Py_ssize_t __pyx_t_118;
  Py_ssize_t __pyx_t_119;
  Py_ssize_t __pyx_t_120;
  Py_ssize_t __pyx_t_121;
  Py_ssize_t __pyx_t_122;
  Py_ssize_t __pyx_t_123;
  Py_ssize_t __pyx_t_124;
  Py_ssize_t __pyx_t_125;
  Py_ssize_t __pyx_t_126;
  Py_ssize_t __pyx_t_127;
  int __pyx_t_128;
  Py_ssize_t __pyx_t_129;
  Py_ssize_t __pyx_t_130;
  Py_ssize_t __pyx_t_131;
  Py_ssize_t __pyx_t_132;
  Py_ssize_t __pyx_t_133;
  Py_ssize_t __pyx_t_134;
  Py_ssize_t __pyx_t_135;
  Py_ssize_t __pyx_t_136;
  Py_ssize_t __pyx_t_137;
  Py_ssize_t __pyx_t_138;
  Py_ssize_t __pyx_t_139;
  Py_ssize_t __pyx_t_140;
  Py_ssize_t __pyx_t_141;
  Py_ssize_t __pyx_t_142;
  Py_ssize_t __pyx_t_143;
  Py_ssize_t __pyx_t_144;
  Py_ssize_t __pyx_t_145;
  Py_ssize_t __pyx_t_146;
  Py_ssize_t __pyx_t_147;
  Py_ssize_t __pyx_t_148;
  Py_ssize_t __pyx_t_149;
  Py_ssize_t __pyx_t_150;
  Py_ssize_t __pyx_t_151;
  Py_ssize_t __pyx_t_152;
  Py_ssize_t __pyx_t_153;
  Py_ssize_t __pyx_t_154;
  Py_ssize_t __pyx_t_155;
  Py_ssize_t __pyx_t_156;
  Py_ssize_t __pyx_t_157;
  Py_ssize_t __pyx_t_158;
  Py_ssize_t __pyx_t_159;
  Py_ssize_t __pyx_t_160;
  Py_ssize_t __pyx_t_161;
  Py_ssize_t __pyx_t_162;
  Py_ssize_t __pyx_t_163;
  Py_ssize_t __pyx_t_164;
  Py_ssize_t __pyx_t_165;
  Py_ssize_t __pyx_t_166;
  Py_ssize_t __pyx_t_167;
  Py_ssize_t __pyx_t_168;
  Py_ssize_t __pyx_t_169;
  Py_ssize_t __pyx_t_170;
  Py_ssize_t __pyx_t_171;
  Py_ssize_t __pyx_t_172;
  Py_ssize_t __pyx_t_173;
  Py_ssize_t __pyx_t_174;
  Py_ssize_t __pyx_t_175;
  Py_ssize_t __pyx_t_176;
  Py_ssize_t __pyx_t_177;
  Py_ssize_t __pyx_t_178;
  Py_ssize_t __pyx_t_179;
  Py_ssize_t __pyx_t_180;
  Py_ssize_t __pyx_t_181;
  Py_ssize_t __pyx_t_182;
  Py_ssize_t __pyx_t_183;
  Py_ssize_t __pyx_t_184;
  Py_ssize_t __pyx_t_185;
  Py_ssize_t __pyx_t_186;
  Py_ssize_t __pyx_t_187;
  Py_ssize_t __pyx_t_188;
  Py_ssize_t __pyx_t_189;
  Py_ssize_t __pyx_t_190;
  Py_ssize_t __pyx_t_191;
  Py_ssize_t __pyx_t_192;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_193;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_194;
  Py_ssize_t __pyx_t_195;
  int __pyx_t_196;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_197;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_198;
  Py_ssize_t __pyx_t_199;
  Py_ssize_t __pyx_t_200;
  Py_ssize_t __pyx_t_201;
  Py_ssize_t __pyx_t_202;
  int __pyx_t_203;
  Py_ssize_t __pyx_t_204;
  Py_ssize_t __pyx_t_205;
  Py_ssize_t __pyx_t_206;
  Py_ssize_t __pyx_t_207;
  Py_ssize_t __pyx_t_208;
  Py_ssize_t __pyx_t_209;
  Py_ssize_t __pyx_t_210;
  Py_ssize_t __pyx_t_211;
  Py_ssize_t __pyx_t_212;
  Py_ssize_t __pyx_t_213;
  Py_ssize_t __pyx_t_214;
  Py_ssize_t __pyx_t_215;
  Py_ssize_t __pyx_t_216;
  Py_ssize_t __pyx_t_217;
  Py_ssize_t __pyx_t_218;
  Py_ssize_t __pyx_t_219;
  Py_ssize_t __pyx_t_220;
  Py_ssize_t __pyx_t_221;
  Py_ssize_t __pyx_t_222;
  Py_ssize_t __pyx_t_223;
  float __pyx_t_224;
  Py_ssize_t __pyx_t_225;
  Py_ssize_t __pyx_t_226;
  Py_ssize_t __pyx_t_227;
  Py_ssize_t __pyx_t_228;
  Py_ssize_t __pyx_t_229;
  Py_ssize_t __pyx_t_230;
  Py_ssize_t __pyx_t_231;
  Py_ssize_t __pyx_t_232;
  Py_ssize_t __pyx_t_233;
  Py_ssize_t __pyx_t_234;
  Py_ssize_t __pyx_t_235;
  Py_ssize_t __pyx_t_236;
  Py_ssize_t __pyx_t_237;
  Py_ssize_t __pyx_t_238;
  Py_ssize_t __pyx_t_239;
  Py_ssize_t __pyx_t_240;
  Py_ssize_t __pyx_t_241;
  Py_ssize_t __pyx_t_242;
  Py_ssize_t __pyx_t_243;
  Py_ssize_t __pyx_t_244;
  Py_ssize_t __pyx_t_245;
  Py_ssize_t __pyx_t_246;
  Py_ssize_t __pyx_t_247;
  Py_ssize_t __pyx_t_248;
  Py_ssize_t __pyx_t_249;
  Py_ssize_t __pyx_t_250;
  Py_ssize_t __pyx_t_251;
  Py_ssize_t __pyx_t_252;
  Py_ssize_t __pyx_t_253;
  Py_ssize_t __pyx_t_254;
  Py_ssize_t __pyx_t_255;
  Py_ssize_t __pyx_t_256;
  Py_ssize_t __pyx_t_257;
  Py_ssize_t __pyx_t_258;
  Py_ssize_t __pyx_t_259;
  Py_ssize_t __pyx_t_260;
  Py_ssize_t __pyx_t_261;
  Py_ssize_t __pyx_t_262;
  Py_ssize_t __pyx_t_263;
  Py_ssize_t __pyx_t_264;
  Py_ssize_t __pyx_t_265;
  Py_ssize_t __pyx_t_266;
  Py_ssize_t __pyx_t_267;
  Py_ssize_t __pyx_t_268;
  Py_ssize_t __pyx_t_269;
  Py_ssize_t __pyx_t_270;
  Py_ssize_t __pyx_t_271;
  Py_ssize_t __pyx_t_272;
  Py_ssize_t __pyx_t_273;
  Py_ssize_t __pyx_t_274;
  Py_ssize_t __pyx_t_275;
  Py_ssize_t __pyx_t_276;
  Py_ssize_t __pyx_t_277;
  Py_ssize_t __pyx_t_278;
  Py_ssize_t __pyx_t_279;
  Py_ssize_t __pyx_t_280;
  Py_ssize_t __pyx_t_281;
  Py_ssize_t __pyx_t_282;
  Py_ssize_t __pyx_t_283;
  Py_ssize_t __pyx_t_284;
  Py_ssize_t __pyx_t_285;
  Py_ssize_t __pyx_t_286;
  Py_ssize_t __pyx_t_287;
  Py_ssize_t __pyx_t_288;
  Py_ssize_t __pyx_t_289;
  Py_ssize_t __pyx_t_290;
  Py_ssize_t __pyx_t_291;
  Py_ssize_t __pyx_t_292;
  Py_ssize_t __pyx_t_293;
  Py_ssize_t __pyx_t_294;
  Py_ssize_t __pyx_t_295;
  Py_ssize_t __pyx_t_296;
  Py_ssize_t __pyx_t_297;
  Py_ssize_t __pyx_t_298;
  Py_ssize_t __pyx_t_299;
  Py_ssize_t __pyx_t_300;
  Py_ssize_t __pyx_t_301;
  Py_ssize_t __pyx_t_302;
  Py_ssize_t __pyx_t_303;
  Py_ssize_t __pyx_t_304;
  Py_ssize_t __pyx_t_305;
  Py_ssize_t __pyx_t_306;
  Py_ssize_t __pyx_t_307;
  Py_ssize_t __pyx_t_308;
  Py_ssize_t __pyx_t_309;
  Py_ssize_t __pyx_t_310;
  Py_ssize_t __pyx_t_311;
  Py_ssize_t __pyx_t_312;
  Py_ssize_t __pyx_t_313;
  int __pyx_t_314;
  Py_ssize_t __pyx_t_315;
  PyObject *__pyx_t_316 = NULL;
  PyObject *__pyx_t_317 = NULL;
  PyObject *__pyx_t_318 = NULL;
  int __pyx_t_319;
  Py_ssize_t __pyx_t_320;
  Py_ssize_t __pyx_t_321;
  int __pyx_t_322;
  Py_ssize_t __pyx_t_323;
  Py_ssize_t __pyx_t_324;
  Py_ssize_t __pyx_t_325;
  Py_ssize_t __pyx_t_326;
  Py_ssize_t __pyx_t_327;
  Py_ssize_t __pyx_t_328;
  Py_ssize_t __pyx_t_329;
  Py_ssize_t __pyx_t_330;
  Py_ssize_t __pyx_t_331;
  Py_ssize_t __pyx_t_332;
  Py_ssize_t __pyx_t_333;
  Py_ssize_t __pyx_t_334;
  Py_ssize_t __pyx_t_335;
  Py_ssize_t __pyx_t_336;
  Py_ssize_t __pyx_t_337;
  Py_ssize_t __pyx_t_338;
  Py_ssize_t __pyx_t_339;
  Py_ssize_t __pyx_t_340;
  Py_ssize_t __pyx_t_341;
  Py_ssize_t __pyx_t_342;
  Py_ssize_t __pyx_t_343;
  Py_ssize_t __pyx_t_344;
  Py_ssize_t __pyx_t_345;
  Py_ssize_t __pyx_t_346;
  Py_ssize_t __pyx_t_347;
  Py_ssize_t __pyx_t_348;
  Py_ssize_t __pyx_t_349;
  Py_ssize_t __pyx_t_350;
  Py_ssize_t __pyx_t_351;
  Py_ssize_t __pyx_t_352;
  Py_ssize_t __pyx_t_353;
  Py_ssize_t __pyx_t_354;
  Py_ssize_t __pyx_t_355;
  Py_ssize_t __pyx_t_356;
  Py_ssize_t __pyx_t_357;
  Py_ssize_t __pyx_t_358;
  Py_ssize_t __pyx_t_359;
  Py_ssize_t __pyx_t_360;
  Py_ssize_t __pyx_t_361;
  Py_ssize_t __pyx_t_362;
  Py_ssize_t __pyx_t_363;
  Py_ssize_t __pyx_t_364;
  Py_ssize_t __pyx_t_365;
  Py_ssize_t __pyx_t_366;
  Py_ssize_t __pyx_t_367;
  Py_ssize_t __pyx_t_368;
  Py_ssize_t __pyx_t_369;
  Py_ssize_t __pyx_t_370;
  Py_ssize_t __pyx_t_371;
  Py_ssize_t __pyx_t_372;
  Py_ssize_t __pyx_t_373;
  Py_ssize_t __pyx_t_374;
  Py_ssize_t __pyx_t_375;
  Py_ssize_t __pyx_t_376;
  Py_ssize_t __pyx_t_377;
  Py_ssize_t __pyx_t_378;
  Py_ssize_t __pyx_t_379;
  Py_ssize_t __pyx_t_380;
  Py_ssize_t __pyx_t_381;
  Py_ssize_t __pyx_t_382;
  Py_ssize_t __pyx_t_383;
  Py_ssize_t __pyx_t_384;
  Py_ssize_t __pyx_t_385;
  Py_ssize_t __pyx_t_386;
  Py_ssize_t __pyx_t_387;
  Py_ssize_t __pyx_t_388;
  Py_ssize_t __pyx_t_389;
  Py_ssize_t __pyx_t_390;
  Py_ssize_t __pyx_t_391;
  Py_ssize_t __pyx_t_392;
  Py_ssize_t __pyx_t_393;
  Py_ssize_t __pyx_t_394;
  Py_ssize_t __pyx_t_395;
  Py_ssize_t __pyx_t_396;
  Py_ssize_t __pyx_t_397;
  Py_ssize_t __pyx_t_398;
  Py_ssize_t __pyx_t_399;
  Py_ssize_t __pyx_t_400;
  Py_ssize_t __pyx_t_401;
  Py_ssize_t __pyx_t_402;
  Py_ssize_t __pyx_t_403;
  Py_ssize_t __pyx_t_404;
  Py_ssize_t __pyx_t_405;
  Py_ssize_t __pyx_t_406;
  Py_ssize_t __pyx_t_407;
  Py_ssize_t __pyx_t_408;
  Py_ssize_t __pyx_t_409;
  Py_ssize_t __pyx_t_410;
  Py_ssize_t __pyx_t_411;
  Py_ssize_t __pyx_t_412;
  Py_ssize_t __pyx_t_413;
  Py_ssize_t __pyx_t_414;
  Py_ssize_t __pyx_t_415;
  Py_ssize_t __pyx_t_416;
  Py_ssize_t __pyx_t_417;
  Py_ssize_t __pyx_t_418;
  Py_ssize_t __pyx_t_419;
  Py_ssize_t __pyx_t_420;
  Py_ssize_t __pyx_t_421;
  Py_ssize_t __pyx_t_422;
  Py_ssize_t __pyx_t_423;
  Py_ssize_t __pyx_t_424;
  Py_ssize_t __pyx_t_425;
  Py_ssize_t __pyx_t_426;
  Py_ssize_t __pyx_t_427;
  Py_ssize_t __pyx_t_428;
  Py_ssize_t __pyx_t_429;
  Py_ssize_t __pyx_t_430;
  Py_ssize_t __pyx_t_431;
  Py_ssize_t __pyx_t_432;
  Py_ssize_t __pyx_t_433;
  Py_ssize_t __pyx_t_434;
  Py_ssize_t __pyx_t_435;
  Py_ssize_t __pyx_t_436;
  Py_ssize_t __pyx_t_437;
  Py_ssize_t __pyx_t_438;
  Py_ssize_t __pyx_t_439;
  Py_ssize_t __pyx_t_440;
  Py_ssize_t __pyx_t_441;
  Py_ssize_t __pyx_t_442;
  Py_ssize_t __pyx_t_443;
  Py_ssize_t __pyx_t_444;
  Py_ssize_t __pyx_t_445;
  Py_ssize_t __pyx_t_446;
  Py_ssize_t __pyx_t_447;
  Py_ssize_t __pyx_t_448;
  Py_ssize_t __pyx_t_449;
  Py_ssize_t __pyx_t_450;
  Py_ssize_t __pyx_t_451;
  Py_ssize_t __pyx_t_452;
  Py_ssize_t __pyx_t_453;
  Py_ssize_t __pyx_t_454;
  Py_ssize_t __pyx_t_455;
  Py_ssize_t __pyx_t_456;
  Py_ssize_t __pyx_t_457;
  Py_ssize_t __pyx_t_458;
  Py_ssize_t __pyx_t_459;
  Py_ssize_t __pyx_t_460;
  Py_ssize_t __pyx_t_461;
  Py_ssize_t __pyx_t_462;
  Py_ssize_t __pyx_t_463;
  Py_ssize_t __pyx_t_464;
  int __pyx_t_465;
  Py_ssize_t __pyx_t_466;
  Py_ssize_t __pyx_t_467;
  Py_ssize_t __pyx_t_468;
  Py_ssize_t __pyx_t_469;
  Py_ssize_t __pyx_t_470;
  Py_ssize_t __pyx_t_471;
  Py_ssize_t __pyx_t_472;
  Py_ssize_t __pyx_t_473;
  Py_ssize_t __pyx_t_474;
  Py_ssize_t __pyx_t_475;
  Py_ssize_t __pyx_t_476;
  Py_ssize_t __pyx_t_477;
  Py_ssize_t __pyx_t_478;
  Py_ssize_t __pyx_t_479;
  Py_ssize_t __pyx_t_480;
  Py_ssize_t __pyx_t_481;
  Py_ssize_t __pyx_t_482;
  Py_ssize_t __pyx_t_483;
  Py_ssize_t __pyx_t_484;
  Py_ssize_t __pyx_t_485;
  Py_ssize_t __pyx_t_486;
  Py_ssize_t __pyx_t_487;
  Py_ssize_t __pyx_t_488;
  Py_ssize_t __pyx_t_489;
  Py_ssize_t __pyx_t_490;
  Py_ssize_t __pyx_t_491;
  Py_ssize_t __pyx_t_492;
  Py_ssize_t __pyx_t_493;
  Py_ssize_t __pyx_t_494;
  Py_ssize_t __pyx_t_495;
  Py_ssize_t __pyx_t_496;
  Py_ssize_t __pyx_t_497;
  Py_ssize_t __pyx_t_498;
  Py_ssize_t __pyx_t_499;
  Py_ssize_t __pyx_t_500;
  Py_ssize_t __pyx_t_501;
  Py_ssize_t __pyx_t_502;
  Py_ssize_t __pyx_t_503;
  Py_ssize_t __pyx_t_504;
  Py_ssize_t __pyx_t_505;
  Py_ssize_t __pyx_t_506;
  Py_ssize_t __pyx_t_507;
  Py_ssize_t __pyx_t_508;
  Py_ssize_t __pyx_t_509;
  Py_ssize_t __pyx_t_510;
  Py_ssize_t __pyx_t_511;
  Py_ssize_t __pyx_t_512;
  Py_ssize_t __pyx_t_513;
  Py_ssize_t __pyx_t_514;
  Py_ssize_t __pyx_t_515;
  Py_ssize_t __pyx_t_516;
  Py_ssize_t __pyx_t_517;
  Py_ssize_t __pyx_t_518;
  Py_ssize_t __pyx_t_519;
  Py_ssize_t __pyx_t_520;
  Py_ssize_t __pyx_t_521;
  Py_ssize_t __pyx_t_522;
  Py_ssize_t __pyx_t_523;
  Py_ssize_t __pyx_t_524;
  Py_ssize_t __pyx_t_525;
  Py_ssize_t __pyx_t_526;
  Py_ssize_t __pyx_t_527;
  Py_ssize_t __pyx_t_528;
  Py_ssize_t __pyx_t_529;
  Py_ssize_t __pyx_t_530;
  Py_ssize_t __pyx_t_531;
  Py_ssize_t __pyx_t_532;
  Py_ssize_t __pyx_t_533;
  Py_ssize_t __pyx_t_534;
  Py_ssize_t __pyx_t_535;
  Py_ssize_t __pyx_t_536;
  Py_ssize_t __pyx_t_537;
  Py_ssize_t __pyx_t_538;
  Py_ssize_t __pyx_t_539;
  Py_ssize_t __pyx_t_540;
  Py_ssize_t __pyx_t_541;
  Py_ssize_t __pyx_t_542;
  Py_ssize_t __pyx_t_543;
  Py_ssize_t __pyx_t_544;
  Py_ssize_t __pyx_t_545;
  Py_ssize_t __pyx_t_546;
  Py_ssize_t __pyx_t_547;
  Py_ssize_t __pyx_t_548;
  Py_ssize_t __pyx_t_549;
  Py_ssize_t __pyx_t_550;
  Py_ssize_t __pyx_t_551;
  Py_ssize_t __pyx_t_552;
  Py_ssize_t __pyx_t_553;
  Py_ssize_t __pyx_t_554;
  Py_ssize_t __pyx_t_555;
  Py_ssize_t __pyx_t_556;
  Py_ssize_t __pyx_t_557;
  Py_ssize_t __pyx_t_558;
  Py_ssize_t __pyx_t_559;
  Py_ssize_t __pyx_t_560;
  Py_ssize_t __pyx_t_561;
  Py_ssize_t __pyx_t_562;
  Py_ssize_t __pyx_t_563;
  Py_ssize_t __pyx_t_564;
  Py_ssize_t __pyx_t_565;
  Py_ssize_t __pyx_t_566;
  __Pyx_RefNannySetupContext("WiDIM", 0);
  __Pyx_INCREF(__pyx_v_validation_method);
  __pyx_pybuffer_Nrow.pybuffer.buf = NULL;
  __pyx_pybuffer_Nrow.refcount = 0;
  __pyx_pybuffernd_Nrow.data = NULL;
  __pyx_pybuffernd_Nrow.rcbuffer = &__pyx_pybuffer_Nrow;
  __pyx_pybuffer_Ncol.pybuffer.buf = NULL;
  __pyx_pybuffer_Ncol.refcount = 0;
  __pyx_pybuffernd_Ncol.data = NULL;
  __pyx_pybuffernd_Ncol.rcbuffer = &__pyx_pybuffer_Ncol;
  __pyx_pybuffer_W.pybuffer.buf = NULL;
  __pyx_pybuffer_W.refcount = 0;
  __pyx_pybuffernd_W.data = NULL;
  __pyx_pybuffernd_W.rcbuffer = &__pyx_pybuffer_W;
  __pyx_pybuffer_Overlap.pybuffer.buf = NULL;
  __pyx_pybuffer_Overlap.refcount = 0;
  __pyx_pybuffernd_Overlap.data = NULL;
  __pyx_pybuffernd_Overlap.rcbuffer = &__pyx_pybuffer_Overlap;
  __pyx_pybuffer_F.pybuffer.buf = NULL;
  __pyx_pybuffer_F.refcount = 0;
  __pyx_pybuffernd_F.data = NULL;
  __pyx_pybuffernd_F.rcbuffer = &__pyx_pybuffer_F;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_u.pybuffer.buf = NULL;
  __pyx_pybuffer_u.refcount = 0;
  __pyx_pybuffernd_u.data = NULL;
  __pyx_pybuffernd_u.rcbuffer = &__pyx_pybuffer_u;
  __pyx_pybuffer_v.pybuffer.buf = NULL;
  __pyx_pybuffer_v.refcount = 0;
  __pyx_pybuffernd_v.data = NULL;
  __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
  __pyx_pybuffer_x.pybuffer.buf = NULL;
  __pyx_pybuffer_x.refcount = 0;
  __pyx_pybuffernd_x.data = NULL;
  __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  __pyx_pybuffer_y.pybuffer.buf = NULL;
  __pyx_pybuffer_y.refcount = 0;
  __pyx_pybuffernd_y.data = NULL;
  __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y;
  __pyx_pybuffer_neighbours.pybuffer.buf = NULL;
  __pyx_pybuffer_neighbours.refcount = 0;
  __pyx_pybuffernd_neighbours.data = NULL;
  __pyx_pybuffernd_neighbours.rcbuffer = &__pyx_pybuffer_neighbours;
  __pyx_pybuffer_neighbours_present.pybuffer.buf = NULL;
  __pyx_pybuffer_neighbours_present.refcount = 0;
  __pyx_pybuffernd_neighbours_present.data = NULL;
  __pyx_pybuffernd_neighbours_present.rcbuffer = &__pyx_pybuffer_neighbours_present;
  __pyx_pybuffer_frame_a.pybuffer.buf = NULL;
  __pyx_pybuffer_frame_a.refcount = 0;
  __pyx_pybuffernd_frame_a.data = NULL;
  __pyx_pybuffernd_frame_a.rcbuffer = &__pyx_pybuffer_frame_a;
  __pyx_pybuffer_frame_b.pybuffer.buf = NULL;
  __pyx_pybuffer_frame_b.refcount = 0;
  __pyx_pybuffernd_frame_b.data = NULL;
  __pyx_pybuffernd_frame_b.rcbuffer = &__pyx_pybuffer_frame_b;
  __pyx_pybuffer_mark.pybuffer.buf = NULL;
  __pyx_pybuffer_mark.refcount = 0;
  __pyx_pybuffernd_mark.data = NULL;
  __pyx_pybuffernd_mark.rcbuffer = &__pyx_pybuffer_mark;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_frame_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_frame_a, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 536, __pyx_L1_error)
  }
  __pyx_pybuffernd_frame_a.diminfo[0].strides = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_frame_a.diminfo[0].shape = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_frame_a.diminfo[1].strides = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_frame_a.diminfo[1].shape = __pyx_pybuffernd_frame_a.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_frame_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_frame_b, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 536, __pyx_L1_error)
  }
  __pyx_pybuffernd_frame_b.diminfo[0].strides = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_frame_b.diminfo[0].shape = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_frame_b.diminfo[1].strides = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_frame_b.diminfo[1].shape = __pyx_pybuffernd_frame_b.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mark.rcbuffer->pybuffer, (PyObject*)__pyx_v_mark, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 536, __pyx_L1_error)
  }
  __pyx_pybuffernd_mark.diminfo[0].strides = __pyx_pybuffernd_mark.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mark.diminfo[0].shape = __pyx_pybuffernd_mark.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mark.diminfo[1].strides = __pyx_pybuffernd_mark.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mark.diminfo[1].shape = __pyx_pybuffernd_mark.rcbuffer->pybuffer.shape[1];

  /* "openpiv/process.pyx":687
 *     #initializations
 *     # warnings.warn("deprecated", RuntimeWarning)
 *     if nb_iter_max <= coarse_factor:             # <<<<<<<<<<<<<<
 *         raise ValueError( "Please provide a nb_iter_max that is greater than the coarse_level" )
 *     cdef int K #main iteration index
 */
  __pyx_t_1 = ((__pyx_v_nb_iter_max <= __pyx_v_coarse_factor) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "openpiv/process.pyx":688
 *     # warnings.warn("deprecated", RuntimeWarning)
 *     if nb_iter_max <= coarse_factor:
 *         raise ValueError( "Please provide a nb_iter_max that is greater than the coarse_level" )             # <<<<<<<<<<<<<<
 *     cdef int K #main iteration index
 *     cdef int I, J #interrogation locations indices
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 688, __pyx_L1_error)

    /* "openpiv/process.pyx":687
 *     #initializations
 *     # warnings.warn("deprecated", RuntimeWarning)
 *     if nb_iter_max <= coarse_factor:             # <<<<<<<<<<<<<<
 *         raise ValueError( "Please provide a nb_iter_max that is greater than the coarse_level" )
 *     cdef int K #main iteration index
 */
  }

  /* "openpiv/process.pyx":696
 *     cdef float i_peak, j_peak, mean_u, mean_v, rms_u, rms_v, residual_0
 *     cdef int residual, nbwind
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Nrow = np.zeros(nb_iter_max, dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Ncol = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] W = np.zeros(nb_iter_max, dtype=DTYPEi)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nb_iter_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 696, __pyx_L1_error)
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Nrow.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_Nrow = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 696, __pyx_L1_error)
    } else {__pyx_pybuffernd_Nrow.diminfo[0].strides = __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Nrow.diminfo[0].shape = __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_Nrow = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "openpiv/process.pyx":697
 *     cdef int residual, nbwind
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Nrow = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Ncol = np.zeros(nb_iter_max, dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=1] W = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Overlap = np.zeros(nb_iter_max, dtype=DTYPEi)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nb_iter_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __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_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 697, __pyx_L1_error)
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ncol.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_Ncol = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 697, __pyx_L1_error)
    } else {__pyx_pybuffernd_Ncol.diminfo[0].strides = __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Ncol.diminfo[0].shape = __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_Ncol = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "openpiv/process.pyx":698
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Nrow = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Ncol = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] W = np.zeros(nb_iter_max, dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Overlap = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     pic_size=frame_a.shape
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nb_iter_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 698, __pyx_L1_error)
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_W.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_W = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_W.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 698, __pyx_L1_error)
    } else {__pyx_pybuffernd_W.diminfo[0].strides = __pyx_pybuffernd_W.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_W.diminfo[0].shape = __pyx_pybuffernd_W.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_W = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "openpiv/process.pyx":699
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Ncol = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] W = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Overlap = np.zeros(nb_iter_max, dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     pic_size=frame_a.shape
 *     #window sizes list initialization
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nb_iter_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 699, __pyx_L1_error)
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Overlap.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_Overlap = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 699, __pyx_L1_error)
    } else {__pyx_pybuffernd_Overlap.diminfo[0].strides = __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Overlap.diminfo[0].shape = __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_9 = 0;
  __pyx_v_Overlap = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "openpiv/process.pyx":700
 *     cdef np.ndarray[DTYPEi_t, ndim=1] W = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Overlap = np.zeros(nb_iter_max, dtype=DTYPEi)
 *     pic_size=frame_a.shape             # <<<<<<<<<<<<<<
 *     #window sizes list initialization
 *     for K in range(coarse_factor+1):
 */
  __pyx_t_10 = __pyx_v_frame_a->dimensions;
  __pyx_v_pic_size = __pyx_t_10;

  /* "openpiv/process.pyx":702
 *     pic_size=frame_a.shape
 *     #window sizes list initialization
 *     for K in range(coarse_factor+1):             # <<<<<<<<<<<<<<
 *         W[K]=np.power(2,coarse_factor-K)*min_window_size
 *     for K in range(coarse_factor+1,nb_iter_max):
 */
  __pyx_t_11 = (__pyx_v_coarse_factor + 1);
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_K = __pyx_t_13;

    /* "openpiv/process.pyx":703
 *     #window sizes list initialization
 *     for K in range(coarse_factor+1):
 *         W[K]=np.power(2,coarse_factor-K)*min_window_size             # <<<<<<<<<<<<<<
 *     for K in range(coarse_factor+1,nb_iter_max):
 *         W[K]=W[K-1]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_coarse_factor - __pyx_v_K)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_14 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_14 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_2, __pyx_t_2};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_2, __pyx_t_2};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_int_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_min_window_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_15 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_15); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_17 = __pyx_v_K;
    __pyx_t_14 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_14 = 0;
    if (unlikely(__pyx_t_14 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_14);
      __PYX_ERR(0, 703, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_W.diminfo[0].strides) = __pyx_t_16;
  }

  /* "openpiv/process.pyx":704
 *     for K in range(coarse_factor+1):
 *         W[K]=np.power(2,coarse_factor-K)*min_window_size
 *     for K in range(coarse_factor+1,nb_iter_max):             # <<<<<<<<<<<<<<
 *         W[K]=W[K-1]
 *     #overlap init
 */
  __pyx_t_13 = __pyx_v_nb_iter_max;
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_18 = (__pyx_v_coarse_factor + 1); __pyx_t_18 < __pyx_t_14; __pyx_t_18+=1) {
    __pyx_v_K = __pyx_t_18;

    /* "openpiv/process.pyx":705
 *         W[K]=np.power(2,coarse_factor-K)*min_window_size
 *     for K in range(coarse_factor+1,nb_iter_max):
 *         W[K]=W[K-1]             # <<<<<<<<<<<<<<
 *     #overlap init
 *     for K in range(nb_iter_max):
 */
    __pyx_t_19 = (__pyx_v_K - 1);
    __pyx_t_20 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 705, __pyx_L1_error)
    }
    __pyx_t_21 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_21 < 0) {
      __pyx_t_21 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_21 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 705, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_W.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_W.diminfo[0].strides));
  }

  /* "openpiv/process.pyx":707
 *         W[K]=W[K-1]
 *     #overlap init
 *     for K in range(nb_iter_max):             # <<<<<<<<<<<<<<
 *         Overlap[K]=int(np.floor(overlap_ratio*W[K]))
 *     #Ncol and Nrow init
 */
  __pyx_t_13 = __pyx_v_nb_iter_max;
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_14; __pyx_t_18+=1) {
    __pyx_v_K = __pyx_t_18;

    /* "openpiv/process.pyx":708
 *     #overlap init
 *     for K in range(nb_iter_max):
 *         Overlap[K]=int(np.floor(overlap_ratio*W[K]))             # <<<<<<<<<<<<<<
 *     #Ncol and Nrow init
 *     for K in range(nb_iter_max):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_22 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 708, __pyx_L1_error)
    }
    __pyx_t_4 = PyFloat_FromDouble((__pyx_v_overlap_ratio * (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_W.diminfo[0].strides)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_15 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_5); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_23 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_23 < 0) {
      __pyx_t_23 += __pyx_pybuffernd_Overlap.diminfo[0].shape;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_Overlap.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 708, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_Overlap.diminfo[0].strides) = __pyx_t_16;
  }

  /* "openpiv/process.pyx":710
 *         Overlap[K]=int(np.floor(overlap_ratio*W[K]))
 *     #Ncol and Nrow init
 *     for K in range(nb_iter_max):             # <<<<<<<<<<<<<<
 *         Nrow[K]=((pic_size[0]-W[K])//(W[K]-Overlap[K]))+1
 *         Ncol[K]=((pic_size[1]-W[K])//(W[K]-Overlap[K]))+1
 */
  __pyx_t_13 = __pyx_v_nb_iter_max;
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_14; __pyx_t_18+=1) {
    __pyx_v_K = __pyx_t_18;

    /* "openpiv/process.pyx":711
 *     #Ncol and Nrow init
 *     for K in range(nb_iter_max):
 *         Nrow[K]=((pic_size[0]-W[K])//(W[K]-Overlap[K]))+1             # <<<<<<<<<<<<<<
 *         Ncol[K]=((pic_size[1]-W[K])//(W[K]-Overlap[K]))+1
 *     #writting the parameters to the screen
 */
    __pyx_t_24 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_24 < 0) {
      __pyx_t_24 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_24 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    __pyx_t_16 = ((__pyx_v_pic_size[0]) - (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_W.diminfo[0].strides)));
    __pyx_t_25 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_25 < 0) {
      __pyx_t_25 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_25 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    __pyx_t_26 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_26 < 0) {
      __pyx_t_26 += __pyx_pybuffernd_Overlap.diminfo[0].shape;
      if (unlikely(__pyx_t_26 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_Overlap.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    __pyx_t_27 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_W.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_Overlap.diminfo[0].strides)));
    if (unlikely(__pyx_t_27 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    else if (sizeof(__pyx_t_7openpiv_7process_DTYPEi_t) == sizeof(long) && (!(((__pyx_t_7openpiv_7process_DTYPEi_t)-1) > 0)) && unlikely(__pyx_t_27 == (__pyx_t_7openpiv_7process_DTYPEi_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_16))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    __pyx_t_28 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_28 < 0) {
      __pyx_t_28 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
      if (unlikely(__pyx_t_28 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_Nrow.diminfo[0].strides) = (__Pyx_div___pyx_t_7openpiv_7process_DTYPEi_t(__pyx_t_16, __pyx_t_27) + 1);

    /* "openpiv/process.pyx":712
 *     for K in range(nb_iter_max):
 *         Nrow[K]=((pic_size[0]-W[K])//(W[K]-Overlap[K]))+1
 *         Ncol[K]=((pic_size[1]-W[K])//(W[K]-Overlap[K]))+1             # <<<<<<<<<<<<<<
 *     #writting the parameters to the screen
 *     if validation_iter==0:
 */
    __pyx_t_29 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_29 < 0) {
      __pyx_t_29 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_29 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 712, __pyx_L1_error)
    }
    __pyx_t_27 = ((__pyx_v_pic_size[1]) - (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_W.diminfo[0].strides)));
    __pyx_t_30 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_30 < 0) {
      __pyx_t_30 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_30 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 712, __pyx_L1_error)
    }
    __pyx_t_31 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_31 < 0) {
      __pyx_t_31 += __pyx_pybuffernd_Overlap.diminfo[0].shape;
      if (unlikely(__pyx_t_31 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_Overlap.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 712, __pyx_L1_error)
    }
    __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_W.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_Overlap.diminfo[0].strides)));
    if (unlikely(__pyx_t_16 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 712, __pyx_L1_error)
    }
    else if (sizeof(__pyx_t_7openpiv_7process_DTYPEi_t) == sizeof(long) && (!(((__pyx_t_7openpiv_7process_DTYPEi_t)-1) > 0)) && unlikely(__pyx_t_16 == (__pyx_t_7openpiv_7process_DTYPEi_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_27))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 712, __pyx_L1_error)
    }
    __pyx_t_32 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_32 < 0) {
      __pyx_t_32 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
      if (unlikely(__pyx_t_32 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 712, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_Ncol.diminfo[0].strides) = (__Pyx_div___pyx_t_7openpiv_7process_DTYPEi_t(__pyx_t_27, __pyx_t_16) + 1);
  }

  /* "openpiv/process.pyx":714
 *         Ncol[K]=((pic_size[1]-W[K])//(W[K]-Overlap[K]))+1
 *     #writting the parameters to the screen
 *     if validation_iter==0:             # <<<<<<<<<<<<<<
 *         validation_method='None'
 *     cdef float startTime = launch(method='WiDIM', names=['Size of image', 'total number of iterations', 'overlap ratio', 'coarse factor', 'time step', 'validation method', 'number of validation iterations', 'subpixel_method','Nrow', 'Ncol', 'Window sizes', 'overlaps'], arg=[[pic_size[0], pic_size[1]], nb_iter_max, overlap_ratio, coarse_factor, dt, validation_method, validation_iter,  subpixel_method, Nrow, Ncol, W, Overlap])
 */
  __pyx_t_1 = ((__pyx_v_validation_iter == 0) != 0);
  if (__pyx_t_1) {

    /* "openpiv/process.pyx":715
 *     #writting the parameters to the screen
 *     if validation_iter==0:
 *         validation_method='None'             # <<<<<<<<<<<<<<
 *     cdef float startTime = launch(method='WiDIM', names=['Size of image', 'total number of iterations', 'overlap ratio', 'coarse factor', 'time step', 'validation method', 'number of validation iterations', 'subpixel_method','Nrow', 'Ncol', 'Window sizes', 'overlaps'], arg=[[pic_size[0], pic_size[1]], nb_iter_max, overlap_ratio, coarse_factor, dt, validation_method, validation_iter,  subpixel_method, Nrow, Ncol, W, Overlap])
 *     #define the main array F that contains all the data
 */
    __Pyx_INCREF(__pyx_n_s_None);
    __Pyx_DECREF_SET(__pyx_v_validation_method, __pyx_n_s_None);

    /* "openpiv/process.pyx":714
 *         Ncol[K]=((pic_size[1]-W[K])//(W[K]-Overlap[K]))+1
 *     #writting the parameters to the screen
 *     if validation_iter==0:             # <<<<<<<<<<<<<<
 *         validation_method='None'
 *     cdef float startTime = launch(method='WiDIM', names=['Size of image', 'total number of iterations', 'overlap ratio', 'coarse factor', 'time step', 'validation method', 'number of validation iterations', 'subpixel_method','Nrow', 'Ncol', 'Window sizes', 'overlaps'], arg=[[pic_size[0], pic_size[1]], nb_iter_max, overlap_ratio, coarse_factor, dt, validation_method, validation_iter,  subpixel_method, Nrow, Ncol, W, Overlap])
 */
  }

  /* "openpiv/process.pyx":716
 *     if validation_iter==0:
 *         validation_method='None'
 *     cdef float startTime = launch(method='WiDIM', names=['Size of image', 'total number of iterations', 'overlap ratio', 'coarse factor', 'time step', 'validation method', 'number of validation iterations', 'subpixel_method','Nrow', 'Ncol', 'Window sizes', 'overlaps'], arg=[[pic_size[0], pic_size[1]], nb_iter_max, overlap_ratio, coarse_factor, dt, validation_method, validation_iter,  subpixel_method, Nrow, Ncol, W, Overlap])             # <<<<<<<<<<<<<<
 *     #define the main array F that contains all the data
 *     cdef np.ndarray[DTYPEf_t, ndim=4] F = np.zeros([nb_iter_max, Nrow[nb_iter_max-1], Ncol[nb_iter_max-1], 14], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_launch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_15 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_method, __pyx_n_s_WiDIM) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
  __pyx_t_4 = PyList_New(12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_kp_s_Size_of_image);
  __Pyx_GIVEREF(__pyx_kp_s_Size_of_image);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Size_of_image);
  __Pyx_INCREF(__pyx_kp_s_total_number_of_iterations);
  __Pyx_GIVEREF(__pyx_kp_s_total_number_of_iterations);
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_kp_s_total_number_of_iterations);
  __Pyx_INCREF(__pyx_kp_s_overlap_ratio_2);
  __Pyx_GIVEREF(__pyx_kp_s_overlap_ratio_2);
  PyList_SET_ITEM(__pyx_t_4, 2, __pyx_kp_s_overlap_ratio_2);
  __Pyx_INCREF(__pyx_kp_s_coarse_factor_2);
  __Pyx_GIVEREF(__pyx_kp_s_coarse_factor_2);
  PyList_SET_ITEM(__pyx_t_4, 3, __pyx_kp_s_coarse_factor_2);
  __Pyx_INCREF(__pyx_kp_s_time_step);
  __Pyx_GIVEREF(__pyx_kp_s_time_step);
  PyList_SET_ITEM(__pyx_t_4, 4, __pyx_kp_s_time_step);
  __Pyx_INCREF(__pyx_kp_s_validation_method_2);
  __Pyx_GIVEREF(__pyx_kp_s_validation_method_2);
  PyList_SET_ITEM(__pyx_t_4, 5, __pyx_kp_s_validation_method_2);
  __Pyx_INCREF(__pyx_kp_s_number_of_validation_iterations);
  __Pyx_GIVEREF(__pyx_kp_s_number_of_validation_iterations);
  PyList_SET_ITEM(__pyx_t_4, 6, __pyx_kp_s_number_of_validation_iterations);
  __Pyx_INCREF(__pyx_n_s_subpixel_method);
  __Pyx_GIVEREF(__pyx_n_s_subpixel_method);
  PyList_SET_ITEM(__pyx_t_4, 7, __pyx_n_s_subpixel_method);
  __Pyx_INCREF(__pyx_n_s_Nrow);
  __Pyx_GIVEREF(__pyx_n_s_Nrow);
  PyList_SET_ITEM(__pyx_t_4, 8, __pyx_n_s_Nrow);
  __Pyx_INCREF(__pyx_n_s_Ncol);
  __Pyx_GIVEREF(__pyx_n_s_Ncol);
  PyList_SET_ITEM(__pyx_t_4, 9, __pyx_n_s_Ncol);
  __Pyx_INCREF(__pyx_kp_s_Window_sizes);
  __Pyx_GIVEREF(__pyx_kp_s_Window_sizes);
  PyList_SET_ITEM(__pyx_t_4, 10, __pyx_kp_s_Window_sizes);
  __Pyx_INCREF(__pyx_n_s_overlaps);
  __Pyx_GIVEREF(__pyx_n_s_overlaps);
  PyList_SET_ITEM(__pyx_t_4, 11, __pyx_n_s_overlaps);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_names, __pyx_t_4) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_pic_size[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_pic_size[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nb_iter_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_overlap_ratio); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_coarse_factor); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_33);
  __pyx_t_34 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __pyx_t_35 = __Pyx_PyInt_From_int(__pyx_v_validation_iter); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __pyx_t_36 = PyList_New(12); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_36, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_36, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_36, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_33);
  PyList_SET_ITEM(__pyx_t_36, 3, __pyx_t_33);
  __Pyx_GIVEREF(__pyx_t_34);
  PyList_SET_ITEM(__pyx_t_36, 4, __pyx_t_34);
  __Pyx_INCREF(__pyx_v_validation_method);
  __Pyx_GIVEREF(__pyx_v_validation_method);
  PyList_SET_ITEM(__pyx_t_36, 5, __pyx_v_validation_method);
  __Pyx_GIVEREF(__pyx_t_35);
  PyList_SET_ITEM(__pyx_t_36, 6, __pyx_t_35);
  __Pyx_INCREF(__pyx_v_subpixel_method);
  __Pyx_GIVEREF(__pyx_v_subpixel_method);
  PyList_SET_ITEM(__pyx_t_36, 7, __pyx_v_subpixel_method);
  __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
  PyList_SET_ITEM(__pyx_t_36, 8, ((PyObject *)__pyx_v_Nrow));
  __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
  PyList_SET_ITEM(__pyx_t_36, 9, ((PyObject *)__pyx_v_Ncol));
  __Pyx_INCREF(((PyObject *)__pyx_v_W));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_W));
  PyList_SET_ITEM(__pyx_t_36, 10, ((PyObject *)__pyx_v_W));
  __Pyx_INCREF(((PyObject *)__pyx_v_Overlap));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_Overlap));
  PyList_SET_ITEM(__pyx_t_36, 11, ((PyObject *)__pyx_v_Overlap));
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_33 = 0;
  __pyx_t_34 = 0;
  __pyx_t_35 = 0;
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_arg, __pyx_t_36) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_36); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_v_startTime = __pyx_t_37;

  /* "openpiv/process.pyx":718
 *     cdef float startTime = launch(method='WiDIM', names=['Size of image', 'total number of iterations', 'overlap ratio', 'coarse factor', 'time step', 'validation method', 'number of validation iterations', 'subpixel_method','Nrow', 'Ncol', 'Window sizes', 'overlaps'], arg=[[pic_size[0], pic_size[1]], nb_iter_max, overlap_ratio, coarse_factor, dt, validation_method, validation_iter,  subpixel_method, Nrow, Ncol, W, Overlap])
 *     #define the main array F that contains all the data
 *     cdef np.ndarray[DTYPEf_t, ndim=4] F = np.zeros([nb_iter_max, Nrow[nb_iter_max-1], Ncol[nb_iter_max-1], 14], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     #define mask - bool array don't exist in cython so we go to lower level with cast
 *     #you can access mask with (<object>mask)[I,J]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_zeros); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_nb_iter_max); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_38 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_38 < 0) {
    __pyx_t_38 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_38 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 718, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_Nrow.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_39 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_39 < 0) {
    __pyx_t_39 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_39 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 718, __pyx_L1_error)
  }
  __pyx_t_35 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_Ncol.diminfo[0].strides))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __pyx_t_34 = PyList_New(4); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_GIVEREF(__pyx_t_36);
  PyList_SET_ITEM(__pyx_t_34, 0, __pyx_t_36);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_34, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_35);
  PyList_SET_ITEM(__pyx_t_34, 2, __pyx_t_35);
  __Pyx_INCREF(__pyx_int_14);
  __Pyx_GIVEREF(__pyx_int_14);
  PyList_SET_ITEM(__pyx_t_34, 3, __pyx_int_14);
  __pyx_t_36 = 0;
  __pyx_t_5 = 0;
  __pyx_t_35 = 0;
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_34);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_34);
  __pyx_t_34 = 0;
  __pyx_t_34 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_34, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_35, __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 718, __pyx_L1_error)
  __pyx_t_40 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_F.rcbuffer->pybuffer, (PyObject*)__pyx_t_40, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) {
      __pyx_v_F = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_F.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 718, __pyx_L1_error)
    } else {__pyx_pybuffernd_F.diminfo[0].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_F.diminfo[0].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_F.diminfo[1].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_F.diminfo[1].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_F.diminfo[2].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_F.diminfo[2].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_F.diminfo[3].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_F.diminfo[3].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[3];
    }
  }
  __pyx_t_40 = 0;
  __pyx_v_F = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "openpiv/process.pyx":721
 *     #define mask - bool array don't exist in cython so we go to lower level with cast
 *     #you can access mask with (<object>mask)[I,J]
 *     cdef np.ndarray[np.uint8_t, ndim=2, cast=True] mask = np.empty([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=np.bool)             # <<<<<<<<<<<<<<
 *     #define u,v, x,y fields (only used as outputs of this programm)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_41 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_41 < 0) {
    __pyx_t_41 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_41 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 721, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_Nrow.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_42 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_42 < 0) {
    __pyx_t_42 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_42 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 721, __pyx_L1_error)
  }
  __pyx_t_35 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_Ncol.diminfo[0].strides))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_35);
  PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_35);
  __pyx_t_5 = 0;
  __pyx_t_35 = 0;
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_bool); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_dtype, __pyx_t_36) < 0) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_t_35, __pyx_t_15); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (!(likely(((__pyx_t_36) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_36, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 721, __pyx_L1_error)
  __pyx_t_43 = ((PyArrayObject *)__pyx_t_36);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_43, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {
      __pyx_v_mask = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 721, __pyx_L1_error)
    } else {__pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_43 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_36);
  __pyx_t_36 = 0;

  /* "openpiv/process.pyx":723
 *     cdef np.ndarray[np.uint8_t, ndim=2, cast=True] mask = np.empty([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=np.bool)
 *     #define u,v, x,y fields (only used as outputs of this programm)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEf_t, ndim=2] v = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] x = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_zeros); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_44 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_44 < 0) {
    __pyx_t_44 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_44 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 723, __pyx_L1_error)
  }
  __pyx_t_36 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_Nrow.diminfo[0].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_45 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_45 < 0) {
    __pyx_t_45 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_45 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 723, __pyx_L1_error)
  }
  __pyx_t_35 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_Ncol.diminfo[0].strides))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __pyx_t_34 = PyList_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_GIVEREF(__pyx_t_36);
  PyList_SET_ITEM(__pyx_t_34, 0, __pyx_t_36);
  __Pyx_GIVEREF(__pyx_t_35);
  PyList_SET_ITEM(__pyx_t_34, 1, __pyx_t_35);
  __pyx_t_36 = 0;
  __pyx_t_35 = 0;
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_34);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_34);
  __pyx_t_34 = 0;
  __pyx_t_34 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  if (PyDict_SetItem(__pyx_t_34, __pyx_n_s_dtype, __pyx_t_36) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_35, __pyx_t_34); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  if (!(likely(((__pyx_t_36) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_36, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_t_46 = ((PyArrayObject *)__pyx_t_36);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_t_46, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_u = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_u.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 723, __pyx_L1_error)
    } else {__pyx_pybuffernd_u.diminfo[0].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u.diminfo[0].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u.diminfo[1].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u.diminfo[1].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_46 = 0;
  __pyx_v_u = ((PyArrayObject *)__pyx_t_36);
  __pyx_t_36 = 0;

  /* "openpiv/process.pyx":724
 *     #define u,v, x,y fields (only used as outputs of this programm)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] v = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEf_t, ndim=2] x = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] y = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_zeros); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_47 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_47 < 0) {
    __pyx_t_47 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_47 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 724, __pyx_L1_error)
  }
  __pyx_t_36 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_Nrow.diminfo[0].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_48 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_48 < 0) {
    __pyx_t_48 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_48 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 724, __pyx_L1_error)
  }
  __pyx_t_35 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_Ncol.diminfo[0].strides))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_36);
  PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_36);
  __Pyx_GIVEREF(__pyx_t_35);
  PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_35);
  __pyx_t_36 = 0;
  __pyx_t_35 = 0;
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_dtype, __pyx_t_36) < 0) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_t_35, __pyx_t_15); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (!(likely(((__pyx_t_36) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_36, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 724, __pyx_L1_error)
  __pyx_t_49 = ((PyArrayObject *)__pyx_t_36);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_49, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 724, __pyx_L1_error)
    } else {__pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_49 = 0;
  __pyx_v_v = ((PyArrayObject *)__pyx_t_36);
  __pyx_t_36 = 0;

  /* "openpiv/process.pyx":725
 *     cdef np.ndarray[DTYPEf_t, ndim=2] u = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] v = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] x = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEf_t, ndim=2] y = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     #define two small arrays used for the validation process
 */
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_zeros); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_50 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_50 < 0) {
    __pyx_t_50 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_50 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 725, __pyx_L1_error)
  }
  __pyx_t_36 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_Nrow.diminfo[0].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_51 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_51 < 0) {
    __pyx_t_51 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_51 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 725, __pyx_L1_error)
  }
  __pyx_t_35 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_Ncol.diminfo[0].strides))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __pyx_t_34 = PyList_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_GIVEREF(__pyx_t_36);
  PyList_SET_ITEM(__pyx_t_34, 0, __pyx_t_36);
  __Pyx_GIVEREF(__pyx_t_35);
  PyList_SET_ITEM(__pyx_t_34, 1, __pyx_t_35);
  __pyx_t_36 = 0;
  __pyx_t_35 = 0;
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_34);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_34);
  __pyx_t_34 = 0;
  __pyx_t_34 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  if (PyDict_SetItem(__pyx_t_34, __pyx_n_s_dtype, __pyx_t_36) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_35, __pyx_t_34); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  if (!(likely(((__pyx_t_36) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_36, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 725, __pyx_L1_error)
  __pyx_t_52 = ((PyArrayObject *)__pyx_t_36);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_52, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_x = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 725, __pyx_L1_error)
    } else {__pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_52 = 0;
  __pyx_v_x = ((PyArrayObject *)__pyx_t_36);
  __pyx_t_36 = 0;

  /* "openpiv/process.pyx":726
 *     cdef np.ndarray[DTYPEf_t, ndim=2] v = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] x = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEf_t, ndim=2] y = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     #define two small arrays used for the validation process
 *     cdef np.ndarray[DTYPEf_t, ndim=3] neighbours = np.zeros([2,3,3], dtype=DTYPEf)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_zeros); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_53 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_53 < 0) {
    __pyx_t_53 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_53 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 726, __pyx_L1_error)
  }
  __pyx_t_36 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_Nrow.diminfo[0].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_54 = (__pyx_v_nb_iter_max - 1);
  __pyx_t_13 = -1;
  if (__pyx_t_54 < 0) {
    __pyx_t_54 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_54 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 726, __pyx_L1_error)
  }
  __pyx_t_35 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_Ncol.diminfo[0].strides))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_36);
  PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_36);
  __Pyx_GIVEREF(__pyx_t_35);
  PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_35);
  __pyx_t_36 = 0;
  __pyx_t_35 = 0;
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_dtype, __pyx_t_36) < 0) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_t_35, __pyx_t_15); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (!(likely(((__pyx_t_36) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_36, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 726, __pyx_L1_error)
  __pyx_t_55 = ((PyArrayObject *)__pyx_t_36);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_55, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 726, __pyx_L1_error)
    } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_55 = 0;
  __pyx_v_y = ((PyArrayObject *)__pyx_t_36);
  __pyx_t_36 = 0;

  /* "openpiv/process.pyx":728
 *     cdef np.ndarray[DTYPEf_t, ndim=2] y = np.zeros([Nrow[nb_iter_max-1], Ncol[nb_iter_max-1]], dtype=DTYPEf)
 *     #define two small arrays used for the validation process
 *     cdef np.ndarray[DTYPEf_t, ndim=3] neighbours = np.zeros([2,3,3], dtype=DTYPEf)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=2] neighbours_present = np.zeros([3,3], dtype=DTYPEi)
 *     #initialize x and y values
 */
  __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_zeros); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __pyx_t_36 = PyList_New(3); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyList_SET_ITEM(__pyx_t_36, 0, __pyx_int_2);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_36, 1, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_36, 2, __pyx_int_3);
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_36);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_36);
  __pyx_t_36 = 0;
  __pyx_t_36 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_DTYPEf); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  if (PyDict_SetItem(__pyx_t_36, __pyx_n_s_dtype, __pyx_t_34) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  __pyx_t_34 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_35, __pyx_t_36); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  if (!(likely(((__pyx_t_34) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_34, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 728, __pyx_L1_error)
  __pyx_t_56 = ((PyArrayObject *)__pyx_t_34);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_neighbours.rcbuffer->pybuffer, (PyObject*)__pyx_t_56, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_neighbours = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 728, __pyx_L1_error)
    } else {__pyx_pybuffernd_neighbours.diminfo[0].strides = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_neighbours.diminfo[0].shape = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_neighbours.diminfo[1].strides = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_neighbours.diminfo[1].shape = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_neighbours.diminfo[2].strides = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_neighbours.diminfo[2].shape = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_56 = 0;
  __pyx_v_neighbours = ((PyArrayObject *)__pyx_t_34);
  __pyx_t_34 = 0;

  /* "openpiv/process.pyx":729
 *     #define two small arrays used for the validation process
 *     cdef np.ndarray[DTYPEf_t, ndim=3] neighbours = np.zeros([2,3,3], dtype=DTYPEf)
 *     cdef np.ndarray[DTYPEi_t, ndim=2] neighbours_present = np.zeros([3,3], dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     #initialize x and y values
 *     for K in range(nb_iter_max):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_zeros); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_36);
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  __pyx_t_34 = PyList_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_34, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_34, 1, __pyx_int_3);
  __pyx_t_35 = PyTuple_New(1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_35);
  __Pyx_GIVEREF(__pyx_t_34);
  PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_34);
  __pyx_t_34 = 0;
  __pyx_t_34 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_34);
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_t_34, __pyx_n_s_dtype, __pyx_t_15) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_36, __pyx_t_35, __pyx_t_34); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 729, __pyx_L1_error)
  __pyx_t_57 = ((PyArrayObject *)__pyx_t_15);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer, (PyObject*)__pyx_t_57, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_neighbours_present = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 729, __pyx_L1_error)
    } else {__pyx_pybuffernd_neighbours_present.diminfo[0].strides = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_neighbours_present.diminfo[0].shape = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_neighbours_present.diminfo[1].strides = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_neighbours_present.diminfo[1].shape = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_57 = 0;
  __pyx_v_neighbours_present = ((PyArrayObject *)__pyx_t_15);
  __pyx_t_15 = 0;

  /* "openpiv/process.pyx":731
 *     cdef np.ndarray[DTYPEi_t, ndim=2] neighbours_present = np.zeros([3,3], dtype=DTYPEi)
 *     #initialize x and y values
 *     for K in range(nb_iter_max):             # <<<<<<<<<<<<<<
 *         for I in range(Nrow[K]):
 *             for J in range(Ncol[K]):
 */
  __pyx_t_13 = __pyx_v_nb_iter_max;
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_14; __pyx_t_18+=1) {
    __pyx_v_K = __pyx_t_18;

    /* "openpiv/process.pyx":732
 *     #initialize x and y values
 *     for K in range(nb_iter_max):
 *         for I in range(Nrow[K]):             # <<<<<<<<<<<<<<
 *             for J in range(Ncol[K]):
 *                 #x unit vector corresponds to rows
 */
    __pyx_t_58 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_58 < 0) {
      __pyx_t_58 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
      if (unlikely(__pyx_t_58 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 732, __pyx_L1_error)
    }
    __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_Nrow.diminfo[0].strides));
    __pyx_t_27 = __pyx_t_16;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_27; __pyx_t_20+=1) {
      __pyx_v_I = __pyx_t_20;

      /* "openpiv/process.pyx":733
 *     for K in range(nb_iter_max):
 *         for I in range(Nrow[K]):
 *             for J in range(Ncol[K]):             # <<<<<<<<<<<<<<
 *                 #x unit vector corresponds to rows
 *                 #y unit vector corresponds to columns
 */
      __pyx_t_59 = __pyx_v_K;
      __pyx_t_60 = -1;
      if (__pyx_t_59 < 0) {
        __pyx_t_59 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_59 < 0)) __pyx_t_60 = 0;
      } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_60 = 0;
      if (unlikely(__pyx_t_60 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_60);
        __PYX_ERR(0, 733, __pyx_L1_error)
      }
      __pyx_t_61 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_Ncol.diminfo[0].strides));
      __pyx_t_62 = __pyx_t_61;
      for (__pyx_t_60 = 0; __pyx_t_60 < __pyx_t_62; __pyx_t_60+=1) {
        __pyx_v_J = __pyx_t_60;

        /* "openpiv/process.pyx":736
 *                 #x unit vector corresponds to rows
 *                 #y unit vector corresponds to columns
 *                 if I==0:             # <<<<<<<<<<<<<<
 *                     F[K,I,J,0]=W[K]/2 #init x on 1st row
 *                 else:
 */
        __pyx_t_1 = ((__pyx_v_I == 0) != 0);
        if (__pyx_t_1) {

          /* "openpiv/process.pyx":737
 *                 #y unit vector corresponds to columns
 *                 if I==0:
 *                     F[K,I,J,0]=W[K]/2 #init x on 1st row             # <<<<<<<<<<<<<<
 *                 else:
 *                     F[K,I,J,0]=F[K,I-1,J,0] + W[K] - Overlap[K] #init x
 */
          __pyx_t_63 = __pyx_v_K;
          __pyx_t_64 = -1;
          if (__pyx_t_63 < 0) {
            __pyx_t_63 += __pyx_pybuffernd_W.diminfo[0].shape;
            if (unlikely(__pyx_t_63 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 737, __pyx_L1_error)
          }
          __pyx_t_65 = __pyx_v_K;
          __pyx_t_66 = __pyx_v_I;
          __pyx_t_67 = __pyx_v_J;
          __pyx_t_68 = 0;
          __pyx_t_64 = -1;
          if (__pyx_t_65 < 0) {
            __pyx_t_65 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_65 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_66 < 0) {
            __pyx_t_66 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_66 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_67 < 0) {
            __pyx_t_67 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_67 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_68 < 0) {
            __pyx_t_68 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_68 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 737, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_66, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_67, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_68, __pyx_pybuffernd_F.diminfo[3].strides) = (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0);

          /* "openpiv/process.pyx":736
 *                 #x unit vector corresponds to rows
 *                 #y unit vector corresponds to columns
 *                 if I==0:             # <<<<<<<<<<<<<<
 *                     F[K,I,J,0]=W[K]/2 #init x on 1st row
 *                 else:
 */
          goto __pyx_L19;
        }

        /* "openpiv/process.pyx":739
 *                     F[K,I,J,0]=W[K]/2 #init x on 1st row
 *                 else:
 *                     F[K,I,J,0]=F[K,I-1,J,0] + W[K] - Overlap[K] #init x             # <<<<<<<<<<<<<<
 *                 if J==0:
 *                     F[K,I,J,1]=W[K]/2 #init y on first column
 */
        /*else*/ {
          __pyx_t_69 = __pyx_v_K;
          __pyx_t_70 = (__pyx_v_I - 1);
          __pyx_t_71 = __pyx_v_J;
          __pyx_t_72 = 0;
          __pyx_t_64 = -1;
          if (__pyx_t_69 < 0) {
            __pyx_t_69 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_69 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_70 < 0) {
            __pyx_t_70 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_70 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_71 < 0) {
            __pyx_t_71 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_71 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_72 < 0) {
            __pyx_t_72 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_72 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 739, __pyx_L1_error)
          }
          __pyx_t_73 = __pyx_v_K;
          __pyx_t_64 = -1;
          if (__pyx_t_73 < 0) {
            __pyx_t_73 += __pyx_pybuffernd_W.diminfo[0].shape;
            if (unlikely(__pyx_t_73 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 739, __pyx_L1_error)
          }
          __pyx_t_74 = __pyx_v_K;
          __pyx_t_64 = -1;
          if (__pyx_t_74 < 0) {
            __pyx_t_74 += __pyx_pybuffernd_Overlap.diminfo[0].shape;
            if (unlikely(__pyx_t_74 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd_Overlap.diminfo[0].shape)) __pyx_t_64 = 0;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 739, __pyx_L1_error)
          }
          __pyx_t_75 = __pyx_v_K;
          __pyx_t_76 = __pyx_v_I;
          __pyx_t_77 = __pyx_v_J;
          __pyx_t_78 = 0;
          __pyx_t_64 = -1;
          if (__pyx_t_75 < 0) {
            __pyx_t_75 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_75 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_75 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_76 < 0) {
            __pyx_t_76 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_76 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_76 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_77 < 0) {
            __pyx_t_77 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_77 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_78 < 0) {
            __pyx_t_78 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_78 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 739, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_76, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_77, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_78, __pyx_pybuffernd_F.diminfo[3].strides) = (((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_71, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_72, __pyx_pybuffernd_F.diminfo[3].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_W.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd_Overlap.diminfo[0].strides)));
        }
        __pyx_L19:;

        /* "openpiv/process.pyx":740
 *                 else:
 *                     F[K,I,J,0]=F[K,I-1,J,0] + W[K] - Overlap[K] #init x
 *                 if J==0:             # <<<<<<<<<<<<<<
 *                     F[K,I,J,1]=W[K]/2 #init y on first column
 *                 else:
 */
        __pyx_t_1 = ((__pyx_v_J == 0) != 0);
        if (__pyx_t_1) {

          /* "openpiv/process.pyx":741
 *                     F[K,I,J,0]=F[K,I-1,J,0] + W[K] - Overlap[K] #init x
 *                 if J==0:
 *                     F[K,I,J,1]=W[K]/2 #init y on first column             # <<<<<<<<<<<<<<
 *                 else:
 *                     F[K,I,J,1]=F[K,I,J-1,1] + W[K] - Overlap[K] #init y
 */
          __pyx_t_79 = __pyx_v_K;
          __pyx_t_64 = -1;
          if (__pyx_t_79 < 0) {
            __pyx_t_79 += __pyx_pybuffernd_W.diminfo[0].shape;
            if (unlikely(__pyx_t_79 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 741, __pyx_L1_error)
          }
          __pyx_t_80 = __pyx_v_K;
          __pyx_t_81 = __pyx_v_I;
          __pyx_t_82 = __pyx_v_J;
          __pyx_t_83 = 1;
          __pyx_t_64 = -1;
          if (__pyx_t_80 < 0) {
            __pyx_t_80 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_80 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_81 < 0) {
            __pyx_t_81 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_81 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_82 < 0) {
            __pyx_t_82 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_82 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_83 < 0) {
            __pyx_t_83 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_83 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 741, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_80, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_81, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_82, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_83, __pyx_pybuffernd_F.diminfo[3].strides) = (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0);

          /* "openpiv/process.pyx":740
 *                 else:
 *                     F[K,I,J,0]=F[K,I-1,J,0] + W[K] - Overlap[K] #init x
 *                 if J==0:             # <<<<<<<<<<<<<<
 *                     F[K,I,J,1]=W[K]/2 #init y on first column
 *                 else:
 */
          goto __pyx_L20;
        }

        /* "openpiv/process.pyx":743
 *                     F[K,I,J,1]=W[K]/2 #init y on first column
 *                 else:
 *                     F[K,I,J,1]=F[K,I,J-1,1] + W[K] - Overlap[K] #init y             # <<<<<<<<<<<<<<
 *     #end of the initializations
 *     ####################################################
 */
        /*else*/ {
          __pyx_t_84 = __pyx_v_K;
          __pyx_t_85 = __pyx_v_I;
          __pyx_t_86 = (__pyx_v_J - 1);
          __pyx_t_87 = 1;
          __pyx_t_64 = -1;
          if (__pyx_t_84 < 0) {
            __pyx_t_84 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_84 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_84 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_85 < 0) {
            __pyx_t_85 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_85 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_85 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_86 < 0) {
            __pyx_t_86 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_86 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_86 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_87 < 0) {
            __pyx_t_87 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_87 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_87 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 743, __pyx_L1_error)
          }
          __pyx_t_88 = __pyx_v_K;
          __pyx_t_64 = -1;
          if (__pyx_t_88 < 0) {
            __pyx_t_88 += __pyx_pybuffernd_W.diminfo[0].shape;
            if (unlikely(__pyx_t_88 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_88 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 743, __pyx_L1_error)
          }
          __pyx_t_89 = __pyx_v_K;
          __pyx_t_64 = -1;
          if (__pyx_t_89 < 0) {
            __pyx_t_89 += __pyx_pybuffernd_Overlap.diminfo[0].shape;
            if (unlikely(__pyx_t_89 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_89 >= __pyx_pybuffernd_Overlap.diminfo[0].shape)) __pyx_t_64 = 0;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 743, __pyx_L1_error)
          }
          __pyx_t_90 = __pyx_v_K;
          __pyx_t_91 = __pyx_v_I;
          __pyx_t_92 = __pyx_v_J;
          __pyx_t_93 = 1;
          __pyx_t_64 = -1;
          if (__pyx_t_90 < 0) {
            __pyx_t_90 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_90 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_90 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_91 < 0) {
            __pyx_t_91 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_91 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_91 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_92 < 0) {
            __pyx_t_92 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_92 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_92 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_93 < 0) {
            __pyx_t_93 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_93 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_93 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 743, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_90, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_91, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_92, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_93, __pyx_pybuffernd_F.diminfo[3].strides) = (((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_84, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_85, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_86, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_87, __pyx_pybuffernd_F.diminfo[3].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_88, __pyx_pybuffernd_W.diminfo[0].strides))) - (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Overlap.rcbuffer->pybuffer.buf, __pyx_t_89, __pyx_pybuffernd_Overlap.diminfo[0].strides)));
        }
        __pyx_L20:;
      }
    }
  }

  /* "openpiv/process.pyx":747
 *     ####################################################
 *     #main loop
 *     for K in range(nb_iter_max):             # <<<<<<<<<<<<<<
 *         print("ITERATION # ", K)
 *         window_a, window_b = define_windows(W[K])
 */
  __pyx_t_13 = __pyx_v_nb_iter_max;
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_14; __pyx_t_18+=1) {
    __pyx_v_K = __pyx_t_18;

    /* "openpiv/process.pyx":748
 *     #main loop
 *     for K in range(nb_iter_max):
 *         print("ITERATION # ", K)             # <<<<<<<<<<<<<<
 *         window_a, window_b = define_windows(W[K])
 *         #a simple progress bar
 */
    __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_34);
    __Pyx_INCREF(__pyx_kp_s_ITERATION);
    __Pyx_GIVEREF(__pyx_kp_s_ITERATION);
    PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_kp_s_ITERATION);
    __Pyx_GIVEREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_t_15);
    __pyx_t_15 = 0;
    if (__Pyx_PrintOne(0, __pyx_t_34) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;

    /* "openpiv/process.pyx":749
 *     for K in range(nb_iter_max):
 *         print("ITERATION # ", K)
 *         window_a, window_b = define_windows(W[K])             # <<<<<<<<<<<<<<
 *         #a simple progress bar
 *         # widgets = ['Computing the displacements : ', Percentage(), ' ', Bar(marker='-',left='[',right=']'),
 */
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_define_windows); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_94 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_94 < 0) {
      __pyx_t_94 += __pyx_pybuffernd_W.diminfo[0].shape;
      if (unlikely(__pyx_t_94 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_94 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 749, __pyx_L1_error)
    }
    __pyx_t_35 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_94, __pyx_pybuffernd_W.diminfo[0].strides))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_35);
    __pyx_t_36 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_15);
      if (likely(__pyx_t_36)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_36);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_15, function);
      }
    }
    __pyx_t_34 = (__pyx_t_36) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_36, __pyx_t_35) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_35);
    __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
    __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
    if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_34);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_34))) || (PyList_CheckExact(__pyx_t_34))) {
      PyObject* sequence = __pyx_t_34;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 749, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_35 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_15 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_35 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_35);
      #else
      __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_35 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      #endif
      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_36 = PyObject_GetIter(__pyx_t_34); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_36);
      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
      __pyx_t_95 = Py_TYPE(__pyx_t_36)->tp_iternext;
      index = 0; __pyx_t_15 = __pyx_t_95(__pyx_t_36); if (unlikely(!__pyx_t_15)) goto __pyx_L23_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_15);
      index = 1; __pyx_t_35 = __pyx_t_95(__pyx_t_36); if (unlikely(!__pyx_t_35)) goto __pyx_L23_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_35);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_95(__pyx_t_36), 2) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
      __pyx_t_95 = NULL;
      __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
      goto __pyx_L24_unpacking_done;
      __pyx_L23_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
      __pyx_t_95 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 749, __pyx_L1_error)
      __pyx_L24_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_window_a, __pyx_t_15);
    __pyx_t_15 = 0;
    __Pyx_XDECREF_SET(__pyx_v_window_b, __pyx_t_35);
    __pyx_t_35 = 0;

    /* "openpiv/process.pyx":755
 *         # pbar = ProgressBar(widgets=widgets, maxval=100)
 *         # pbar.start()
 *         residual = 0             # <<<<<<<<<<<<<<
 *         for I in range(Nrow[K]):#run through interpolations locations
 *             # pbar.update(100*I/Nrow[K])#progress update
 */
    __pyx_v_residual = 0;

    /* "openpiv/process.pyx":756
 *         # pbar.start()
 *         residual = 0
 *         for I in range(Nrow[K]):#run through interpolations locations             # <<<<<<<<<<<<<<
 *             # pbar.update(100*I/Nrow[K])#progress update
 *             for J in range(Ncol[K]):
 */
    __pyx_t_96 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_96 < 0) {
      __pyx_t_96 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
      if (unlikely(__pyx_t_96 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_96 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 756, __pyx_L1_error)
    }
    __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_96, __pyx_pybuffernd_Nrow.diminfo[0].strides));
    __pyx_t_27 = __pyx_t_16;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_27; __pyx_t_20+=1) {
      __pyx_v_I = __pyx_t_20;

      /* "openpiv/process.pyx":758
 *         for I in range(Nrow[K]):#run through interpolations locations
 *             # pbar.update(100*I/Nrow[K])#progress update
 *             for J in range(Ncol[K]):             # <<<<<<<<<<<<<<
 * 
 *                 #compute xb, yb:
 */
      __pyx_t_97 = __pyx_v_K;
      __pyx_t_60 = -1;
      if (__pyx_t_97 < 0) {
        __pyx_t_97 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_97 < 0)) __pyx_t_60 = 0;
      } else if (unlikely(__pyx_t_97 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_60 = 0;
      if (unlikely(__pyx_t_60 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_60);
        __PYX_ERR(0, 758, __pyx_L1_error)
      }
      __pyx_t_61 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_97, __pyx_pybuffernd_Ncol.diminfo[0].strides));
      __pyx_t_62 = __pyx_t_61;
      for (__pyx_t_60 = 0; __pyx_t_60 < __pyx_t_62; __pyx_t_60+=1) {
        __pyx_v_J = __pyx_t_60;

        /* "openpiv/process.pyx":761
 * 
 *                 #compute xb, yb:
 *                 F[K,I,J,2]=np.floor(F[K,I,J,0]+F[K,I,J,6])#xb=xa+dpx             # <<<<<<<<<<<<<<
 *                 F[K,I,J,3]=np.floor(F[K,I,J,1]+F[K,I,J,7])#yb=yb+dpy
 *                 #look for corrupted window (ie. going outside of the picture) and relocate them with 0 displacement:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_35);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_floor); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __pyx_t_98 = __pyx_v_K;
        __pyx_t_99 = __pyx_v_I;
        __pyx_t_100 = __pyx_v_J;
        __pyx_t_101 = 0;
        __pyx_t_64 = -1;
        if (__pyx_t_98 < 0) {
          __pyx_t_98 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_98 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_98 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_99 < 0) {
          __pyx_t_99 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_99 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_99 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_100 < 0) {
          __pyx_t_100 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_100 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_100 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_101 < 0) {
          __pyx_t_101 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_101 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_101 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 761, __pyx_L1_error)
        }
        __pyx_t_102 = __pyx_v_K;
        __pyx_t_103 = __pyx_v_I;
        __pyx_t_104 = __pyx_v_J;
        __pyx_t_105 = 6;
        __pyx_t_64 = -1;
        if (__pyx_t_102 < 0) {
          __pyx_t_102 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_102 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_102 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_103 < 0) {
          __pyx_t_103 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_103 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_103 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_104 < 0) {
          __pyx_t_104 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_104 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_104 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_105 < 0) {
          __pyx_t_105 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_105 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_105 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 761, __pyx_L1_error)
        }
        __pyx_t_35 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_98, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_99, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_100, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_101, __pyx_pybuffernd_F.diminfo[3].strides)) + (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_102, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_103, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_104, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_105, __pyx_pybuffernd_F.diminfo[3].strides)))); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_35);
        __pyx_t_36 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_36)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_36);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_34 = (__pyx_t_36) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_36, __pyx_t_35) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_35);
        __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_34); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __pyx_t_107 = __pyx_v_K;
        __pyx_t_108 = __pyx_v_I;
        __pyx_t_109 = __pyx_v_J;
        __pyx_t_110 = 2;
        __pyx_t_64 = -1;
        if (__pyx_t_107 < 0) {
          __pyx_t_107 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_107 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_107 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_108 < 0) {
          __pyx_t_108 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_108 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_108 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_109 < 0) {
          __pyx_t_109 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_109 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_109 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_110 < 0) {
          __pyx_t_110 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_110 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_110 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 761, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_107, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_108, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_109, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_110, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

        /* "openpiv/process.pyx":762
 *                 #compute xb, yb:
 *                 F[K,I,J,2]=np.floor(F[K,I,J,0]+F[K,I,J,6])#xb=xa+dpx
 *                 F[K,I,J,3]=np.floor(F[K,I,J,1]+F[K,I,J,7])#yb=yb+dpy             # <<<<<<<<<<<<<<
 *                 #look for corrupted window (ie. going outside of the picture) and relocate them with 0 displacement:
 *                 if F[K,I,J,2] + W[K]/2 > pic_size[0]-1 or F[K,I,J,2] - W[K]/2 < 0: #if corrupted on x-axis do:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_35 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_floor); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_35);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_111 = __pyx_v_K;
        __pyx_t_112 = __pyx_v_I;
        __pyx_t_113 = __pyx_v_J;
        __pyx_t_114 = 1;
        __pyx_t_64 = -1;
        if (__pyx_t_111 < 0) {
          __pyx_t_111 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_111 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_111 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_112 < 0) {
          __pyx_t_112 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_112 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_112 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_113 < 0) {
          __pyx_t_113 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_113 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_113 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_114 < 0) {
          __pyx_t_114 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_114 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_114 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 762, __pyx_L1_error)
        }
        __pyx_t_115 = __pyx_v_K;
        __pyx_t_116 = __pyx_v_I;
        __pyx_t_117 = __pyx_v_J;
        __pyx_t_118 = 7;
        __pyx_t_64 = -1;
        if (__pyx_t_115 < 0) {
          __pyx_t_115 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_115 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_115 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_116 < 0) {
          __pyx_t_116 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_116 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_116 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_117 < 0) {
          __pyx_t_117 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_117 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_117 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_118 < 0) {
          __pyx_t_118 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_118 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_118 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 762, __pyx_L1_error)
        }
        __pyx_t_15 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_111, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_112, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_113, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_114, __pyx_pybuffernd_F.diminfo[3].strides)) + (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_115, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_116, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_117, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_118, __pyx_pybuffernd_F.diminfo[3].strides)))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_36 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_35))) {
          __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_35);
          if (likely(__pyx_t_36)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_35);
            __Pyx_INCREF(__pyx_t_36);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_35, function);
          }
        }
        __pyx_t_34 = (__pyx_t_36) ? __Pyx_PyObject_Call2Args(__pyx_t_35, __pyx_t_36, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_35, __pyx_t_15);
        __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_34); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __pyx_t_119 = __pyx_v_K;
        __pyx_t_120 = __pyx_v_I;
        __pyx_t_121 = __pyx_v_J;
        __pyx_t_122 = 3;
        __pyx_t_64 = -1;
        if (__pyx_t_119 < 0) {
          __pyx_t_119 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_119 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_119 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_120 < 0) {
          __pyx_t_120 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_120 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_120 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_121 < 0) {
          __pyx_t_121 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_121 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_121 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_122 < 0) {
          __pyx_t_122 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_122 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_122 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 762, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_119, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_120, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_121, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_122, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

        /* "openpiv/process.pyx":764
 *                 F[K,I,J,3]=np.floor(F[K,I,J,1]+F[K,I,J,7])#yb=yb+dpy
 *                 #look for corrupted window (ie. going outside of the picture) and relocate them with 0 displacement:
 *                 if F[K,I,J,2] + W[K]/2 > pic_size[0]-1 or F[K,I,J,2] - W[K]/2 < 0: #if corrupted on x-axis do:             # <<<<<<<<<<<<<<
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 */
        __pyx_t_123 = __pyx_v_K;
        __pyx_t_124 = __pyx_v_I;
        __pyx_t_125 = __pyx_v_J;
        __pyx_t_126 = 2;
        __pyx_t_64 = -1;
        if (__pyx_t_123 < 0) {
          __pyx_t_123 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_123 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_123 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_124 < 0) {
          __pyx_t_124 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_124 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_124 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_125 < 0) {
          __pyx_t_125 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_125 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_125 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_126 < 0) {
          __pyx_t_126 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_126 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_126 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 764, __pyx_L1_error)
        }
        __pyx_t_127 = __pyx_v_K;
        __pyx_t_64 = -1;
        if (__pyx_t_127 < 0) {
          __pyx_t_127 += __pyx_pybuffernd_W.diminfo[0].shape;
          if (unlikely(__pyx_t_127 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_127 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 764, __pyx_L1_error)
        }
        __pyx_t_128 = ((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_123, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_124, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_125, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_126, __pyx_pybuffernd_F.diminfo[3].strides)) + (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_127, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) > ((__pyx_v_pic_size[0]) - 1)) != 0);
        if (!__pyx_t_128) {
        } else {
          __pyx_t_1 = __pyx_t_128;
          goto __pyx_L30_bool_binop_done;
        }
        __pyx_t_129 = __pyx_v_K;
        __pyx_t_130 = __pyx_v_I;
        __pyx_t_131 = __pyx_v_J;
        __pyx_t_132 = 2;
        __pyx_t_64 = -1;
        if (__pyx_t_129 < 0) {
          __pyx_t_129 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_129 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_129 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_130 < 0) {
          __pyx_t_130 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_130 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_130 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_131 < 0) {
          __pyx_t_131 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_131 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_131 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_132 < 0) {
          __pyx_t_132 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_132 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_132 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 764, __pyx_L1_error)
        }
        __pyx_t_133 = __pyx_v_K;
        __pyx_t_64 = -1;
        if (__pyx_t_133 < 0) {
          __pyx_t_133 += __pyx_pybuffernd_W.diminfo[0].shape;
          if (unlikely(__pyx_t_133 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_133 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 764, __pyx_L1_error)
        }
        __pyx_t_128 = ((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_129, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_130, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_131, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_132, __pyx_pybuffernd_F.diminfo[3].strides)) - (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_133, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) < 0.0) != 0);
        __pyx_t_1 = __pyx_t_128;
        __pyx_L30_bool_binop_done:;
        if (__pyx_t_1) {

          /* "openpiv/process.pyx":765
 *                 #look for corrupted window (ie. going outside of the picture) and relocate them with 0 displacement:
 *                 if F[K,I,J,2] + W[K]/2 > pic_size[0]-1 or F[K,I,J,2] - W[K]/2 < 0: #if corrupted on x-axis do:
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x             # <<<<<<<<<<<<<<
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 *                     F[K,I,J,6]=0.0#dpx=0
 */
          __pyx_t_134 = __pyx_v_K;
          __pyx_t_135 = __pyx_v_I;
          __pyx_t_136 = __pyx_v_J;
          __pyx_t_137 = 0;
          __pyx_t_64 = -1;
          if (__pyx_t_134 < 0) {
            __pyx_t_134 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_134 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_134 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_135 < 0) {
            __pyx_t_135 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_135 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_135 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_136 < 0) {
            __pyx_t_136 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_136 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_136 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_137 < 0) {
            __pyx_t_137 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_137 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_137 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 765, __pyx_L1_error)
          }
          __pyx_t_138 = __pyx_v_K;
          __pyx_t_139 = __pyx_v_I;
          __pyx_t_140 = __pyx_v_J;
          __pyx_t_141 = 2;
          __pyx_t_64 = -1;
          if (__pyx_t_138 < 0) {
            __pyx_t_138 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_138 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_138 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_139 < 0) {
            __pyx_t_139 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_139 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_139 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_140 < 0) {
            __pyx_t_140 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_140 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_140 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_141 < 0) {
            __pyx_t_141 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_141 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_141 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 765, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_138, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_139, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_140, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_141, __pyx_pybuffernd_F.diminfo[3].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_134, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_135, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_136, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_137, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":766
 *                 if F[K,I,J,2] + W[K]/2 > pic_size[0]-1 or F[K,I,J,2] - W[K]/2 < 0: #if corrupted on x-axis do:
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y             # <<<<<<<<<<<<<<
 *                     F[K,I,J,6]=0.0#dpx=0
 *                     F[K,I,J,7]=0.0#dpy=0
 */
          __pyx_t_142 = __pyx_v_K;
          __pyx_t_143 = __pyx_v_I;
          __pyx_t_144 = __pyx_v_J;
          __pyx_t_145 = 1;
          __pyx_t_64 = -1;
          if (__pyx_t_142 < 0) {
            __pyx_t_142 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_142 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_142 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_143 < 0) {
            __pyx_t_143 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_143 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_143 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_144 < 0) {
            __pyx_t_144 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_144 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_144 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_145 < 0) {
            __pyx_t_145 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_145 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_145 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 766, __pyx_L1_error)
          }
          __pyx_t_146 = __pyx_v_K;
          __pyx_t_147 = __pyx_v_I;
          __pyx_t_148 = __pyx_v_J;
          __pyx_t_149 = 3;
          __pyx_t_64 = -1;
          if (__pyx_t_146 < 0) {
            __pyx_t_146 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_146 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_146 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_147 < 0) {
            __pyx_t_147 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_147 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_147 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_148 < 0) {
            __pyx_t_148 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_148 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_148 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_149 < 0) {
            __pyx_t_149 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_149 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_149 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 766, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_146, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_147, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_148, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_149, __pyx_pybuffernd_F.diminfo[3].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_142, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_143, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_144, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_145, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":767
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 *                     F[K,I,J,6]=0.0#dpx=0             # <<<<<<<<<<<<<<
 *                     F[K,I,J,7]=0.0#dpy=0
 *                 elif F[K,I,J,3] + W[K]/2 > pic_size[1]-1 or F[K,I,J,3] - W[K]/2 < 0: #if corrupted on y-axis do the same
 */
          __pyx_t_150 = __pyx_v_K;
          __pyx_t_151 = __pyx_v_I;
          __pyx_t_152 = __pyx_v_J;
          __pyx_t_153 = 6;
          __pyx_t_64 = -1;
          if (__pyx_t_150 < 0) {
            __pyx_t_150 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_150 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_150 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_151 < 0) {
            __pyx_t_151 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_151 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_151 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_152 < 0) {
            __pyx_t_152 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_152 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_152 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_153 < 0) {
            __pyx_t_153 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_153 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_153 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 767, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_150, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_151, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_152, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_153, __pyx_pybuffernd_F.diminfo[3].strides) = 0.0;

          /* "openpiv/process.pyx":768
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 *                     F[K,I,J,6]=0.0#dpx=0
 *                     F[K,I,J,7]=0.0#dpy=0             # <<<<<<<<<<<<<<
 *                 elif F[K,I,J,3] + W[K]/2 > pic_size[1]-1 or F[K,I,J,3] - W[K]/2 < 0: #if corrupted on y-axis do the same
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 */
          __pyx_t_154 = __pyx_v_K;
          __pyx_t_155 = __pyx_v_I;
          __pyx_t_156 = __pyx_v_J;
          __pyx_t_157 = 7;
          __pyx_t_64 = -1;
          if (__pyx_t_154 < 0) {
            __pyx_t_154 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_154 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_154 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_155 < 0) {
            __pyx_t_155 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_155 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_155 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_156 < 0) {
            __pyx_t_156 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_156 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_156 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_157 < 0) {
            __pyx_t_157 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_157 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_157 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 768, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_154, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_155, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_156, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_157, __pyx_pybuffernd_F.diminfo[3].strides) = 0.0;

          /* "openpiv/process.pyx":764
 *                 F[K,I,J,3]=np.floor(F[K,I,J,1]+F[K,I,J,7])#yb=yb+dpy
 *                 #look for corrupted window (ie. going outside of the picture) and relocate them with 0 displacement:
 *                 if F[K,I,J,2] + W[K]/2 > pic_size[0]-1 or F[K,I,J,2] - W[K]/2 < 0: #if corrupted on x-axis do:             # <<<<<<<<<<<<<<
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 */
          goto __pyx_L29;
        }

        /* "openpiv/process.pyx":769
 *                     F[K,I,J,6]=0.0#dpx=0
 *                     F[K,I,J,7]=0.0#dpy=0
 *                 elif F[K,I,J,3] + W[K]/2 > pic_size[1]-1 or F[K,I,J,3] - W[K]/2 < 0: #if corrupted on y-axis do the same             # <<<<<<<<<<<<<<
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 */
        __pyx_t_158 = __pyx_v_K;
        __pyx_t_159 = __pyx_v_I;
        __pyx_t_160 = __pyx_v_J;
        __pyx_t_161 = 3;
        __pyx_t_64 = -1;
        if (__pyx_t_158 < 0) {
          __pyx_t_158 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_158 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_158 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_159 < 0) {
          __pyx_t_159 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_159 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_159 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_160 < 0) {
          __pyx_t_160 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_160 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_160 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_161 < 0) {
          __pyx_t_161 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_161 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_161 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 769, __pyx_L1_error)
        }
        __pyx_t_162 = __pyx_v_K;
        __pyx_t_64 = -1;
        if (__pyx_t_162 < 0) {
          __pyx_t_162 += __pyx_pybuffernd_W.diminfo[0].shape;
          if (unlikely(__pyx_t_162 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_162 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 769, __pyx_L1_error)
        }
        __pyx_t_128 = ((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_158, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_159, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_160, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_161, __pyx_pybuffernd_F.diminfo[3].strides)) + (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_162, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) > ((__pyx_v_pic_size[1]) - 1)) != 0);
        if (!__pyx_t_128) {
        } else {
          __pyx_t_1 = __pyx_t_128;
          goto __pyx_L32_bool_binop_done;
        }
        __pyx_t_163 = __pyx_v_K;
        __pyx_t_164 = __pyx_v_I;
        __pyx_t_165 = __pyx_v_J;
        __pyx_t_166 = 3;
        __pyx_t_64 = -1;
        if (__pyx_t_163 < 0) {
          __pyx_t_163 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_163 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_163 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_164 < 0) {
          __pyx_t_164 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_164 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_164 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_165 < 0) {
          __pyx_t_165 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_165 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_165 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_166 < 0) {
          __pyx_t_166 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_166 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_166 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 769, __pyx_L1_error)
        }
        __pyx_t_167 = __pyx_v_K;
        __pyx_t_64 = -1;
        if (__pyx_t_167 < 0) {
          __pyx_t_167 += __pyx_pybuffernd_W.diminfo[0].shape;
          if (unlikely(__pyx_t_167 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_167 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 769, __pyx_L1_error)
        }
        __pyx_t_128 = ((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_163, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_164, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_165, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_166, __pyx_pybuffernd_F.diminfo[3].strides)) - (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_167, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) < 0.0) != 0);
        __pyx_t_1 = __pyx_t_128;
        __pyx_L32_bool_binop_done:;
        if (__pyx_t_1) {

          /* "openpiv/process.pyx":770
 *                     F[K,I,J,7]=0.0#dpy=0
 *                 elif F[K,I,J,3] + W[K]/2 > pic_size[1]-1 or F[K,I,J,3] - W[K]/2 < 0: #if corrupted on y-axis do the same
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x             # <<<<<<<<<<<<<<
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 *                     F[K,I,J,6]=0.0#dpx=0
 */
          __pyx_t_168 = __pyx_v_K;
          __pyx_t_169 = __pyx_v_I;
          __pyx_t_170 = __pyx_v_J;
          __pyx_t_171 = 0;
          __pyx_t_64 = -1;
          if (__pyx_t_168 < 0) {
            __pyx_t_168 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_168 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_168 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_169 < 0) {
            __pyx_t_169 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_169 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_169 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_170 < 0) {
            __pyx_t_170 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_170 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_170 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_171 < 0) {
            __pyx_t_171 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_171 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_171 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 770, __pyx_L1_error)
          }
          __pyx_t_172 = __pyx_v_K;
          __pyx_t_173 = __pyx_v_I;
          __pyx_t_174 = __pyx_v_J;
          __pyx_t_175 = 2;
          __pyx_t_64 = -1;
          if (__pyx_t_172 < 0) {
            __pyx_t_172 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_172 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_172 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_173 < 0) {
            __pyx_t_173 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_173 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_173 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_174 < 0) {
            __pyx_t_174 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_174 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_174 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_175 < 0) {
            __pyx_t_175 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_175 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_175 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 770, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_172, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_173, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_174, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_175, __pyx_pybuffernd_F.diminfo[3].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_168, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_169, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_170, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_171, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":771
 *                 elif F[K,I,J,3] + W[K]/2 > pic_size[1]-1 or F[K,I,J,3] - W[K]/2 < 0: #if corrupted on y-axis do the same
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y             # <<<<<<<<<<<<<<
 *                     F[K,I,J,6]=0.0#dpx=0
 *                     F[K,I,J,7]=0.0#dpy=0
 */
          __pyx_t_176 = __pyx_v_K;
          __pyx_t_177 = __pyx_v_I;
          __pyx_t_178 = __pyx_v_J;
          __pyx_t_179 = 1;
          __pyx_t_64 = -1;
          if (__pyx_t_176 < 0) {
            __pyx_t_176 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_176 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_176 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_177 < 0) {
            __pyx_t_177 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_177 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_177 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_178 < 0) {
            __pyx_t_178 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_178 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_178 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_179 < 0) {
            __pyx_t_179 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_179 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_179 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 771, __pyx_L1_error)
          }
          __pyx_t_180 = __pyx_v_K;
          __pyx_t_181 = __pyx_v_I;
          __pyx_t_182 = __pyx_v_J;
          __pyx_t_183 = 3;
          __pyx_t_64 = -1;
          if (__pyx_t_180 < 0) {
            __pyx_t_180 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_180 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_180 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_181 < 0) {
            __pyx_t_181 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_181 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_181 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_182 < 0) {
            __pyx_t_182 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_182 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_182 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_183 < 0) {
            __pyx_t_183 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_183 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_183 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 771, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_180, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_181, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_182, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_183, __pyx_pybuffernd_F.diminfo[3].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_176, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_177, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_178, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_179, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":772
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 *                     F[K,I,J,6]=0.0#dpx=0             # <<<<<<<<<<<<<<
 *                     F[K,I,J,7]=0.0#dpy=0
 *                 #fill windows a and b
 */
          __pyx_t_184 = __pyx_v_K;
          __pyx_t_185 = __pyx_v_I;
          __pyx_t_186 = __pyx_v_J;
          __pyx_t_187 = 6;
          __pyx_t_64 = -1;
          if (__pyx_t_184 < 0) {
            __pyx_t_184 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_184 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_184 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_185 < 0) {
            __pyx_t_185 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_185 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_185 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_186 < 0) {
            __pyx_t_186 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_186 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_186 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_187 < 0) {
            __pyx_t_187 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_187 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_187 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 772, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_184, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_185, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_186, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_187, __pyx_pybuffernd_F.diminfo[3].strides) = 0.0;

          /* "openpiv/process.pyx":773
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 *                     F[K,I,J,6]=0.0#dpx=0
 *                     F[K,I,J,7]=0.0#dpy=0             # <<<<<<<<<<<<<<
 *                 #fill windows a and b
 *                 for L in range(W[K]):
 */
          __pyx_t_188 = __pyx_v_K;
          __pyx_t_189 = __pyx_v_I;
          __pyx_t_190 = __pyx_v_J;
          __pyx_t_191 = 7;
          __pyx_t_64 = -1;
          if (__pyx_t_188 < 0) {
            __pyx_t_188 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_188 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_188 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_189 < 0) {
            __pyx_t_189 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_189 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_189 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_190 < 0) {
            __pyx_t_190 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_190 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_190 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_191 < 0) {
            __pyx_t_191 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_191 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_191 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 773, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_188, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_189, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_190, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_191, __pyx_pybuffernd_F.diminfo[3].strides) = 0.0;

          /* "openpiv/process.pyx":769
 *                     F[K,I,J,6]=0.0#dpx=0
 *                     F[K,I,J,7]=0.0#dpy=0
 *                 elif F[K,I,J,3] + W[K]/2 > pic_size[1]-1 or F[K,I,J,3] - W[K]/2 < 0: #if corrupted on y-axis do the same             # <<<<<<<<<<<<<<
 *                     F[K,I,J,2]=F[K,I,J,0]#xb=x
 *                     F[K,I,J,3]=F[K,I,J,1]#yb=y
 */
        }
        __pyx_L29:;

        /* "openpiv/process.pyx":775
 *                     F[K,I,J,7]=0.0#dpy=0
 *                 #fill windows a and b
 *                 for L in range(W[K]):             # <<<<<<<<<<<<<<
 *                     for M in range(W[K]):
 *                         window_a[L,M]=frame_a[np.int(F[K,I,J,0] - W[K]/2 + L), \
 */
        __pyx_t_192 = __pyx_v_K;
        __pyx_t_64 = -1;
        if (__pyx_t_192 < 0) {
          __pyx_t_192 += __pyx_pybuffernd_W.diminfo[0].shape;
          if (unlikely(__pyx_t_192 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_192 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 775, __pyx_L1_error)
        }
        __pyx_t_193 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_192, __pyx_pybuffernd_W.diminfo[0].strides));
        __pyx_t_194 = __pyx_t_193;
        for (__pyx_t_64 = 0; __pyx_t_64 < __pyx_t_194; __pyx_t_64+=1) {
          __pyx_v_L = __pyx_t_64;

          /* "openpiv/process.pyx":776
 *                 #fill windows a and b
 *                 for L in range(W[K]):
 *                     for M in range(W[K]):             # <<<<<<<<<<<<<<
 *                         window_a[L,M]=frame_a[np.int(F[K,I,J,0] - W[K]/2 + L), \
 *                                             np.int(F[K,I,J,1] - W[K]/2 + M)]
 */
          __pyx_t_195 = __pyx_v_K;
          __pyx_t_196 = -1;
          if (__pyx_t_195 < 0) {
            __pyx_t_195 += __pyx_pybuffernd_W.diminfo[0].shape;
            if (unlikely(__pyx_t_195 < 0)) __pyx_t_196 = 0;
          } else if (unlikely(__pyx_t_195 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_196 = 0;
          if (unlikely(__pyx_t_196 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_196);
            __PYX_ERR(0, 776, __pyx_L1_error)
          }
          __pyx_t_197 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_195, __pyx_pybuffernd_W.diminfo[0].strides));
          __pyx_t_198 = __pyx_t_197;
          for (__pyx_t_196 = 0; __pyx_t_196 < __pyx_t_198; __pyx_t_196+=1) {
            __pyx_v_M = __pyx_t_196;

            /* "openpiv/process.pyx":777
 *                 for L in range(W[K]):
 *                     for M in range(W[K]):
 *                         window_a[L,M]=frame_a[np.int(F[K,I,J,0] - W[K]/2 + L), \             # <<<<<<<<<<<<<<
 *                                             np.int(F[K,I,J,1] - W[K]/2 + M)]
 *                         window_b[L,M]=frame_b[np.int(F[K,I,J,2] - W[K]/2 + L), \
 */
            __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            __pyx_t_199 = __pyx_v_K;
            __pyx_t_200 = __pyx_v_I;
            __pyx_t_201 = __pyx_v_J;
            __pyx_t_202 = 0;
            __pyx_t_203 = -1;
            if (__pyx_t_199 < 0) {
              __pyx_t_199 += __pyx_pybuffernd_F.diminfo[0].shape;
              if (unlikely(__pyx_t_199 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_199 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_203 = 0;
            if (__pyx_t_200 < 0) {
              __pyx_t_200 += __pyx_pybuffernd_F.diminfo[1].shape;
              if (unlikely(__pyx_t_200 < 0)) __pyx_t_203 = 1;
            } else if (unlikely(__pyx_t_200 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_203 = 1;
            if (__pyx_t_201 < 0) {
              __pyx_t_201 += __pyx_pybuffernd_F.diminfo[2].shape;
              if (unlikely(__pyx_t_201 < 0)) __pyx_t_203 = 2;
            } else if (unlikely(__pyx_t_201 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_203 = 2;
            if (__pyx_t_202 < 0) {
              __pyx_t_202 += __pyx_pybuffernd_F.diminfo[3].shape;
              if (unlikely(__pyx_t_202 < 0)) __pyx_t_203 = 3;
            } else if (unlikely(__pyx_t_202 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_203 = 3;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 777, __pyx_L1_error)
            }
            __pyx_t_204 = __pyx_v_K;
            __pyx_t_203 = -1;
            if (__pyx_t_204 < 0) {
              __pyx_t_204 += __pyx_pybuffernd_W.diminfo[0].shape;
              if (unlikely(__pyx_t_204 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_204 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_203 = 0;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 777, __pyx_L1_error)
            }
            __pyx_t_35 = PyFloat_FromDouble((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_199, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_200, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_201, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_202, __pyx_pybuffernd_F.diminfo[3].strides)) - (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_204, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) + __pyx_v_L)); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_36 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_36)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_36);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
              }
            }
            __pyx_t_34 = (__pyx_t_36) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_36, __pyx_t_35) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_35);
            __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_34);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

            /* "openpiv/process.pyx":778
 *                     for M in range(W[K]):
 *                         window_a[L,M]=frame_a[np.int(F[K,I,J,0] - W[K]/2 + L), \
 *                                             np.int(F[K,I,J,1] - W[K]/2 + M)]             # <<<<<<<<<<<<<<
 *                         window_b[L,M]=frame_b[np.int(F[K,I,J,2] - W[K]/2 + L), \
 *                                             np.int(F[K,I,J,3] - W[K]/2 + M)]
 */
            __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 778, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_int); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 778, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_36);
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            __pyx_t_205 = __pyx_v_K;
            __pyx_t_206 = __pyx_v_I;
            __pyx_t_207 = __pyx_v_J;
            __pyx_t_208 = 1;
            __pyx_t_203 = -1;
            if (__pyx_t_205 < 0) {
              __pyx_t_205 += __pyx_pybuffernd_F.diminfo[0].shape;
              if (unlikely(__pyx_t_205 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_205 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_203 = 0;
            if (__pyx_t_206 < 0) {
              __pyx_t_206 += __pyx_pybuffernd_F.diminfo[1].shape;
              if (unlikely(__pyx_t_206 < 0)) __pyx_t_203 = 1;
            } else if (unlikely(__pyx_t_206 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_203 = 1;
            if (__pyx_t_207 < 0) {
              __pyx_t_207 += __pyx_pybuffernd_F.diminfo[2].shape;
              if (unlikely(__pyx_t_207 < 0)) __pyx_t_203 = 2;
            } else if (unlikely(__pyx_t_207 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_203 = 2;
            if (__pyx_t_208 < 0) {
              __pyx_t_208 += __pyx_pybuffernd_F.diminfo[3].shape;
              if (unlikely(__pyx_t_208 < 0)) __pyx_t_203 = 3;
            } else if (unlikely(__pyx_t_208 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_203 = 3;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 778, __pyx_L1_error)
            }
            __pyx_t_209 = __pyx_v_K;
            __pyx_t_203 = -1;
            if (__pyx_t_209 < 0) {
              __pyx_t_209 += __pyx_pybuffernd_W.diminfo[0].shape;
              if (unlikely(__pyx_t_209 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_209 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_203 = 0;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 778, __pyx_L1_error)
            }
            __pyx_t_35 = PyFloat_FromDouble((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_205, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_206, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_207, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_208, __pyx_pybuffernd_F.diminfo[3].strides)) - (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_209, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) + __pyx_v_M)); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 778, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_36))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_36);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_36);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_36, function);
              }
            }
            __pyx_t_15 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_36, __pyx_t_5, __pyx_t_35) : __Pyx_PyObject_CallOneArg(__pyx_t_36, __pyx_t_35);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 778, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;

            /* "openpiv/process.pyx":777
 *                 for L in range(W[K]):
 *                     for M in range(W[K]):
 *                         window_a[L,M]=frame_a[np.int(F[K,I,J,0] - W[K]/2 + L), \             # <<<<<<<<<<<<<<
 *                                             np.int(F[K,I,J,1] - W[K]/2 + M)]
 *                         window_b[L,M]=frame_b[np.int(F[K,I,J,2] - W[K]/2 + L), \
 */
            __pyx_t_36 = PyTuple_New(2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_36);
            __Pyx_GIVEREF(__pyx_t_34);
            PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_34);
            __Pyx_GIVEREF(__pyx_t_15);
            PyTuple_SET_ITEM(__pyx_t_36, 1, __pyx_t_15);
            __pyx_t_34 = 0;
            __pyx_t_15 = 0;
            __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_frame_a), __pyx_t_36); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
            __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_L); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_36);
            __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_M); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_34);
            __pyx_t_35 = PyTuple_New(2); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __Pyx_GIVEREF(__pyx_t_36);
            PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_36);
            __Pyx_GIVEREF(__pyx_t_34);
            PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_t_34);
            __pyx_t_36 = 0;
            __pyx_t_34 = 0;
            if (unlikely(PyObject_SetItem(__pyx_v_window_a, __pyx_t_35, __pyx_t_15) < 0)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

            /* "openpiv/process.pyx":779
 *                         window_a[L,M]=frame_a[np.int(F[K,I,J,0] - W[K]/2 + L), \
 *                                             np.int(F[K,I,J,1] - W[K]/2 + M)]
 *                         window_b[L,M]=frame_b[np.int(F[K,I,J,2] - W[K]/2 + L), \             # <<<<<<<<<<<<<<
 *                                             np.int(F[K,I,J,3] - W[K]/2 + M)]
 *                 #perform correlation of the two windows
 */
            __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_int); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_34);
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            __pyx_t_210 = __pyx_v_K;
            __pyx_t_211 = __pyx_v_I;
            __pyx_t_212 = __pyx_v_J;
            __pyx_t_213 = 2;
            __pyx_t_203 = -1;
            if (__pyx_t_210 < 0) {
              __pyx_t_210 += __pyx_pybuffernd_F.diminfo[0].shape;
              if (unlikely(__pyx_t_210 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_210 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_203 = 0;
            if (__pyx_t_211 < 0) {
              __pyx_t_211 += __pyx_pybuffernd_F.diminfo[1].shape;
              if (unlikely(__pyx_t_211 < 0)) __pyx_t_203 = 1;
            } else if (unlikely(__pyx_t_211 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_203 = 1;
            if (__pyx_t_212 < 0) {
              __pyx_t_212 += __pyx_pybuffernd_F.diminfo[2].shape;
              if (unlikely(__pyx_t_212 < 0)) __pyx_t_203 = 2;
            } else if (unlikely(__pyx_t_212 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_203 = 2;
            if (__pyx_t_213 < 0) {
              __pyx_t_213 += __pyx_pybuffernd_F.diminfo[3].shape;
              if (unlikely(__pyx_t_213 < 0)) __pyx_t_203 = 3;
            } else if (unlikely(__pyx_t_213 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_203 = 3;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 779, __pyx_L1_error)
            }
            __pyx_t_214 = __pyx_v_K;
            __pyx_t_203 = -1;
            if (__pyx_t_214 < 0) {
              __pyx_t_214 += __pyx_pybuffernd_W.diminfo[0].shape;
              if (unlikely(__pyx_t_214 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_214 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_203 = 0;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 779, __pyx_L1_error)
            }
            __pyx_t_35 = PyFloat_FromDouble((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_210, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_211, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_212, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_213, __pyx_pybuffernd_F.diminfo[3].strides)) - (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_214, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) + __pyx_v_L)); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_36 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
              __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_34);
              if (likely(__pyx_t_36)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
                __Pyx_INCREF(__pyx_t_36);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_34, function);
              }
            }
            __pyx_t_15 = (__pyx_t_36) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_36, __pyx_t_35) : __Pyx_PyObject_CallOneArg(__pyx_t_34, __pyx_t_35);
            __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;

            /* "openpiv/process.pyx":780
 *                                             np.int(F[K,I,J,1] - W[K]/2 + M)]
 *                         window_b[L,M]=frame_b[np.int(F[K,I,J,2] - W[K]/2 + L), \
 *                                             np.int(F[K,I,J,3] - W[K]/2 + M)]             # <<<<<<<<<<<<<<
 *                 #perform correlation of the two windows
 *                 corr = correlate_windows( window_b, window_a, nfftx=nfftx, nffty=nffty )
 */
            __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 780, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_int); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 780, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_36);
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            __pyx_t_215 = __pyx_v_K;
            __pyx_t_216 = __pyx_v_I;
            __pyx_t_217 = __pyx_v_J;
            __pyx_t_218 = 3;
            __pyx_t_203 = -1;
            if (__pyx_t_215 < 0) {
              __pyx_t_215 += __pyx_pybuffernd_F.diminfo[0].shape;
              if (unlikely(__pyx_t_215 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_215 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_203 = 0;
            if (__pyx_t_216 < 0) {
              __pyx_t_216 += __pyx_pybuffernd_F.diminfo[1].shape;
              if (unlikely(__pyx_t_216 < 0)) __pyx_t_203 = 1;
            } else if (unlikely(__pyx_t_216 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_203 = 1;
            if (__pyx_t_217 < 0) {
              __pyx_t_217 += __pyx_pybuffernd_F.diminfo[2].shape;
              if (unlikely(__pyx_t_217 < 0)) __pyx_t_203 = 2;
            } else if (unlikely(__pyx_t_217 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_203 = 2;
            if (__pyx_t_218 < 0) {
              __pyx_t_218 += __pyx_pybuffernd_F.diminfo[3].shape;
              if (unlikely(__pyx_t_218 < 0)) __pyx_t_203 = 3;
            } else if (unlikely(__pyx_t_218 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_203 = 3;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 780, __pyx_L1_error)
            }
            __pyx_t_219 = __pyx_v_K;
            __pyx_t_203 = -1;
            if (__pyx_t_219 < 0) {
              __pyx_t_219 += __pyx_pybuffernd_W.diminfo[0].shape;
              if (unlikely(__pyx_t_219 < 0)) __pyx_t_203 = 0;
            } else if (unlikely(__pyx_t_219 >= __pyx_pybuffernd_W.diminfo[0].shape)) __pyx_t_203 = 0;
            if (unlikely(__pyx_t_203 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_203);
              __PYX_ERR(0, 780, __pyx_L1_error)
            }
            __pyx_t_35 = PyFloat_FromDouble((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_215, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_216, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_217, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_218, __pyx_pybuffernd_F.diminfo[3].strides)) - (((double)(*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_W.rcbuffer->pybuffer.buf, __pyx_t_219, __pyx_pybuffernd_W.diminfo[0].strides))) / 2.0)) + __pyx_v_M)); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 780, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_36))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_36);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_36);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_36, function);
              }
            }
            __pyx_t_34 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_36, __pyx_t_5, __pyx_t_35) : __Pyx_PyObject_CallOneArg(__pyx_t_36, __pyx_t_35);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 780, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_34);
            __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;

            /* "openpiv/process.pyx":779
 *                         window_a[L,M]=frame_a[np.int(F[K,I,J,0] - W[K]/2 + L), \
 *                                             np.int(F[K,I,J,1] - W[K]/2 + M)]
 *                         window_b[L,M]=frame_b[np.int(F[K,I,J,2] - W[K]/2 + L), \             # <<<<<<<<<<<<<<
 *                                             np.int(F[K,I,J,3] - W[K]/2 + M)]
 *                 #perform correlation of the two windows
 */
            __pyx_t_36 = PyTuple_New(2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_36);
            __Pyx_GIVEREF(__pyx_t_15);
            PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_15);
            __Pyx_GIVEREF(__pyx_t_34);
            PyTuple_SET_ITEM(__pyx_t_36, 1, __pyx_t_34);
            __pyx_t_15 = 0;
            __pyx_t_34 = 0;
            __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_frame_b), __pyx_t_36); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_34);
            __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
            __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_L); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_36);
            __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_M); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_35 = PyTuple_New(2); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_35);
            __Pyx_GIVEREF(__pyx_t_36);
            PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_36);
            __Pyx_GIVEREF(__pyx_t_15);
            PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_t_15);
            __pyx_t_36 = 0;
            __pyx_t_15 = 0;
            if (unlikely(PyObject_SetItem(__pyx_v_window_b, __pyx_t_35, __pyx_t_34) < 0)) __PYX_ERR(0, 779, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
            __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
          }
        }

        /* "openpiv/process.pyx":782
 *                                             np.int(F[K,I,J,3] - W[K]/2 + M)]
 *                 #perform correlation of the two windows
 *                 corr = correlate_windows( window_b, window_a, nfftx=nfftx, nffty=nffty )             # <<<<<<<<<<<<<<
 *                 c = CorrelationFunction( corr )
 *                 F[K,I,J,12] = c.sig2noise_ratio( sig2noise_method, width )#compute sig2noise
 */
        __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_correlate_windows); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __pyx_t_35 = PyTuple_New(2); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_35);
        __Pyx_INCREF(__pyx_v_window_b);
        __Pyx_GIVEREF(__pyx_v_window_b);
        PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_v_window_b);
        __Pyx_INCREF(__pyx_v_window_a);
        __Pyx_GIVEREF(__pyx_v_window_a);
        PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_v_window_a);
        __pyx_t_15 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_nfftx, __pyx_v_nfftx) < 0) __PYX_ERR(0, 782, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_nffty, __pyx_v_nffty) < 0) __PYX_ERR(0, 782, __pyx_L1_error)
        __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_t_35, __pyx_t_15); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF_SET(__pyx_v_corr, __pyx_t_36);
        __pyx_t_36 = 0;

        /* "openpiv/process.pyx":783
 *                 #perform correlation of the two windows
 *                 corr = correlate_windows( window_b, window_a, nfftx=nfftx, nffty=nffty )
 *                 c = CorrelationFunction( corr )             # <<<<<<<<<<<<<<
 *                 F[K,I,J,12] = c.sig2noise_ratio( sig2noise_method, width )#compute sig2noise
 *                 i_peak, j_peak = c.subpixel_peak_position( subpixel_method )#get peak position
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_CorrelationFunction); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_35 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_35 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_35)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_35);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_36 = (__pyx_t_35) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_35, __pyx_v_corr) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_corr);
        __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0;
        if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_36);
        __pyx_t_36 = 0;

        /* "openpiv/process.pyx":784
 *                 corr = correlate_windows( window_b, window_a, nfftx=nfftx, nffty=nffty )
 *                 c = CorrelationFunction( corr )
 *                 F[K,I,J,12] = c.sig2noise_ratio( sig2noise_method, width )#compute sig2noise             # <<<<<<<<<<<<<<
 *                 i_peak, j_peak = c.subpixel_peak_position( subpixel_method )#get peak position
 *                 if np.any(np.isnan((i_peak, j_peak))) or mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 0:#prevent 'Not a Number' peak location
 */
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_sig2noise_ratio); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 784, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_35 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 784, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_35);
        __pyx_t_34 = NULL;
        __pyx_t_64 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_34)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_34);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_64 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_15)) {
          PyObject *__pyx_temp[3] = {__pyx_t_34, __pyx_v_sig2noise_method, __pyx_t_35};
          __pyx_t_36 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_64, 2+__pyx_t_64); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 784, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
          PyObject *__pyx_temp[3] = {__pyx_t_34, __pyx_v_sig2noise_method, __pyx_t_35};
          __pyx_t_36 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_64, 2+__pyx_t_64); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 784, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(2+__pyx_t_64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 784, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (__pyx_t_34) {
            __Pyx_GIVEREF(__pyx_t_34); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_34); __pyx_t_34 = NULL;
          }
          __Pyx_INCREF(__pyx_v_sig2noise_method);
          __Pyx_GIVEREF(__pyx_v_sig2noise_method);
          PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_64, __pyx_v_sig2noise_method);
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_64, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_5, NULL); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 784, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_36); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 784, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        __pyx_t_220 = __pyx_v_K;
        __pyx_t_221 = __pyx_v_I;
        __pyx_t_222 = __pyx_v_J;
        __pyx_t_223 = 12;
        __pyx_t_64 = -1;
        if (__pyx_t_220 < 0) {
          __pyx_t_220 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_220 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_220 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_221 < 0) {
          __pyx_t_221 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_221 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_221 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_222 < 0) {
          __pyx_t_222 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_222 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_222 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_223 < 0) {
          __pyx_t_223 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_223 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_223 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 784, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_220, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_221, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_222, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_223, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

        /* "openpiv/process.pyx":785
 *                 c = CorrelationFunction( corr )
 *                 F[K,I,J,12] = c.sig2noise_ratio( sig2noise_method, width )#compute sig2noise
 *                 i_peak, j_peak = c.subpixel_peak_position( subpixel_method )#get peak position             # <<<<<<<<<<<<<<
 *                 if np.any(np.isnan((i_peak, j_peak))) or mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 0:#prevent 'Not a Number' peak location
 *                 #if np.any(np.isnan((i_peak, j_peak))):
 */
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_subpixel_peak_position); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 785, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_36 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_5, __pyx_v_subpixel_method) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_subpixel_method);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 785, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_36))) || (PyList_CheckExact(__pyx_t_36))) {
          PyObject* sequence = __pyx_t_36;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 785, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_15 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_5);
          #else
          __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_35 = PyObject_GetIter(__pyx_t_36); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
          __pyx_t_95 = Py_TYPE(__pyx_t_35)->tp_iternext;
          index = 0; __pyx_t_15 = __pyx_t_95(__pyx_t_35); if (unlikely(!__pyx_t_15)) goto __pyx_L38_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_15);
          index = 1; __pyx_t_5 = __pyx_t_95(__pyx_t_35); if (unlikely(!__pyx_t_5)) goto __pyx_L38_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_95(__pyx_t_35), 2) < 0) __PYX_ERR(0, 785, __pyx_L1_error)
          __pyx_t_95 = NULL;
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
          goto __pyx_L39_unpacking_done;
          __pyx_L38_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
          __pyx_t_95 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 785, __pyx_L1_error)
          __pyx_L39_unpacking_done:;
        }
        __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_15); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_i_peak = __pyx_t_37;
        __pyx_v_j_peak = __pyx_t_224;

        /* "openpiv/process.pyx":786
 *                 F[K,I,J,12] = c.sig2noise_ratio( sig2noise_method, width )#compute sig2noise
 *                 i_peak, j_peak = c.subpixel_peak_position( subpixel_method )#get peak position
 *                 if np.any(np.isnan((i_peak, j_peak))) or mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 0:#prevent 'Not a Number' peak location             # <<<<<<<<<<<<<<
 *                 #if np.any(np.isnan((i_peak, j_peak))):
 *                     F[K,I,J,8]=0.0
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_any); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_35);
        __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_isnan); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __pyx_t_35 = PyFloat_FromDouble(__pyx_v_i_peak); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_35);
        __pyx_t_33 = PyFloat_FromDouble(__pyx_v_j_peak); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_33);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_35);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_35);
        __Pyx_GIVEREF(__pyx_t_33);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_33);
        __pyx_t_35 = 0;
        __pyx_t_33 = 0;
        __pyx_t_33 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
          __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_34);
          if (likely(__pyx_t_33)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
            __Pyx_INCREF(__pyx_t_33);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_34, function);
          }
        }
        __pyx_t_5 = (__pyx_t_33) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_33, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_34, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __pyx_t_34 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_34)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_34);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_36 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_34, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_128 = __Pyx_PyObject_IsTrue(__pyx_t_36); if (unlikely(__pyx_t_128 < 0)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        if (!__pyx_t_128) {
        } else {
          __pyx_t_1 = __pyx_t_128;
          goto __pyx_L41_bool_binop_done;
        }
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_225 = __pyx_v_K;
        __pyx_t_226 = __pyx_v_I;
        __pyx_t_227 = __pyx_v_J;
        __pyx_t_228 = 0;
        __pyx_t_64 = -1;
        if (__pyx_t_225 < 0) {
          __pyx_t_225 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_225 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_225 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_226 < 0) {
          __pyx_t_226 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_226 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_226 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_227 < 0) {
          __pyx_t_227 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_227 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_227 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_228 < 0) {
          __pyx_t_228 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_228 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_228 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 786, __pyx_L1_error)
        }
        __pyx_t_15 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_225, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_226, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_227, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_228, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_34 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_34)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_34);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_36 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_34, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_15);
        __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_229 = __pyx_v_K;
        __pyx_t_230 = __pyx_v_I;
        __pyx_t_231 = __pyx_v_J;
        __pyx_t_232 = 1;
        __pyx_t_64 = -1;
        if (__pyx_t_229 < 0) {
          __pyx_t_229 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_229 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_229 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_230 < 0) {
          __pyx_t_230 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_230 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_230 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_231 < 0) {
          __pyx_t_231 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_231 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_231 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_232 < 0) {
          __pyx_t_232 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_232 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_232 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 786, __pyx_L1_error)
        }
        __pyx_t_15 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_229, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_230, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_231, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_232, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_34);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_34, function);
          }
        }
        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_4, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_34, __pyx_t_15);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_GIVEREF(__pyx_t_36);
        PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_36);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_t_5);
        __pyx_t_36 = 0;
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_mark), __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __pyx_t_34 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_128 = __Pyx_PyObject_IsTrue(__pyx_t_34); if (unlikely(__pyx_t_128 < 0)) __PYX_ERR(0, 786, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __pyx_t_1 = __pyx_t_128;
        __pyx_L41_bool_binop_done:;
        if (__pyx_t_1) {

          /* "openpiv/process.pyx":788
 *                 if np.any(np.isnan((i_peak, j_peak))) or mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 0:#prevent 'Not a Number' peak location
 *                 #if np.any(np.isnan((i_peak, j_peak))):
 *                     F[K,I,J,8]=0.0             # <<<<<<<<<<<<<<
 *                     F[K,I,J,9]=0.0
 *                 else:
 */
          __pyx_t_233 = __pyx_v_K;
          __pyx_t_234 = __pyx_v_I;
          __pyx_t_235 = __pyx_v_J;
          __pyx_t_236 = 8;
          __pyx_t_64 = -1;
          if (__pyx_t_233 < 0) {
            __pyx_t_233 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_233 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_233 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_234 < 0) {
            __pyx_t_234 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_234 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_234 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_235 < 0) {
            __pyx_t_235 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_235 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_235 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_236 < 0) {
            __pyx_t_236 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_236 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_236 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 788, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_233, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_234, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_235, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_236, __pyx_pybuffernd_F.diminfo[3].strides) = 0.0;

          /* "openpiv/process.pyx":789
 *                 #if np.any(np.isnan((i_peak, j_peak))):
 *                     F[K,I,J,8]=0.0
 *                     F[K,I,J,9]=0.0             # <<<<<<<<<<<<<<
 *                 else:
 *                     #find residual displacement dcx and dcy
 */
          __pyx_t_237 = __pyx_v_K;
          __pyx_t_238 = __pyx_v_I;
          __pyx_t_239 = __pyx_v_J;
          __pyx_t_240 = 9;
          __pyx_t_64 = -1;
          if (__pyx_t_237 < 0) {
            __pyx_t_237 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_237 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_237 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_238 < 0) {
            __pyx_t_238 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_238 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_238 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_239 < 0) {
            __pyx_t_239 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_239 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_239 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_240 < 0) {
            __pyx_t_240 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_240 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_240 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 789, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_237, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_238, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_239, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_240, __pyx_pybuffernd_F.diminfo[3].strides) = 0.0;

          /* "openpiv/process.pyx":786
 *                 F[K,I,J,12] = c.sig2noise_ratio( sig2noise_method, width )#compute sig2noise
 *                 i_peak, j_peak = c.subpixel_peak_position( subpixel_method )#get peak position
 *                 if np.any(np.isnan((i_peak, j_peak))) or mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 0:#prevent 'Not a Number' peak location             # <<<<<<<<<<<<<<
 *                 #if np.any(np.isnan((i_peak, j_peak))):
 *                     F[K,I,J,8]=0.0
 */
          goto __pyx_L40;
        }

        /* "openpiv/process.pyx":792
 *                 else:
 *                     #find residual displacement dcx and dcy
 *                     F[K,I,J,8]=i_peak - corr.shape[0]/2#dcx             # <<<<<<<<<<<<<<
 *                     F[K,I,J,9]=j_peak - corr.shape[1]/2#dcy
 *                 residual = residual + np.sqrt(F[K,I,J,8]*F[K,I,J,8]+F[K,I,J,9]*F[K,I,J,9])
 */
        /*else*/ {
          __pyx_t_34 = PyFloat_FromDouble(__pyx_v_i_peak); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_34);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_corr, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_36 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_36, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
          __pyx_t_36 = PyNumber_Subtract(__pyx_t_34, __pyx_t_5); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_36); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 792, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
          __pyx_t_241 = __pyx_v_K;
          __pyx_t_242 = __pyx_v_I;
          __pyx_t_243 = __pyx_v_J;
          __pyx_t_244 = 8;
          __pyx_t_64 = -1;
          if (__pyx_t_241 < 0) {
            __pyx_t_241 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_241 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_241 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_242 < 0) {
            __pyx_t_242 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_242 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_242 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_243 < 0) {
            __pyx_t_243 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_243 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_243 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_244 < 0) {
            __pyx_t_244 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_244 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_244 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 792, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_241, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_242, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_243, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_244, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

          /* "openpiv/process.pyx":793
 *                     #find residual displacement dcx and dcy
 *                     F[K,I,J,8]=i_peak - corr.shape[0]/2#dcx
 *                     F[K,I,J,9]=j_peak - corr.shape[1]/2#dcy             # <<<<<<<<<<<<<<
 *                 residual = residual + np.sqrt(F[K,I,J,8]*F[K,I,J,8]+F[K,I,J,9]*F[K,I,J,9])
 *                 #get new displacement prediction
 */
          __pyx_t_36 = PyFloat_FromDouble(__pyx_v_j_peak); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_corr, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_34 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_34);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_34, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
          __pyx_t_34 = PyNumber_Subtract(__pyx_t_36, __pyx_t_5); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_34);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_34); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
          __pyx_t_245 = __pyx_v_K;
          __pyx_t_246 = __pyx_v_I;
          __pyx_t_247 = __pyx_v_J;
          __pyx_t_248 = 9;
          __pyx_t_64 = -1;
          if (__pyx_t_245 < 0) {
            __pyx_t_245 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_245 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_245 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_246 < 0) {
            __pyx_t_246 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_246 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_246 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_247 < 0) {
            __pyx_t_247 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_247 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_247 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_248 < 0) {
            __pyx_t_248 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_248 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_248 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 793, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_245, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_246, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_247, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_248, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;
        }
        __pyx_L40:;

        /* "openpiv/process.pyx":794
 *                     F[K,I,J,8]=i_peak - corr.shape[0]/2#dcx
 *                     F[K,I,J,9]=j_peak - corr.shape[1]/2#dcy
 *                 residual = residual + np.sqrt(F[K,I,J,8]*F[K,I,J,8]+F[K,I,J,9]*F[K,I,J,9])             # <<<<<<<<<<<<<<
 *                 #get new displacement prediction
 *                 F[K,I,J,4]=F[K,I,J,6]+F[K,I,J,8]#dx=dpx+dcx
 */
        __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_residual); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        __pyx_t_249 = __pyx_v_K;
        __pyx_t_250 = __pyx_v_I;
        __pyx_t_251 = __pyx_v_J;
        __pyx_t_252 = 8;
        __pyx_t_64 = -1;
        if (__pyx_t_249 < 0) {
          __pyx_t_249 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_249 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_249 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_250 < 0) {
          __pyx_t_250 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_250 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_250 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_251 < 0) {
          __pyx_t_251 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_251 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_251 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_252 < 0) {
          __pyx_t_252 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_252 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_252 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 794, __pyx_L1_error)
        }
        __pyx_t_253 = __pyx_v_K;
        __pyx_t_254 = __pyx_v_I;
        __pyx_t_255 = __pyx_v_J;
        __pyx_t_256 = 8;
        __pyx_t_64 = -1;
        if (__pyx_t_253 < 0) {
          __pyx_t_253 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_253 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_253 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_254 < 0) {
          __pyx_t_254 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_254 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_254 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_255 < 0) {
          __pyx_t_255 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_255 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_255 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_256 < 0) {
          __pyx_t_256 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_256 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_256 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 794, __pyx_L1_error)
        }
        __pyx_t_257 = __pyx_v_K;
        __pyx_t_258 = __pyx_v_I;
        __pyx_t_259 = __pyx_v_J;
        __pyx_t_260 = 9;
        __pyx_t_64 = -1;
        if (__pyx_t_257 < 0) {
          __pyx_t_257 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_257 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_257 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_258 < 0) {
          __pyx_t_258 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_258 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_258 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_259 < 0) {
          __pyx_t_259 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_259 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_259 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_260 < 0) {
          __pyx_t_260 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_260 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_260 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 794, __pyx_L1_error)
        }
        __pyx_t_261 = __pyx_v_K;
        __pyx_t_262 = __pyx_v_I;
        __pyx_t_263 = __pyx_v_J;
        __pyx_t_264 = 9;
        __pyx_t_64 = -1;
        if (__pyx_t_261 < 0) {
          __pyx_t_261 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_261 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_261 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_262 < 0) {
          __pyx_t_262 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_262 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_262 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_263 < 0) {
          __pyx_t_263 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_263 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_263 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_264 < 0) {
          __pyx_t_264 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_264 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_264 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 794, __pyx_L1_error)
        }
        __pyx_t_36 = PyFloat_FromDouble((((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_249, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_250, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_251, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_252, __pyx_pybuffernd_F.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_253, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_254, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_255, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_256, __pyx_pybuffernd_F.diminfo[3].strides))) + ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_257, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_258, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_259, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_260, __pyx_pybuffernd_F.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_261, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_262, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_263, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_264, __pyx_pybuffernd_F.diminfo[3].strides))))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_4, __pyx_t_36) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_36);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = PyNumber_Add(__pyx_t_34, __pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_64 = __Pyx_PyInt_As_int(__pyx_t_15); if (unlikely((__pyx_t_64 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_v_residual = __pyx_t_64;

        /* "openpiv/process.pyx":796
 *                 residual = residual + np.sqrt(F[K,I,J,8]*F[K,I,J,8]+F[K,I,J,9]*F[K,I,J,9])
 *                 #get new displacement prediction
 *                 F[K,I,J,4]=F[K,I,J,6]+F[K,I,J,8]#dx=dpx+dcx             # <<<<<<<<<<<<<<
 *                 F[K,I,J,5]=F[K,I,J,7]+F[K,I,J,9]#dy=dpy+dcy
 *                 #get new velocity vectors
 */
        __pyx_t_265 = __pyx_v_K;
        __pyx_t_266 = __pyx_v_I;
        __pyx_t_267 = __pyx_v_J;
        __pyx_t_268 = 6;
        __pyx_t_64 = -1;
        if (__pyx_t_265 < 0) {
          __pyx_t_265 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_265 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_265 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_266 < 0) {
          __pyx_t_266 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_266 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_266 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_267 < 0) {
          __pyx_t_267 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_267 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_267 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_268 < 0) {
          __pyx_t_268 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_268 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_268 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 796, __pyx_L1_error)
        }
        __pyx_t_269 = __pyx_v_K;
        __pyx_t_270 = __pyx_v_I;
        __pyx_t_271 = __pyx_v_J;
        __pyx_t_272 = 8;
        __pyx_t_64 = -1;
        if (__pyx_t_269 < 0) {
          __pyx_t_269 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_269 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_269 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_270 < 0) {
          __pyx_t_270 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_270 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_270 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_271 < 0) {
          __pyx_t_271 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_271 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_271 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_272 < 0) {
          __pyx_t_272 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_272 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_272 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 796, __pyx_L1_error)
        }
        __pyx_t_273 = __pyx_v_K;
        __pyx_t_274 = __pyx_v_I;
        __pyx_t_275 = __pyx_v_J;
        __pyx_t_276 = 4;
        __pyx_t_64 = -1;
        if (__pyx_t_273 < 0) {
          __pyx_t_273 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_273 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_273 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_274 < 0) {
          __pyx_t_274 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_274 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_274 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_275 < 0) {
          __pyx_t_275 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_275 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_275 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_276 < 0) {
          __pyx_t_276 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_276 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_276 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 796, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_273, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_274, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_275, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_276, __pyx_pybuffernd_F.diminfo[3].strides) = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_265, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_266, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_267, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_268, __pyx_pybuffernd_F.diminfo[3].strides)) + (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_269, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_270, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_271, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_272, __pyx_pybuffernd_F.diminfo[3].strides)));

        /* "openpiv/process.pyx":797
 *                 #get new displacement prediction
 *                 F[K,I,J,4]=F[K,I,J,6]+F[K,I,J,8]#dx=dpx+dcx
 *                 F[K,I,J,5]=F[K,I,J,7]+F[K,I,J,9]#dy=dpy+dcy             # <<<<<<<<<<<<<<
 *                 #get new velocity vectors
 *                 F[K,I,J,10]=F[K,I,J,5] / dt #u=dy/dt
 */
        __pyx_t_277 = __pyx_v_K;
        __pyx_t_278 = __pyx_v_I;
        __pyx_t_279 = __pyx_v_J;
        __pyx_t_280 = 7;
        __pyx_t_64 = -1;
        if (__pyx_t_277 < 0) {
          __pyx_t_277 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_277 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_277 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_278 < 0) {
          __pyx_t_278 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_278 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_278 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_279 < 0) {
          __pyx_t_279 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_279 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_279 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_280 < 0) {
          __pyx_t_280 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_280 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_280 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 797, __pyx_L1_error)
        }
        __pyx_t_281 = __pyx_v_K;
        __pyx_t_282 = __pyx_v_I;
        __pyx_t_283 = __pyx_v_J;
        __pyx_t_284 = 9;
        __pyx_t_64 = -1;
        if (__pyx_t_281 < 0) {
          __pyx_t_281 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_281 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_281 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_282 < 0) {
          __pyx_t_282 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_282 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_282 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_283 < 0) {
          __pyx_t_283 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_283 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_283 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_284 < 0) {
          __pyx_t_284 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_284 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_284 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 797, __pyx_L1_error)
        }
        __pyx_t_285 = __pyx_v_K;
        __pyx_t_286 = __pyx_v_I;
        __pyx_t_287 = __pyx_v_J;
        __pyx_t_288 = 5;
        __pyx_t_64 = -1;
        if (__pyx_t_285 < 0) {
          __pyx_t_285 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_285 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_285 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_286 < 0) {
          __pyx_t_286 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_286 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_286 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_287 < 0) {
          __pyx_t_287 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_287 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_287 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_288 < 0) {
          __pyx_t_288 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_288 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_288 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 797, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_285, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_286, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_287, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_288, __pyx_pybuffernd_F.diminfo[3].strides) = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_277, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_278, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_279, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_280, __pyx_pybuffernd_F.diminfo[3].strides)) + (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_281, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_282, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_283, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_284, __pyx_pybuffernd_F.diminfo[3].strides)));

        /* "openpiv/process.pyx":799
 *                 F[K,I,J,5]=F[K,I,J,7]+F[K,I,J,9]#dy=dpy+dcy
 *                 #get new velocity vectors
 *                 F[K,I,J,10]=F[K,I,J,5] / dt #u=dy/dt             # <<<<<<<<<<<<<<
 *                 F[K,I,J,11]=-F[K,I,J,4] / dt #v=-dx/dt
 *         # pbar.finish()#close progress bar
 */
        __pyx_t_289 = __pyx_v_K;
        __pyx_t_290 = __pyx_v_I;
        __pyx_t_291 = __pyx_v_J;
        __pyx_t_292 = 5;
        __pyx_t_64 = -1;
        if (__pyx_t_289 < 0) {
          __pyx_t_289 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_289 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_289 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_290 < 0) {
          __pyx_t_290 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_290 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_290 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_291 < 0) {
          __pyx_t_291 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_291 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_291 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_292 < 0) {
          __pyx_t_292 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_292 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_292 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 799, __pyx_L1_error)
        }
        __pyx_t_106 = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_289, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_290, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_291, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_292, __pyx_pybuffernd_F.diminfo[3].strides));
        if (unlikely(__pyx_v_dt == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 799, __pyx_L1_error)
        }
        __pyx_t_293 = __pyx_v_K;
        __pyx_t_294 = __pyx_v_I;
        __pyx_t_295 = __pyx_v_J;
        __pyx_t_296 = 10;
        __pyx_t_64 = -1;
        if (__pyx_t_293 < 0) {
          __pyx_t_293 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_293 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_293 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_294 < 0) {
          __pyx_t_294 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_294 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_294 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_295 < 0) {
          __pyx_t_295 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_295 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_295 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_296 < 0) {
          __pyx_t_296 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_296 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_296 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 799, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_293, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_294, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_295, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_296, __pyx_pybuffernd_F.diminfo[3].strides) = (__pyx_t_106 / ((__pyx_t_7openpiv_7process_DTYPEf_t)__pyx_v_dt));

        /* "openpiv/process.pyx":800
 *                 #get new velocity vectors
 *                 F[K,I,J,10]=F[K,I,J,5] / dt #u=dy/dt
 *                 F[K,I,J,11]=-F[K,I,J,4] / dt #v=-dx/dt             # <<<<<<<<<<<<<<
 *         # pbar.finish()#close progress bar
 *         print("..[DONE]")
 */
        __pyx_t_297 = __pyx_v_K;
        __pyx_t_298 = __pyx_v_I;
        __pyx_t_299 = __pyx_v_J;
        __pyx_t_300 = 4;
        __pyx_t_64 = -1;
        if (__pyx_t_297 < 0) {
          __pyx_t_297 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_297 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_297 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_298 < 0) {
          __pyx_t_298 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_298 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_298 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_299 < 0) {
          __pyx_t_299 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_299 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_299 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_300 < 0) {
          __pyx_t_300 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_300 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_300 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 800, __pyx_L1_error)
        }
        __pyx_t_106 = (-(*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_297, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_298, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_299, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_300, __pyx_pybuffernd_F.diminfo[3].strides)));
        if (unlikely(__pyx_v_dt == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 800, __pyx_L1_error)
        }
        __pyx_t_301 = __pyx_v_K;
        __pyx_t_302 = __pyx_v_I;
        __pyx_t_303 = __pyx_v_J;
        __pyx_t_304 = 11;
        __pyx_t_64 = -1;
        if (__pyx_t_301 < 0) {
          __pyx_t_301 += __pyx_pybuffernd_F.diminfo[0].shape;
          if (unlikely(__pyx_t_301 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_301 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
        if (__pyx_t_302 < 0) {
          __pyx_t_302 += __pyx_pybuffernd_F.diminfo[1].shape;
          if (unlikely(__pyx_t_302 < 0)) __pyx_t_64 = 1;
        } else if (unlikely(__pyx_t_302 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
        if (__pyx_t_303 < 0) {
          __pyx_t_303 += __pyx_pybuffernd_F.diminfo[2].shape;
          if (unlikely(__pyx_t_303 < 0)) __pyx_t_64 = 2;
        } else if (unlikely(__pyx_t_303 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
        if (__pyx_t_304 < 0) {
          __pyx_t_304 += __pyx_pybuffernd_F.diminfo[3].shape;
          if (unlikely(__pyx_t_304 < 0)) __pyx_t_64 = 3;
        } else if (unlikely(__pyx_t_304 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 800, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_301, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_302, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_303, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_304, __pyx_pybuffernd_F.diminfo[3].strides) = (__pyx_t_106 / ((__pyx_t_7openpiv_7process_DTYPEf_t)__pyx_v_dt));
      }
    }

    /* "openpiv/process.pyx":802
 *                 F[K,I,J,11]=-F[K,I,J,4] / dt #v=-dx/dt
 *         # pbar.finish()#close progress bar
 *         print("..[DONE]")             # <<<<<<<<<<<<<<
 *         if K==0:
 *             residual_0 = residual/np.float(Nrow[K]*Ncol[K])
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_DONE) < 0) __PYX_ERR(0, 802, __pyx_L1_error)

    /* "openpiv/process.pyx":803
 *         # pbar.finish()#close progress bar
 *         print("..[DONE]")
 *         if K==0:             # <<<<<<<<<<<<<<
 *             residual_0 = residual/np.float(Nrow[K]*Ncol[K])
 *         print(" --residual : ", (residual/np.float(Nrow[K]*Ncol[K]))/residual_0)
 */
    __pyx_t_1 = ((__pyx_v_K == 0) != 0);
    if (__pyx_t_1) {

      /* "openpiv/process.pyx":804
 *         print("..[DONE]")
 *         if K==0:
 *             residual_0 = residual/np.float(Nrow[K]*Ncol[K])             # <<<<<<<<<<<<<<
 *         print(" --residual : ", (residual/np.float(Nrow[K]*Ncol[K]))/residual_0)
 *         #####################################################
 */
      __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_residual); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_34);
      __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_float); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_36);
      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
      __pyx_t_305 = __pyx_v_K;
      __pyx_t_20 = -1;
      if (__pyx_t_305 < 0) {
        __pyx_t_305 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
        if (unlikely(__pyx_t_305 < 0)) __pyx_t_20 = 0;
      } else if (unlikely(__pyx_t_305 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
      if (unlikely(__pyx_t_20 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_20);
        __PYX_ERR(0, 804, __pyx_L1_error)
      }
      __pyx_t_306 = __pyx_v_K;
      __pyx_t_20 = -1;
      if (__pyx_t_306 < 0) {
        __pyx_t_306 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_306 < 0)) __pyx_t_20 = 0;
      } else if (unlikely(__pyx_t_306 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_20 = 0;
      if (unlikely(__pyx_t_20 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_20);
        __PYX_ERR(0, 804, __pyx_L1_error)
      }
      __pyx_t_34 = __Pyx_PyInt_From_npy_int32(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_305, __pyx_pybuffernd_Nrow.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_306, __pyx_pybuffernd_Ncol.diminfo[0].strides)))); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_34);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_36))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_36);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_36);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_36, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_36, __pyx_t_4, __pyx_t_34) : __Pyx_PyObject_CallOneArg(__pyx_t_36, __pyx_t_34);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
      __pyx_t_36 = __Pyx_PyNumber_Divide(__pyx_t_15, __pyx_t_5); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_36);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_36); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
      __pyx_v_residual_0 = __pyx_t_224;

      /* "openpiv/process.pyx":803
 *         # pbar.finish()#close progress bar
 *         print("..[DONE]")
 *         if K==0:             # <<<<<<<<<<<<<<
 *             residual_0 = residual/np.float(Nrow[K]*Ncol[K])
 *         print(" --residual : ", (residual/np.float(Nrow[K]*Ncol[K]))/residual_0)
 */
    }

    /* "openpiv/process.pyx":805
 *         if K==0:
 *             residual_0 = residual/np.float(Nrow[K]*Ncol[K])
 *         print(" --residual : ", (residual/np.float(Nrow[K]*Ncol[K]))/residual_0)             # <<<<<<<<<<<<<<
 *         #####################################################
 *         #validation of the velocity vectors with 3*3 filtering
 */
    __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_residual); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_36);
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_float); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_34);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_307 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_307 < 0) {
      __pyx_t_307 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
      if (unlikely(__pyx_t_307 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_307 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 805, __pyx_L1_error)
    }
    __pyx_t_308 = __pyx_v_K;
    __pyx_t_20 = -1;
    if (__pyx_t_308 < 0) {
      __pyx_t_308 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
      if (unlikely(__pyx_t_308 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_308 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 805, __pyx_L1_error)
    }
    __pyx_t_15 = __Pyx_PyInt_From_npy_int32(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_307, __pyx_pybuffernd_Nrow.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_308, __pyx_pybuffernd_Ncol.diminfo[0].strides)))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_34);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_34, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_4, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_34, __pyx_t_15);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
    __pyx_t_34 = __Pyx_PyNumber_Divide(__pyx_t_36, __pyx_t_5); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_34);
    __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_residual_0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_36 = __Pyx_PyNumber_Divide(__pyx_t_34, __pyx_t_5); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_36);
    __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_kp_s_residual);
    __Pyx_GIVEREF(__pyx_kp_s_residual);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_residual);
    __Pyx_GIVEREF(__pyx_t_36);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_36);
    __pyx_t_36 = 0;
    if (__Pyx_PrintOne(0, __pyx_t_5) < 0) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "openpiv/process.pyx":808
 *         #####################################################
 *         #validation of the velocity vectors with 3*3 filtering
 *         if K==0 and trust_1st_iter:#1st iteration can generally be trust if it follows the 1/4 rule             # <<<<<<<<<<<<<<
 *             print("no validation : trusting 1st iteration")
 *         else:
 */
    __pyx_t_128 = ((__pyx_v_K == 0) != 0);
    if (__pyx_t_128) {
    } else {
      __pyx_t_1 = __pyx_t_128;
      goto __pyx_L45_bool_binop_done;
    }
    __pyx_t_128 = (__pyx_v_trust_1st_iter != 0);
    __pyx_t_1 = __pyx_t_128;
    __pyx_L45_bool_binop_done:;
    if (__pyx_t_1) {

      /* "openpiv/process.pyx":809
 *         #validation of the velocity vectors with 3*3 filtering
 *         if K==0 and trust_1st_iter:#1st iteration can generally be trust if it follows the 1/4 rule
 *             print("no validation : trusting 1st iteration")             # <<<<<<<<<<<<<<
 *         else:
 *             print("Starting validation..")
 */
      if (__Pyx_PrintOne(0, __pyx_kp_s_no_validation_trusting_1st_itera) < 0) __PYX_ERR(0, 809, __pyx_L1_error)

      /* "openpiv/process.pyx":808
 *         #####################################################
 *         #validation of the velocity vectors with 3*3 filtering
 *         if K==0 and trust_1st_iter:#1st iteration can generally be trust if it follows the 1/4 rule             # <<<<<<<<<<<<<<
 *             print("no validation : trusting 1st iteration")
 *         else:
 */
      goto __pyx_L44;
    }

    /* "openpiv/process.pyx":811
 *             print("no validation : trusting 1st iteration")
 *         else:
 *             print("Starting validation..")             # <<<<<<<<<<<<<<
 *             for I in range(Nrow[nb_iter_max-1]):#init mask to False
 *                 for J in range(Ncol[nb_iter_max-1]):
 */
    /*else*/ {
      if (__Pyx_PrintOne(0, __pyx_kp_s_Starting_validation) < 0) __PYX_ERR(0, 811, __pyx_L1_error)

      /* "openpiv/process.pyx":812
 *         else:
 *             print("Starting validation..")
 *             for I in range(Nrow[nb_iter_max-1]):#init mask to False             # <<<<<<<<<<<<<<
 *                 for J in range(Ncol[nb_iter_max-1]):
 *                     (<object>mask)[I,J]=False
 */
      __pyx_t_309 = (__pyx_v_nb_iter_max - 1);
      __pyx_t_20 = -1;
      if (__pyx_t_309 < 0) {
        __pyx_t_309 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
        if (unlikely(__pyx_t_309 < 0)) __pyx_t_20 = 0;
      } else if (unlikely(__pyx_t_309 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
      if (unlikely(__pyx_t_20 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_20);
        __PYX_ERR(0, 812, __pyx_L1_error)
      }
      __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_309, __pyx_pybuffernd_Nrow.diminfo[0].strides));
      __pyx_t_27 = __pyx_t_16;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_27; __pyx_t_20+=1) {
        __pyx_v_I = __pyx_t_20;

        /* "openpiv/process.pyx":813
 *             print("Starting validation..")
 *             for I in range(Nrow[nb_iter_max-1]):#init mask to False
 *                 for J in range(Ncol[nb_iter_max-1]):             # <<<<<<<<<<<<<<
 *                     (<object>mask)[I,J]=False
 *             for i in range(validation_iter):#real validation starts
 */
        __pyx_t_310 = (__pyx_v_nb_iter_max - 1);
        __pyx_t_60 = -1;
        if (__pyx_t_310 < 0) {
          __pyx_t_310 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
          if (unlikely(__pyx_t_310 < 0)) __pyx_t_60 = 0;
        } else if (unlikely(__pyx_t_310 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_60 = 0;
        if (unlikely(__pyx_t_60 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_60);
          __PYX_ERR(0, 813, __pyx_L1_error)
        }
        __pyx_t_61 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_310, __pyx_pybuffernd_Ncol.diminfo[0].strides));
        __pyx_t_62 = __pyx_t_61;
        for (__pyx_t_60 = 0; __pyx_t_60 < __pyx_t_62; __pyx_t_60+=1) {
          __pyx_v_J = __pyx_t_60;

          /* "openpiv/process.pyx":814
 *             for I in range(Nrow[nb_iter_max-1]):#init mask to False
 *                 for J in range(Ncol[nb_iter_max-1]):
 *                     (<object>mask)[I,J]=False             # <<<<<<<<<<<<<<
 *             for i in range(validation_iter):#real validation starts
 *                 print("Validation, iteration number ",i)
 */
          __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 814, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 814, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 814, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_34);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_36);
          PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_t_36);
          __pyx_t_5 = 0;
          __pyx_t_36 = 0;
          if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_mask), __pyx_t_34, Py_False) < 0)) __PYX_ERR(0, 814, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        }
      }

      /* "openpiv/process.pyx":815
 *                 for J in range(Ncol[nb_iter_max-1]):
 *                     (<object>mask)[I,J]=False
 *             for i in range(validation_iter):#real validation starts             # <<<<<<<<<<<<<<
 *                 print("Validation, iteration number ",i)
 *                 print(" ")
 */
      __pyx_t_20 = __pyx_v_validation_iter;
      __pyx_t_60 = __pyx_t_20;
      for (__pyx_t_64 = 0; __pyx_t_64 < __pyx_t_60; __pyx_t_64+=1) {
        __pyx_v_i = __pyx_t_64;

        /* "openpiv/process.pyx":816
 *                     (<object>mask)[I,J]=False
 *             for i in range(validation_iter):#real validation starts
 *                 print("Validation, iteration number ",i)             # <<<<<<<<<<<<<<
 *                 print(" ")
 *                 # widgets = ['Validation : ', Percentage(), ' ', Bar(marker='-',left='[',right=']'),
 */
        __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_34);
        __pyx_t_36 = PyTuple_New(2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_36);
        __Pyx_INCREF(__pyx_kp_s_Validation_iteration_number);
        __Pyx_GIVEREF(__pyx_kp_s_Validation_iteration_number);
        PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_kp_s_Validation_iteration_number);
        __Pyx_GIVEREF(__pyx_t_34);
        PyTuple_SET_ITEM(__pyx_t_36, 1, __pyx_t_34);
        __pyx_t_34 = 0;
        if (__Pyx_PrintOne(0, __pyx_t_36) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;

        /* "openpiv/process.pyx":817
 *             for i in range(validation_iter):#real validation starts
 *                 print("Validation, iteration number ",i)
 *                 print(" ")             # <<<<<<<<<<<<<<
 *                 # widgets = ['Validation : ', Percentage(), ' ', Bar(marker='-',left='[',right=']'),
 *            # ' ', ETA(), ' ', FileTransferSpeed()]
 */
        if (__Pyx_PrintOne(0, __pyx_kp_s__11) < 0) __PYX_ERR(0, 817, __pyx_L1_error)

        /* "openpiv/process.pyx":822
 *                 # pbar = ProgressBar(widgets=widgets, maxval=100)
 *                 # pbar.start()
 *                 for I in range(Nrow[K]):#run through locations             # <<<<<<<<<<<<<<
 *                     # pbar.update(100*I/Nrow[K])
 *                     for J in range(Ncol[K]):
 */
        __pyx_t_311 = __pyx_v_K;
        __pyx_t_196 = -1;
        if (__pyx_t_311 < 0) {
          __pyx_t_311 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
          if (unlikely(__pyx_t_311 < 0)) __pyx_t_196 = 0;
        } else if (unlikely(__pyx_t_311 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_196 = 0;
        if (unlikely(__pyx_t_196 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_196);
          __PYX_ERR(0, 822, __pyx_L1_error)
        }
        __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_311, __pyx_pybuffernd_Nrow.diminfo[0].strides));
        __pyx_t_27 = __pyx_t_16;
        for (__pyx_t_196 = 0; __pyx_t_196 < __pyx_t_27; __pyx_t_196+=1) {
          __pyx_v_I = __pyx_t_196;

          /* "openpiv/process.pyx":824
 *                 for I in range(Nrow[K]):#run through locations
 *                     # pbar.update(100*I/Nrow[K])
 *                     for J in range(Ncol[K]):             # <<<<<<<<<<<<<<
 *                         neighbours_present = find_neighbours(I, J, Nrow[K]-1, Ncol[K]-1)#get a map of the neighbouring locations
 *                         for L in range(3):#get the velocity of the neighbours in a 2*3*3 array
 */
          __pyx_t_312 = __pyx_v_K;
          __pyx_t_203 = -1;
          if (__pyx_t_312 < 0) {
            __pyx_t_312 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
            if (unlikely(__pyx_t_312 < 0)) __pyx_t_203 = 0;
          } else if (unlikely(__pyx_t_312 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_203 = 0;
          if (unlikely(__pyx_t_203 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_203);
            __PYX_ERR(0, 824, __pyx_L1_error)
          }
          __pyx_t_61 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_312, __pyx_pybuffernd_Ncol.diminfo[0].strides));
          __pyx_t_62 = __pyx_t_61;
          for (__pyx_t_203 = 0; __pyx_t_203 < __pyx_t_62; __pyx_t_203+=1) {
            __pyx_v_J = __pyx_t_203;

            /* "openpiv/process.pyx":825
 *                     # pbar.update(100*I/Nrow[K])
 *                     for J in range(Ncol[K]):
 *                         neighbours_present = find_neighbours(I, J, Nrow[K]-1, Ncol[K]-1)#get a map of the neighbouring locations             # <<<<<<<<<<<<<<
 *                         for L in range(3):#get the velocity of the neighbours in a 2*3*3 array
 *                             for M in range(3):
 */
            __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_find_neighbours); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_34);
            __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_313 = __pyx_v_K;
            __pyx_t_314 = -1;
            if (__pyx_t_313 < 0) {
              __pyx_t_313 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
              if (unlikely(__pyx_t_313 < 0)) __pyx_t_314 = 0;
            } else if (unlikely(__pyx_t_313 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_314 = 0;
            if (unlikely(__pyx_t_314 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_314);
              __PYX_ERR(0, 825, __pyx_L1_error)
            }
            __pyx_t_4 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_313, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_315 = __pyx_v_K;
            __pyx_t_314 = -1;
            if (__pyx_t_315 < 0) {
              __pyx_t_315 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
              if (unlikely(__pyx_t_315 < 0)) __pyx_t_314 = 0;
            } else if (unlikely(__pyx_t_315 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_314 = 0;
            if (unlikely(__pyx_t_314 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_314);
              __PYX_ERR(0, 825, __pyx_L1_error)
            }
            __pyx_t_33 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_315, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_33);
            __pyx_t_35 = NULL;
            __pyx_t_314 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
              __pyx_t_35 = PyMethod_GET_SELF(__pyx_t_34);
              if (likely(__pyx_t_35)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
                __Pyx_INCREF(__pyx_t_35);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_34, function);
                __pyx_t_314 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_34)) {
              PyObject *__pyx_temp[5] = {__pyx_t_35, __pyx_t_5, __pyx_t_15, __pyx_t_4, __pyx_t_33};
              __pyx_t_36 = __Pyx_PyFunction_FastCall(__pyx_t_34, __pyx_temp+1-__pyx_t_314, 4+__pyx_t_314); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 825, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0;
              __Pyx_GOTREF(__pyx_t_36);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_34)) {
              PyObject *__pyx_temp[5] = {__pyx_t_35, __pyx_t_5, __pyx_t_15, __pyx_t_4, __pyx_t_33};
              __pyx_t_36 = __Pyx_PyCFunction_FastCall(__pyx_t_34, __pyx_temp+1-__pyx_t_314, 4+__pyx_t_314); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 825, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0;
              __Pyx_GOTREF(__pyx_t_36);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
            } else
            #endif
            {
              __pyx_t_2 = PyTuple_New(4+__pyx_t_314); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_35) {
                __Pyx_GIVEREF(__pyx_t_35); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_35); __pyx_t_35 = NULL;
              }
              __Pyx_GIVEREF(__pyx_t_5);
              PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_314, __pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_15);
              PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_314, __pyx_t_15);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_314, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_33);
              PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_314, __pyx_t_33);
              __pyx_t_5 = 0;
              __pyx_t_15 = 0;
              __pyx_t_4 = 0;
              __pyx_t_33 = 0;
              __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_t_2, NULL); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 825, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_36);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
            if (!(likely(((__pyx_t_36) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_36, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 825, __pyx_L1_error)
            __pyx_t_57 = ((PyArrayObject *)__pyx_t_36);
            {
              __Pyx_BufFmt_StackElem __pyx_stack[1];
              __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer);
              __pyx_t_314 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer, (PyObject*)__pyx_t_57, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
              if (unlikely(__pyx_t_314 < 0)) {
                PyErr_Fetch(&__pyx_t_316, &__pyx_t_317, &__pyx_t_318);
                if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer, (PyObject*)__pyx_v_neighbours_present, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
                  Py_XDECREF(__pyx_t_316); Py_XDECREF(__pyx_t_317); Py_XDECREF(__pyx_t_318);
                  __Pyx_RaiseBufferFallbackError();
                } else {
                  PyErr_Restore(__pyx_t_316, __pyx_t_317, __pyx_t_318);
                }
                __pyx_t_316 = __pyx_t_317 = __pyx_t_318 = 0;
              }
              __pyx_pybuffernd_neighbours_present.diminfo[0].strides = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_neighbours_present.diminfo[0].shape = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_neighbours_present.diminfo[1].strides = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_neighbours_present.diminfo[1].shape = __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.shape[1];
              if (unlikely(__pyx_t_314 < 0)) __PYX_ERR(0, 825, __pyx_L1_error)
            }
            __pyx_t_57 = 0;
            __Pyx_DECREF_SET(__pyx_v_neighbours_present, ((PyArrayObject *)__pyx_t_36));
            __pyx_t_36 = 0;

            /* "openpiv/process.pyx":826
 *                     for J in range(Ncol[K]):
 *                         neighbours_present = find_neighbours(I, J, Nrow[K]-1, Ncol[K]-1)#get a map of the neighbouring locations
 *                         for L in range(3):#get the velocity of the neighbours in a 2*3*3 array             # <<<<<<<<<<<<<<
 *                             for M in range(3):
 *                                 if neighbours_present[L,M]:
 */
            for (__pyx_t_314 = 0; __pyx_t_314 < 3; __pyx_t_314+=1) {
              __pyx_v_L = __pyx_t_314;

              /* "openpiv/process.pyx":827
 *                         neighbours_present = find_neighbours(I, J, Nrow[K]-1, Ncol[K]-1)#get a map of the neighbouring locations
 *                         for L in range(3):#get the velocity of the neighbours in a 2*3*3 array
 *                             for M in range(3):             # <<<<<<<<<<<<<<
 *                                 if neighbours_present[L,M]:
 *                                     neighbours[0,L,M]=F[K,I+L-1,J+M-1,10]#u
 */
              for (__pyx_t_319 = 0; __pyx_t_319 < 3; __pyx_t_319+=1) {
                __pyx_v_M = __pyx_t_319;

                /* "openpiv/process.pyx":828
 *                         for L in range(3):#get the velocity of the neighbours in a 2*3*3 array
 *                             for M in range(3):
 *                                 if neighbours_present[L,M]:             # <<<<<<<<<<<<<<
 *                                     neighbours[0,L,M]=F[K,I+L-1,J+M-1,10]#u
 *                                     neighbours[1,L,M]=F[K,I+L-1,J+M-1,11]#v
 */
                __pyx_t_320 = __pyx_v_L;
                __pyx_t_321 = __pyx_v_M;
                __pyx_t_322 = -1;
                if (__pyx_t_320 < 0) {
                  __pyx_t_320 += __pyx_pybuffernd_neighbours_present.diminfo[0].shape;
                  if (unlikely(__pyx_t_320 < 0)) __pyx_t_322 = 0;
                } else if (unlikely(__pyx_t_320 >= __pyx_pybuffernd_neighbours_present.diminfo[0].shape)) __pyx_t_322 = 0;
                if (__pyx_t_321 < 0) {
                  __pyx_t_321 += __pyx_pybuffernd_neighbours_present.diminfo[1].shape;
                  if (unlikely(__pyx_t_321 < 0)) __pyx_t_322 = 1;
                } else if (unlikely(__pyx_t_321 >= __pyx_pybuffernd_neighbours_present.diminfo[1].shape)) __pyx_t_322 = 1;
                if (unlikely(__pyx_t_322 != -1)) {
                  __Pyx_RaiseBufferIndexError(__pyx_t_322);
                  __PYX_ERR(0, 828, __pyx_L1_error)
                }
                __pyx_t_1 = ((*__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.buf, __pyx_t_320, __pyx_pybuffernd_neighbours_present.diminfo[0].strides, __pyx_t_321, __pyx_pybuffernd_neighbours_present.diminfo[1].strides)) != 0);
                if (__pyx_t_1) {

                  /* "openpiv/process.pyx":829
 *                             for M in range(3):
 *                                 if neighbours_present[L,M]:
 *                                     neighbours[0,L,M]=F[K,I+L-1,J+M-1,10]#u             # <<<<<<<<<<<<<<
 *                                     neighbours[1,L,M]=F[K,I+L-1,J+M-1,11]#v
 *                                 else:
 */
                  __pyx_t_323 = __pyx_v_K;
                  __pyx_t_324 = ((__pyx_v_I + __pyx_v_L) - 1);
                  __pyx_t_325 = ((__pyx_v_J + __pyx_v_M) - 1);
                  __pyx_t_326 = 10;
                  __pyx_t_322 = -1;
                  if (__pyx_t_323 < 0) {
                    __pyx_t_323 += __pyx_pybuffernd_F.diminfo[0].shape;
                    if (unlikely(__pyx_t_323 < 0)) __pyx_t_322 = 0;
                  } else if (unlikely(__pyx_t_323 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_322 = 0;
                  if (__pyx_t_324 < 0) {
                    __pyx_t_324 += __pyx_pybuffernd_F.diminfo[1].shape;
                    if (unlikely(__pyx_t_324 < 0)) __pyx_t_322 = 1;
                  } else if (unlikely(__pyx_t_324 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_322 = 1;
                  if (__pyx_t_325 < 0) {
                    __pyx_t_325 += __pyx_pybuffernd_F.diminfo[2].shape;
                    if (unlikely(__pyx_t_325 < 0)) __pyx_t_322 = 2;
                  } else if (unlikely(__pyx_t_325 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_322 = 2;
                  if (__pyx_t_326 < 0) {
                    __pyx_t_326 += __pyx_pybuffernd_F.diminfo[3].shape;
                    if (unlikely(__pyx_t_326 < 0)) __pyx_t_322 = 3;
                  } else if (unlikely(__pyx_t_326 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_322 = 3;
                  if (unlikely(__pyx_t_322 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_322);
                    __PYX_ERR(0, 829, __pyx_L1_error)
                  }
                  __pyx_t_327 = 0;
                  __pyx_t_328 = __pyx_v_L;
                  __pyx_t_329 = __pyx_v_M;
                  __pyx_t_322 = -1;
                  if (__pyx_t_327 < 0) {
                    __pyx_t_327 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                    if (unlikely(__pyx_t_327 < 0)) __pyx_t_322 = 0;
                  } else if (unlikely(__pyx_t_327 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_322 = 0;
                  if (__pyx_t_328 < 0) {
                    __pyx_t_328 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                    if (unlikely(__pyx_t_328 < 0)) __pyx_t_322 = 1;
                  } else if (unlikely(__pyx_t_328 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_322 = 1;
                  if (__pyx_t_329 < 0) {
                    __pyx_t_329 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                    if (unlikely(__pyx_t_329 < 0)) __pyx_t_322 = 2;
                  } else if (unlikely(__pyx_t_329 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_322 = 2;
                  if (unlikely(__pyx_t_322 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_322);
                    __PYX_ERR(0, 829, __pyx_L1_error)
                  }
                  *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_327, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_328, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_329, __pyx_pybuffernd_neighbours.diminfo[2].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_323, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_324, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_325, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_326, __pyx_pybuffernd_F.diminfo[3].strides));

                  /* "openpiv/process.pyx":830
 *                                 if neighbours_present[L,M]:
 *                                     neighbours[0,L,M]=F[K,I+L-1,J+M-1,10]#u
 *                                     neighbours[1,L,M]=F[K,I+L-1,J+M-1,11]#v             # <<<<<<<<<<<<<<
 *                                 else:
 *                                     neighbours[0,L,M]=0
 */
                  __pyx_t_330 = __pyx_v_K;
                  __pyx_t_331 = ((__pyx_v_I + __pyx_v_L) - 1);
                  __pyx_t_332 = ((__pyx_v_J + __pyx_v_M) - 1);
                  __pyx_t_333 = 11;
                  __pyx_t_322 = -1;
                  if (__pyx_t_330 < 0) {
                    __pyx_t_330 += __pyx_pybuffernd_F.diminfo[0].shape;
                    if (unlikely(__pyx_t_330 < 0)) __pyx_t_322 = 0;
                  } else if (unlikely(__pyx_t_330 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_322 = 0;
                  if (__pyx_t_331 < 0) {
                    __pyx_t_331 += __pyx_pybuffernd_F.diminfo[1].shape;
                    if (unlikely(__pyx_t_331 < 0)) __pyx_t_322 = 1;
                  } else if (unlikely(__pyx_t_331 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_322 = 1;
                  if (__pyx_t_332 < 0) {
                    __pyx_t_332 += __pyx_pybuffernd_F.diminfo[2].shape;
                    if (unlikely(__pyx_t_332 < 0)) __pyx_t_322 = 2;
                  } else if (unlikely(__pyx_t_332 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_322 = 2;
                  if (__pyx_t_333 < 0) {
                    __pyx_t_333 += __pyx_pybuffernd_F.diminfo[3].shape;
                    if (unlikely(__pyx_t_333 < 0)) __pyx_t_322 = 3;
                  } else if (unlikely(__pyx_t_333 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_322 = 3;
                  if (unlikely(__pyx_t_322 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_322);
                    __PYX_ERR(0, 830, __pyx_L1_error)
                  }
                  __pyx_t_334 = 1;
                  __pyx_t_335 = __pyx_v_L;
                  __pyx_t_336 = __pyx_v_M;
                  __pyx_t_322 = -1;
                  if (__pyx_t_334 < 0) {
                    __pyx_t_334 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                    if (unlikely(__pyx_t_334 < 0)) __pyx_t_322 = 0;
                  } else if (unlikely(__pyx_t_334 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_322 = 0;
                  if (__pyx_t_335 < 0) {
                    __pyx_t_335 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                    if (unlikely(__pyx_t_335 < 0)) __pyx_t_322 = 1;
                  } else if (unlikely(__pyx_t_335 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_322 = 1;
                  if (__pyx_t_336 < 0) {
                    __pyx_t_336 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                    if (unlikely(__pyx_t_336 < 0)) __pyx_t_322 = 2;
                  } else if (unlikely(__pyx_t_336 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_322 = 2;
                  if (unlikely(__pyx_t_322 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_322);
                    __PYX_ERR(0, 830, __pyx_L1_error)
                  }
                  *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_334, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_335, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_336, __pyx_pybuffernd_neighbours.diminfo[2].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_330, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_331, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_332, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_333, __pyx_pybuffernd_F.diminfo[3].strides));

                  /* "openpiv/process.pyx":828
 *                         for L in range(3):#get the velocity of the neighbours in a 2*3*3 array
 *                             for M in range(3):
 *                                 if neighbours_present[L,M]:             # <<<<<<<<<<<<<<
 *                                     neighbours[0,L,M]=F[K,I+L-1,J+M-1,10]#u
 *                                     neighbours[1,L,M]=F[K,I+L-1,J+M-1,11]#v
 */
                  goto __pyx_L61;
                }

                /* "openpiv/process.pyx":832
 *                                     neighbours[1,L,M]=F[K,I+L-1,J+M-1,11]#v
 *                                 else:
 *                                     neighbours[0,L,M]=0             # <<<<<<<<<<<<<<
 *                                     neighbours[1,L,M]=0
 * 
 */
                /*else*/ {
                  __pyx_t_337 = 0;
                  __pyx_t_338 = __pyx_v_L;
                  __pyx_t_339 = __pyx_v_M;
                  __pyx_t_322 = -1;
                  if (__pyx_t_337 < 0) {
                    __pyx_t_337 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                    if (unlikely(__pyx_t_337 < 0)) __pyx_t_322 = 0;
                  } else if (unlikely(__pyx_t_337 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_322 = 0;
                  if (__pyx_t_338 < 0) {
                    __pyx_t_338 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                    if (unlikely(__pyx_t_338 < 0)) __pyx_t_322 = 1;
                  } else if (unlikely(__pyx_t_338 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_322 = 1;
                  if (__pyx_t_339 < 0) {
                    __pyx_t_339 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                    if (unlikely(__pyx_t_339 < 0)) __pyx_t_322 = 2;
                  } else if (unlikely(__pyx_t_339 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_322 = 2;
                  if (unlikely(__pyx_t_322 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_322);
                    __PYX_ERR(0, 832, __pyx_L1_error)
                  }
                  *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_337, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_338, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_339, __pyx_pybuffernd_neighbours.diminfo[2].strides) = 0.0;

                  /* "openpiv/process.pyx":833
 *                                 else:
 *                                     neighbours[0,L,M]=0
 *                                     neighbours[1,L,M]=0             # <<<<<<<<<<<<<<
 * 
 *                             if np.sum(neighbours_present) !=0 and mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 1:
 */
                  __pyx_t_340 = 1;
                  __pyx_t_341 = __pyx_v_L;
                  __pyx_t_342 = __pyx_v_M;
                  __pyx_t_322 = -1;
                  if (__pyx_t_340 < 0) {
                    __pyx_t_340 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                    if (unlikely(__pyx_t_340 < 0)) __pyx_t_322 = 0;
                  } else if (unlikely(__pyx_t_340 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_322 = 0;
                  if (__pyx_t_341 < 0) {
                    __pyx_t_341 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                    if (unlikely(__pyx_t_341 < 0)) __pyx_t_322 = 1;
                  } else if (unlikely(__pyx_t_341 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_322 = 1;
                  if (__pyx_t_342 < 0) {
                    __pyx_t_342 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                    if (unlikely(__pyx_t_342 < 0)) __pyx_t_322 = 2;
                  } else if (unlikely(__pyx_t_342 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_322 = 2;
                  if (unlikely(__pyx_t_322 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_322);
                    __PYX_ERR(0, 833, __pyx_L1_error)
                  }
                  *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_340, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_341, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_342, __pyx_pybuffernd_neighbours.diminfo[2].strides) = 0.0;
                }
                __pyx_L61:;
              }

              /* "openpiv/process.pyx":835
 *                                     neighbours[1,L,M]=0
 * 
 *                             if np.sum(neighbours_present) !=0 and mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 1:             # <<<<<<<<<<<<<<
 *                             #if np.sum(neighbours_present):
 *                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))#computing the mean velocity
 */
              __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_34);
              __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
              __pyx_t_34 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_2);
                if (likely(__pyx_t_34)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_34);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_2, function);
                }
              }
              __pyx_t_36 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_34, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_neighbours_present));
              __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
              if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_36);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_36, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
              __pyx_t_128 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_128 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_t_128) {
              } else {
                __pyx_t_1 = __pyx_t_128;
                goto __pyx_L63_bool_binop_done;
              }
              __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_36);
              __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_int); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_34);
              __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
              __pyx_t_343 = __pyx_v_K;
              __pyx_t_344 = __pyx_v_I;
              __pyx_t_345 = __pyx_v_J;
              __pyx_t_346 = 0;
              __pyx_t_319 = -1;
              if (__pyx_t_343 < 0) {
                __pyx_t_343 += __pyx_pybuffernd_F.diminfo[0].shape;
                if (unlikely(__pyx_t_343 < 0)) __pyx_t_319 = 0;
              } else if (unlikely(__pyx_t_343 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
              if (__pyx_t_344 < 0) {
                __pyx_t_344 += __pyx_pybuffernd_F.diminfo[1].shape;
                if (unlikely(__pyx_t_344 < 0)) __pyx_t_319 = 1;
              } else if (unlikely(__pyx_t_344 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
              if (__pyx_t_345 < 0) {
                __pyx_t_345 += __pyx_pybuffernd_F.diminfo[2].shape;
                if (unlikely(__pyx_t_345 < 0)) __pyx_t_319 = 2;
              } else if (unlikely(__pyx_t_345 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
              if (__pyx_t_346 < 0) {
                __pyx_t_346 += __pyx_pybuffernd_F.diminfo[3].shape;
                if (unlikely(__pyx_t_346 < 0)) __pyx_t_319 = 3;
              } else if (unlikely(__pyx_t_346 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
              if (unlikely(__pyx_t_319 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_319);
                __PYX_ERR(0, 835, __pyx_L1_error)
              }
              __pyx_t_36 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_343, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_344, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_345, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_346, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_36);
              __pyx_t_33 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
                __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_34);
                if (likely(__pyx_t_33)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
                  __Pyx_INCREF(__pyx_t_33);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_34, function);
                }
              }
              __pyx_t_2 = (__pyx_t_33) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_33, __pyx_t_36) : __Pyx_PyObject_CallOneArg(__pyx_t_34, __pyx_t_36);
              __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
              __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
              __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_36);
              __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_int); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_33);
              __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
              __pyx_t_347 = __pyx_v_K;
              __pyx_t_348 = __pyx_v_I;
              __pyx_t_349 = __pyx_v_J;
              __pyx_t_350 = 1;
              __pyx_t_319 = -1;
              if (__pyx_t_347 < 0) {
                __pyx_t_347 += __pyx_pybuffernd_F.diminfo[0].shape;
                if (unlikely(__pyx_t_347 < 0)) __pyx_t_319 = 0;
              } else if (unlikely(__pyx_t_347 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
              if (__pyx_t_348 < 0) {
                __pyx_t_348 += __pyx_pybuffernd_F.diminfo[1].shape;
                if (unlikely(__pyx_t_348 < 0)) __pyx_t_319 = 1;
              } else if (unlikely(__pyx_t_348 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
              if (__pyx_t_349 < 0) {
                __pyx_t_349 += __pyx_pybuffernd_F.diminfo[2].shape;
                if (unlikely(__pyx_t_349 < 0)) __pyx_t_319 = 2;
              } else if (unlikely(__pyx_t_349 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
              if (__pyx_t_350 < 0) {
                __pyx_t_350 += __pyx_pybuffernd_F.diminfo[3].shape;
                if (unlikely(__pyx_t_350 < 0)) __pyx_t_319 = 3;
              } else if (unlikely(__pyx_t_350 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
              if (unlikely(__pyx_t_319 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_319);
                __PYX_ERR(0, 835, __pyx_L1_error)
              }
              __pyx_t_36 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_347, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_348, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_349, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_350, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_36);
              __pyx_t_4 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_33);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_33, function);
                }
              }
              __pyx_t_34 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_33, __pyx_t_4, __pyx_t_36) : __Pyx_PyObject_CallOneArg(__pyx_t_33, __pyx_t_36);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
              if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_34);
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
              __pyx_t_33 = PyTuple_New(2); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_33);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_34);
              PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_t_34);
              __pyx_t_2 = 0;
              __pyx_t_34 = 0;
              __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_mark), __pyx_t_33); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_34);
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
              __pyx_t_33 = __Pyx_PyInt_EqObjC(__pyx_t_34, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_33);
              __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
              __pyx_t_128 = __Pyx_PyObject_IsTrue(__pyx_t_33); if (unlikely(__pyx_t_128 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
              __pyx_t_1 = __pyx_t_128;
              __pyx_L63_bool_binop_done:;
              if (__pyx_t_1) {

                /* "openpiv/process.pyx":837
 *                             if np.sum(neighbours_present) !=0 and mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 1:
 *                             #if np.sum(neighbours_present):
 *                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))#computing the mean velocity             # <<<<<<<<<<<<<<
 *                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                 if F[K,I,J,12] < 1.5:#validation with the sig2noise ratio, 1.5 is a recommended minimum value
 */
                __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_34);
                __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                __pyx_t_34 = __Pyx_GetItemInt(((PyObject *)__pyx_v_neighbours), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_34);
                __pyx_t_36 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                  __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_2);
                  if (likely(__pyx_t_36)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                    __Pyx_INCREF(__pyx_t_36);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_2, function);
                  }
                }
                __pyx_t_33 = (__pyx_t_36) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_36, __pyx_t_34) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_34);
                __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
                __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_33);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_34);
                __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_float); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_36);
                __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_15);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_4 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
                  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
                  if (likely(__pyx_t_4)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                    __Pyx_INCREF(__pyx_t_4);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_15, function);
                  }
                }
                __pyx_t_34 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_4, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_15, ((PyObject *)__pyx_v_neighbours_present));
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_34);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __pyx_t_15 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_36))) {
                  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_36);
                  if (likely(__pyx_t_15)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_36);
                    __Pyx_INCREF(__pyx_t_15);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_36, function);
                  }
                }
                __pyx_t_2 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_36, __pyx_t_15, __pyx_t_34) : __Pyx_PyObject_CallOneArg(__pyx_t_36, __pyx_t_34);
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                __pyx_t_36 = __Pyx_PyNumber_Divide(__pyx_t_33, __pyx_t_2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_36);
                __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_36); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                __pyx_v_mean_u = __pyx_t_224;

                /* "openpiv/process.pyx":838
 *                             #if np.sum(neighbours_present):
 *                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))#computing the mean velocity
 *                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))             # <<<<<<<<<<<<<<
 *                                 if F[K,I,J,12] < 1.5:#validation with the sig2noise ratio, 1.5 is a recommended minimum value
 *                                     if K==0:#if in 1st iteration, no interpolation is needed so just replace by the mean
 */
                __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_33);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_neighbours), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_34 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) {
                  __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33);
                  if (likely(__pyx_t_34)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33);
                    __Pyx_INCREF(__pyx_t_34);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_33, function);
                  }
                }
                __pyx_t_36 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_33, __pyx_t_34, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_33, __pyx_t_2);
                __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_36);
                __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_34);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_15);
                __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __pyx_t_15 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
                  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4);
                  if (likely(__pyx_t_15)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                    __Pyx_INCREF(__pyx_t_15);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_4, function);
                  }
                }
                __pyx_t_2 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_15, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_neighbours_present));
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_4 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
                  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_34);
                  if (likely(__pyx_t_4)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
                    __Pyx_INCREF(__pyx_t_4);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_34, function);
                  }
                }
                __pyx_t_33 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_34, __pyx_t_2);
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_33);
                __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                __pyx_t_34 = __Pyx_PyNumber_Divide(__pyx_t_36, __pyx_t_33); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_34);
                __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_34); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                __pyx_v_mean_v = __pyx_t_224;

                /* "openpiv/process.pyx":839
 *                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))#computing the mean velocity
 *                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                 if F[K,I,J,12] < 1.5:#validation with the sig2noise ratio, 1.5 is a recommended minimum value             # <<<<<<<<<<<<<<
 *                                     if K==0:#if in 1st iteration, no interpolation is needed so just replace by the mean
 *                                         F[K,I,J,10] = mean_u
 */
                __pyx_t_351 = __pyx_v_K;
                __pyx_t_352 = __pyx_v_I;
                __pyx_t_353 = __pyx_v_J;
                __pyx_t_354 = 12;
                __pyx_t_319 = -1;
                if (__pyx_t_351 < 0) {
                  __pyx_t_351 += __pyx_pybuffernd_F.diminfo[0].shape;
                  if (unlikely(__pyx_t_351 < 0)) __pyx_t_319 = 0;
                } else if (unlikely(__pyx_t_351 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                if (__pyx_t_352 < 0) {
                  __pyx_t_352 += __pyx_pybuffernd_F.diminfo[1].shape;
                  if (unlikely(__pyx_t_352 < 0)) __pyx_t_319 = 1;
                } else if (unlikely(__pyx_t_352 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                if (__pyx_t_353 < 0) {
                  __pyx_t_353 += __pyx_pybuffernd_F.diminfo[2].shape;
                  if (unlikely(__pyx_t_353 < 0)) __pyx_t_319 = 2;
                } else if (unlikely(__pyx_t_353 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                if (__pyx_t_354 < 0) {
                  __pyx_t_354 += __pyx_pybuffernd_F.diminfo[3].shape;
                  if (unlikely(__pyx_t_354 < 0)) __pyx_t_319 = 3;
                } else if (unlikely(__pyx_t_354 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                if (unlikely(__pyx_t_319 != -1)) {
                  __Pyx_RaiseBufferIndexError(__pyx_t_319);
                  __PYX_ERR(0, 839, __pyx_L1_error)
                }
                __pyx_t_1 = (((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_351, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_352, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_353, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_354, __pyx_pybuffernd_F.diminfo[3].strides)) < 1.5) != 0);
                if (__pyx_t_1) {

                  /* "openpiv/process.pyx":840
 *                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                 if F[K,I,J,12] < 1.5:#validation with the sig2noise ratio, 1.5 is a recommended minimum value
 *                                     if K==0:#if in 1st iteration, no interpolation is needed so just replace by the mean             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,10] = mean_u
 *                                         F[K,I,J,11] = mean_v
 */
                  __pyx_t_1 = ((__pyx_v_K == 0) != 0);
                  if (__pyx_t_1) {

                    /* "openpiv/process.pyx":841
 *                                 if F[K,I,J,12] < 1.5:#validation with the sig2noise ratio, 1.5 is a recommended minimum value
 *                                     if K==0:#if in 1st iteration, no interpolation is needed so just replace by the mean
 *                                         F[K,I,J,10] = mean_u             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,11] = mean_v
 *                                         (<object>mask)[I,J]=True
 */
                    __pyx_t_355 = __pyx_v_K;
                    __pyx_t_356 = __pyx_v_I;
                    __pyx_t_357 = __pyx_v_J;
                    __pyx_t_358 = 10;
                    __pyx_t_319 = -1;
                    if (__pyx_t_355 < 0) {
                      __pyx_t_355 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_355 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_355 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_356 < 0) {
                      __pyx_t_356 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_356 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_356 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_357 < 0) {
                      __pyx_t_357 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_357 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_357 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_358 < 0) {
                      __pyx_t_358 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_358 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_358 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 841, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_355, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_356, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_357, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_358, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_u;

                    /* "openpiv/process.pyx":842
 *                                     if K==0:#if in 1st iteration, no interpolation is needed so just replace by the mean
 *                                         F[K,I,J,10] = mean_u
 *                                         F[K,I,J,11] = mean_v             # <<<<<<<<<<<<<<
 *                                         (<object>mask)[I,J]=True
 *                                         F[K,I,J,4] = -F[K,I,J,11]*dt#recompute displacement from velocity
 */
                    __pyx_t_359 = __pyx_v_K;
                    __pyx_t_360 = __pyx_v_I;
                    __pyx_t_361 = __pyx_v_J;
                    __pyx_t_362 = 11;
                    __pyx_t_319 = -1;
                    if (__pyx_t_359 < 0) {
                      __pyx_t_359 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_359 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_359 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_360 < 0) {
                      __pyx_t_360 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_360 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_360 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_361 < 0) {
                      __pyx_t_361 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_361 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_361 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_362 < 0) {
                      __pyx_t_362 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_362 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_362 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 842, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_359, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_360, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_361, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_362, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_v;

                    /* "openpiv/process.pyx":843
 *                                         F[K,I,J,10] = mean_u
 *                                         F[K,I,J,11] = mean_v
 *                                         (<object>mask)[I,J]=True             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,4] = -F[K,I,J,11]*dt#recompute displacement from velocity
 *                                         F[K,I,J,5] = F[K,I,J,10]*dt
 */
                    __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 843, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_34);
                    __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 843, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_33);
                    __pyx_t_36 = PyTuple_New(2); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 843, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_36);
                    __Pyx_GIVEREF(__pyx_t_34);
                    PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_34);
                    __Pyx_GIVEREF(__pyx_t_33);
                    PyTuple_SET_ITEM(__pyx_t_36, 1, __pyx_t_33);
                    __pyx_t_34 = 0;
                    __pyx_t_33 = 0;
                    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_mask), __pyx_t_36, Py_True) < 0)) __PYX_ERR(0, 843, __pyx_L1_error)
                    __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;

                    /* "openpiv/process.pyx":844
 *                                         F[K,I,J,11] = mean_v
 *                                         (<object>mask)[I,J]=True
 *                                         F[K,I,J,4] = -F[K,I,J,11]*dt#recompute displacement from velocity             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,5] = F[K,I,J,10]*dt
 *                                     elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#perform interpolation using previous iteration (which is supposed to be already validated -> this prevents error propagation)
 */
                    __pyx_t_363 = __pyx_v_K;
                    __pyx_t_364 = __pyx_v_I;
                    __pyx_t_365 = __pyx_v_J;
                    __pyx_t_366 = 11;
                    __pyx_t_319 = -1;
                    if (__pyx_t_363 < 0) {
                      __pyx_t_363 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_363 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_363 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_364 < 0) {
                      __pyx_t_364 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_364 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_364 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_365 < 0) {
                      __pyx_t_365 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_365 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_365 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_366 < 0) {
                      __pyx_t_366 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_366 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_366 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 844, __pyx_L1_error)
                    }
                    __pyx_t_367 = __pyx_v_K;
                    __pyx_t_368 = __pyx_v_I;
                    __pyx_t_369 = __pyx_v_J;
                    __pyx_t_370 = 4;
                    __pyx_t_319 = -1;
                    if (__pyx_t_367 < 0) {
                      __pyx_t_367 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_367 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_367 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_368 < 0) {
                      __pyx_t_368 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_368 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_368 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_369 < 0) {
                      __pyx_t_369 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_369 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_369 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_370 < 0) {
                      __pyx_t_370 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_370 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_370 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 844, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_367, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_368, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_369, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_370, __pyx_pybuffernd_F.diminfo[3].strides) = ((-(*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_363, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_364, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_365, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_366, __pyx_pybuffernd_F.diminfo[3].strides))) * __pyx_v_dt);

                    /* "openpiv/process.pyx":845
 *                                         (<object>mask)[I,J]=True
 *                                         F[K,I,J,4] = -F[K,I,J,11]*dt#recompute displacement from velocity
 *                                         F[K,I,J,5] = F[K,I,J,10]*dt             # <<<<<<<<<<<<<<
 *                                     elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#perform interpolation using previous iteration (which is supposed to be already validated -> this prevents error propagation)
 *                                         F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 */
                    __pyx_t_371 = __pyx_v_K;
                    __pyx_t_372 = __pyx_v_I;
                    __pyx_t_373 = __pyx_v_J;
                    __pyx_t_374 = 10;
                    __pyx_t_319 = -1;
                    if (__pyx_t_371 < 0) {
                      __pyx_t_371 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_371 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_371 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_372 < 0) {
                      __pyx_t_372 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_372 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_372 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_373 < 0) {
                      __pyx_t_373 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_373 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_373 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_374 < 0) {
                      __pyx_t_374 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_374 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_374 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 845, __pyx_L1_error)
                    }
                    __pyx_t_375 = __pyx_v_K;
                    __pyx_t_376 = __pyx_v_I;
                    __pyx_t_377 = __pyx_v_J;
                    __pyx_t_378 = 5;
                    __pyx_t_319 = -1;
                    if (__pyx_t_375 < 0) {
                      __pyx_t_375 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_375 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_375 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_376 < 0) {
                      __pyx_t_376 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_376 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_376 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_377 < 0) {
                      __pyx_t_377 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_377 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_377 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_378 < 0) {
                      __pyx_t_378 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_378 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_378 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 845, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_375, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_376, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_377, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_378, __pyx_pybuffernd_F.diminfo[3].strides) = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_371, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_372, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_373, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_374, __pyx_pybuffernd_F.diminfo[3].strides)) * __pyx_v_dt);

                    /* "openpiv/process.pyx":840
 *                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                 if F[K,I,J,12] < 1.5:#validation with the sig2noise ratio, 1.5 is a recommended minimum value
 *                                     if K==0:#if in 1st iteration, no interpolation is needed so just replace by the mean             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,10] = mean_u
 *                                         F[K,I,J,11] = mean_v
 */
                    goto __pyx_L66;
                  }

                  /* "openpiv/process.pyx":846
 *                                         F[K,I,J,4] = -F[K,I,J,11]*dt#recompute displacement from velocity
 *                                         F[K,I,J,5] = F[K,I,J,10]*dt
 *                                     elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#perform interpolation using previous iteration (which is supposed to be already validated -> this prevents error propagation)             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                         F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 */
                  __pyx_t_128 = ((__pyx_v_K > 0) != 0);
                  if (__pyx_t_128) {
                  } else {
                    __pyx_t_1 = __pyx_t_128;
                    goto __pyx_L67_bool_binop_done;
                  }
                  __pyx_t_379 = __pyx_v_K;
                  __pyx_t_319 = -1;
                  if (__pyx_t_379 < 0) {
                    __pyx_t_379 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
                    if (unlikely(__pyx_t_379 < 0)) __pyx_t_319 = 0;
                  } else if (unlikely(__pyx_t_379 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_319 = 0;
                  if (unlikely(__pyx_t_319 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_319);
                    __PYX_ERR(0, 846, __pyx_L1_error)
                  }
                  __pyx_t_380 = (__pyx_v_K - 1);
                  __pyx_t_319 = -1;
                  if (__pyx_t_380 < 0) {
                    __pyx_t_380 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
                    if (unlikely(__pyx_t_380 < 0)) __pyx_t_319 = 0;
                  } else if (unlikely(__pyx_t_380 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_319 = 0;
                  if (unlikely(__pyx_t_319 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_319);
                    __PYX_ERR(0, 846, __pyx_L1_error)
                  }
                  __pyx_t_128 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_379, __pyx_pybuffernd_Nrow.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_380, __pyx_pybuffernd_Nrow.diminfo[0].strides))) != 0);
                  if (!__pyx_t_128) {
                  } else {
                    __pyx_t_1 = __pyx_t_128;
                    goto __pyx_L67_bool_binop_done;
                  }
                  __pyx_t_381 = __pyx_v_K;
                  __pyx_t_319 = -1;
                  if (__pyx_t_381 < 0) {
                    __pyx_t_381 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
                    if (unlikely(__pyx_t_381 < 0)) __pyx_t_319 = 0;
                  } else if (unlikely(__pyx_t_381 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_319 = 0;
                  if (unlikely(__pyx_t_319 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_319);
                    __PYX_ERR(0, 846, __pyx_L1_error)
                  }
                  __pyx_t_382 = (__pyx_v_K - 1);
                  __pyx_t_319 = -1;
                  if (__pyx_t_382 < 0) {
                    __pyx_t_382 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
                    if (unlikely(__pyx_t_382 < 0)) __pyx_t_319 = 0;
                  } else if (unlikely(__pyx_t_382 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_319 = 0;
                  if (unlikely(__pyx_t_319 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_319);
                    __PYX_ERR(0, 846, __pyx_L1_error)
                  }
                  __pyx_t_128 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_381, __pyx_pybuffernd_Ncol.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_382, __pyx_pybuffernd_Ncol.diminfo[0].strides))) != 0);
                  __pyx_t_1 = __pyx_t_128;
                  __pyx_L67_bool_binop_done:;
                  if (__pyx_t_1) {

                    /* "openpiv/process.pyx":847
 *                                         F[K,I,J,5] = F[K,I,J,10]*dt
 *                                     elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#perform interpolation using previous iteration (which is supposed to be already validated -> this prevents error propagation)
 *                                         F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 *                                 if validation_method=='mean_velocity':#add a validation with the mean and rms values
 */
                    __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_interpolate_surroundings); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 847, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_33);
                    __pyx_t_34 = __Pyx_PyInt_From_long((__pyx_v_K - 1)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 847, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_34);
                    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    __pyx_t_15 = NULL;
                    __pyx_t_319 = 0;
                    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) {
                      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_33);
                      if (likely(__pyx_t_15)) {
                        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33);
                        __Pyx_INCREF(__pyx_t_15);
                        __Pyx_INCREF(function);
                        __Pyx_DECREF_SET(__pyx_t_33, function);
                        __pyx_t_319 = 1;
                      }
                    }
                    #if CYTHON_FAST_PYCALL
                    if (PyFunction_Check(__pyx_t_33)) {
                      PyObject *__pyx_temp[8] = {__pyx_t_15, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_34, __pyx_t_2, __pyx_t_4, __pyx_int_10};
                      __pyx_t_36 = __Pyx_PyFunction_FastCall(__pyx_t_33, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 847, __pyx_L1_error)
                      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                      __Pyx_GOTREF(__pyx_t_36);
                      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    } else
                    #endif
                    #if CYTHON_FAST_PYCCALL
                    if (__Pyx_PyFastCFunction_Check(__pyx_t_33)) {
                      PyObject *__pyx_temp[8] = {__pyx_t_15, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_34, __pyx_t_2, __pyx_t_4, __pyx_int_10};
                      __pyx_t_36 = __Pyx_PyCFunction_FastCall(__pyx_t_33, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 847, __pyx_L1_error)
                      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                      __Pyx_GOTREF(__pyx_t_36);
                      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    } else
                    #endif
                    {
                      __pyx_t_5 = PyTuple_New(7+__pyx_t_319); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      if (__pyx_t_15) {
                        __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15); __pyx_t_15 = NULL;
                      }
                      __Pyx_INCREF(((PyObject *)__pyx_v_F));
                      __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
                      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_319, ((PyObject *)__pyx_v_F));
                      __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
                      __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
                      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_319, ((PyObject *)__pyx_v_Nrow));
                      __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
                      __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
                      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_319, ((PyObject *)__pyx_v_Ncol));
                      __Pyx_GIVEREF(__pyx_t_34);
                      PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_319, __pyx_t_34);
                      __Pyx_GIVEREF(__pyx_t_2);
                      PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_319, __pyx_t_2);
                      __Pyx_GIVEREF(__pyx_t_4);
                      PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_319, __pyx_t_4);
                      __Pyx_INCREF(__pyx_int_10);
                      __Pyx_GIVEREF(__pyx_int_10);
                      PyTuple_SET_ITEM(__pyx_t_5, 6+__pyx_t_319, __pyx_int_10);
                      __pyx_t_34 = 0;
                      __pyx_t_2 = 0;
                      __pyx_t_4 = 0;
                      __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_t_5, NULL); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 847, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_36);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    }
                    __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                    __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_36); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 847, __pyx_L1_error)
                    __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                    __pyx_t_383 = __pyx_v_K;
                    __pyx_t_384 = __pyx_v_I;
                    __pyx_t_385 = __pyx_v_J;
                    __pyx_t_386 = 10;
                    __pyx_t_319 = -1;
                    if (__pyx_t_383 < 0) {
                      __pyx_t_383 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_383 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_383 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_384 < 0) {
                      __pyx_t_384 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_384 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_384 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_385 < 0) {
                      __pyx_t_385 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_385 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_385 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_386 < 0) {
                      __pyx_t_386 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_386 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_386 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 847, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_383, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_384, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_385, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_386, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

                    /* "openpiv/process.pyx":848
 *                                     elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#perform interpolation using previous iteration (which is supposed to be already validated -> this prevents error propagation)
 *                                         F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                         F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)             # <<<<<<<<<<<<<<
 *                                 if validation_method=='mean_velocity':#add a validation with the mean and rms values
 *                                     rms_u = np.sqrt(sumsquare_array(neighbours[0])/np.float(np.sum(neighbours_present)))#get rms of u
 */
                    __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_interpolate_surroundings); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 848, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_33);
                    __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_K - 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __pyx_t_34 = NULL;
                    __pyx_t_319 = 0;
                    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) {
                      __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33);
                      if (likely(__pyx_t_34)) {
                        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33);
                        __Pyx_INCREF(__pyx_t_34);
                        __Pyx_INCREF(function);
                        __Pyx_DECREF_SET(__pyx_t_33, function);
                        __pyx_t_319 = 1;
                      }
                    }
                    #if CYTHON_FAST_PYCALL
                    if (PyFunction_Check(__pyx_t_33)) {
                      PyObject *__pyx_temp[8] = {__pyx_t_34, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_5, __pyx_t_4, __pyx_t_2, __pyx_int_11};
                      __pyx_t_36 = __Pyx_PyFunction_FastCall(__pyx_t_33, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 848, __pyx_L1_error)
                      __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
                      __Pyx_GOTREF(__pyx_t_36);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    } else
                    #endif
                    #if CYTHON_FAST_PYCCALL
                    if (__Pyx_PyFastCFunction_Check(__pyx_t_33)) {
                      PyObject *__pyx_temp[8] = {__pyx_t_34, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_5, __pyx_t_4, __pyx_t_2, __pyx_int_11};
                      __pyx_t_36 = __Pyx_PyCFunction_FastCall(__pyx_t_33, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 848, __pyx_L1_error)
                      __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
                      __Pyx_GOTREF(__pyx_t_36);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    } else
                    #endif
                    {
                      __pyx_t_15 = PyTuple_New(7+__pyx_t_319); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 848, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_15);
                      if (__pyx_t_34) {
                        __Pyx_GIVEREF(__pyx_t_34); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_34); __pyx_t_34 = NULL;
                      }
                      __Pyx_INCREF(((PyObject *)__pyx_v_F));
                      __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
                      PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_319, ((PyObject *)__pyx_v_F));
                      __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
                      __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
                      PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_319, ((PyObject *)__pyx_v_Nrow));
                      __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
                      __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
                      PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_319, ((PyObject *)__pyx_v_Ncol));
                      __Pyx_GIVEREF(__pyx_t_5);
                      PyTuple_SET_ITEM(__pyx_t_15, 3+__pyx_t_319, __pyx_t_5);
                      __Pyx_GIVEREF(__pyx_t_4);
                      PyTuple_SET_ITEM(__pyx_t_15, 4+__pyx_t_319, __pyx_t_4);
                      __Pyx_GIVEREF(__pyx_t_2);
                      PyTuple_SET_ITEM(__pyx_t_15, 5+__pyx_t_319, __pyx_t_2);
                      __Pyx_INCREF(__pyx_int_11);
                      __Pyx_GIVEREF(__pyx_int_11);
                      PyTuple_SET_ITEM(__pyx_t_15, 6+__pyx_t_319, __pyx_int_11);
                      __pyx_t_5 = 0;
                      __pyx_t_4 = 0;
                      __pyx_t_2 = 0;
                      __pyx_t_36 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_t_15, NULL); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 848, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_36);
                      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                    }
                    __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                    __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_36); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 848, __pyx_L1_error)
                    __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                    __pyx_t_387 = __pyx_v_K;
                    __pyx_t_388 = __pyx_v_I;
                    __pyx_t_389 = __pyx_v_J;
                    __pyx_t_390 = 11;
                    __pyx_t_319 = -1;
                    if (__pyx_t_387 < 0) {
                      __pyx_t_387 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_387 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_387 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_388 < 0) {
                      __pyx_t_388 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_388 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_388 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_389 < 0) {
                      __pyx_t_389 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_389 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_389 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_390 < 0) {
                      __pyx_t_390 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_390 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_390 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 848, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_387, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_388, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_389, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_390, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

                    /* "openpiv/process.pyx":846
 *                                         F[K,I,J,4] = -F[K,I,J,11]*dt#recompute displacement from velocity
 *                                         F[K,I,J,5] = F[K,I,J,10]*dt
 *                                     elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#perform interpolation using previous iteration (which is supposed to be already validated -> this prevents error propagation)             # <<<<<<<<<<<<<<
 *                                         F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                         F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 */
                  }
                  __pyx_L66:;

                  /* "openpiv/process.pyx":839
 *                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))#computing the mean velocity
 *                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                 if F[K,I,J,12] < 1.5:#validation with the sig2noise ratio, 1.5 is a recommended minimum value             # <<<<<<<<<<<<<<
 *                                     if K==0:#if in 1st iteration, no interpolation is needed so just replace by the mean
 *                                         F[K,I,J,10] = mean_u
 */
                }

                /* "openpiv/process.pyx":849
 *                                         F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                         F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 *                                 if validation_method=='mean_velocity':#add a validation with the mean and rms values             # <<<<<<<<<<<<<<
 *                                     rms_u = np.sqrt(sumsquare_array(neighbours[0])/np.float(np.sum(neighbours_present)))#get rms of u
 *                                     rms_v = np.sqrt(sumsquare_array(neighbours[1])/np.float(np.sum(neighbours_present)))
 */
                __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_validation_method, __pyx_n_s_mean_velocity, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 849, __pyx_L1_error)
                __pyx_t_128 = (__pyx_t_1 != 0);
                if (__pyx_t_128) {

                  /* "openpiv/process.pyx":850
 *                                         F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 *                                 if validation_method=='mean_velocity':#add a validation with the mean and rms values
 *                                     rms_u = np.sqrt(sumsquare_array(neighbours[0])/np.float(np.sum(neighbours_present)))#get rms of u             # <<<<<<<<<<<<<<
 *                                     rms_v = np.sqrt(sumsquare_array(neighbours[1])/np.float(np.sum(neighbours_present)))
 *                                     if rms_u==0 or rms_v==0:
 */
                  __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_33);
                  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sumsquare_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_neighbours), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_5 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
                    if (likely(__pyx_t_5)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                      __Pyx_INCREF(__pyx_t_5);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_2, function);
                    }
                  }
                  __pyx_t_33 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_33);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_34);
                  __pyx_t_35 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_sum); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_35);
                  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                  __pyx_t_34 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_35))) {
                    __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_35);
                    if (likely(__pyx_t_34)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_35);
                      __Pyx_INCREF(__pyx_t_34);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_35, function);
                    }
                  }
                  __pyx_t_4 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_35, __pyx_t_34, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_35, ((PyObject *)__pyx_v_neighbours_present));
                  __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
                  __pyx_t_35 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                    __pyx_t_35 = PyMethod_GET_SELF(__pyx_t_5);
                    if (likely(__pyx_t_35)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                      __Pyx_INCREF(__pyx_t_35);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_5, function);
                    }
                  }
                  __pyx_t_2 = (__pyx_t_35) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_35, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
                  __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_33, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
                    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
                    if (likely(__pyx_t_2)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                      __Pyx_INCREF(__pyx_t_2);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_15, function);
                    }
                  }
                  __pyx_t_36 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_5);
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_36);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_36); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L1_error)
                  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                  __pyx_v_rms_u = __pyx_t_224;

                  /* "openpiv/process.pyx":851
 *                                 if validation_method=='mean_velocity':#add a validation with the mean and rms values
 *                                     rms_u = np.sqrt(sumsquare_array(neighbours[0])/np.float(np.sum(neighbours_present)))#get rms of u
 *                                     rms_v = np.sqrt(sumsquare_array(neighbours[1])/np.float(np.sum(neighbours_present)))             # <<<<<<<<<<<<<<
 *                                     if rms_u==0 or rms_v==0:
 *                                             F[K,I,J,10] = mean_u
 */
                  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sumsquare_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __pyx_t_33 = __Pyx_GetItemInt(((PyObject *)__pyx_v_neighbours), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_33);
                  __pyx_t_4 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
                    if (likely(__pyx_t_4)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                      __Pyx_INCREF(__pyx_t_4);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_2, function);
                    }
                  }
                  __pyx_t_15 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_33) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_33);
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_33);
                  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                  __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_35);
                  __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_sum); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_34);
                  __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
                  __pyx_t_35 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
                    __pyx_t_35 = PyMethod_GET_SELF(__pyx_t_34);
                    if (likely(__pyx_t_35)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
                      __Pyx_INCREF(__pyx_t_35);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_34, function);
                    }
                  }
                  __pyx_t_33 = (__pyx_t_35) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_35, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_34, ((PyObject *)__pyx_v_neighbours_present));
                  __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0;
                  if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_33);
                  __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                  __pyx_t_34 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
                    __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4);
                    if (likely(__pyx_t_34)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                      __Pyx_INCREF(__pyx_t_34);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_4, function);
                    }
                  }
                  __pyx_t_2 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_34, __pyx_t_33) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_33);
                  __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
                  __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
                    if (likely(__pyx_t_2)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                      __Pyx_INCREF(__pyx_t_2);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_5, function);
                    }
                  }
                  __pyx_t_36 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_36);
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_36); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 851, __pyx_L1_error)
                  __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                  __pyx_v_rms_v = __pyx_t_224;

                  /* "openpiv/process.pyx":852
 *                                     rms_u = np.sqrt(sumsquare_array(neighbours[0])/np.float(np.sum(neighbours_present)))#get rms of u
 *                                     rms_v = np.sqrt(sumsquare_array(neighbours[1])/np.float(np.sum(neighbours_present)))
 *                                     if rms_u==0 or rms_v==0:             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v
 */
                  __pyx_t_1 = ((__pyx_v_rms_u == 0.0) != 0);
                  if (!__pyx_t_1) {
                  } else {
                    __pyx_t_128 = __pyx_t_1;
                    goto __pyx_L72_bool_binop_done;
                  }
                  __pyx_t_1 = ((__pyx_v_rms_v == 0.0) != 0);
                  __pyx_t_128 = __pyx_t_1;
                  __pyx_L72_bool_binop_done:;
                  if (__pyx_t_128) {

                    /* "openpiv/process.pyx":853
 *                                     rms_v = np.sqrt(sumsquare_array(neighbours[1])/np.float(np.sum(neighbours_present)))
 *                                     if rms_u==0 or rms_v==0:
 *                                             F[K,I,J,10] = mean_u             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,11] = mean_v
 *                                     elif ((F[K,I,J,10] - mean_u)/rms_u) > tolerance or ((F[K,I,J,11] - mean_v)/rms_v) > tolerance:
 */
                    __pyx_t_391 = __pyx_v_K;
                    __pyx_t_392 = __pyx_v_I;
                    __pyx_t_393 = __pyx_v_J;
                    __pyx_t_394 = 10;
                    __pyx_t_319 = -1;
                    if (__pyx_t_391 < 0) {
                      __pyx_t_391 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_391 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_391 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_392 < 0) {
                      __pyx_t_392 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_392 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_392 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_393 < 0) {
                      __pyx_t_393 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_393 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_393 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_394 < 0) {
                      __pyx_t_394 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_394 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_394 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 853, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_391, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_392, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_393, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_394, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_u;

                    /* "openpiv/process.pyx":854
 *                                     if rms_u==0 or rms_v==0:
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v             # <<<<<<<<<<<<<<
 *                                     elif ((F[K,I,J,10] - mean_u)/rms_u) > tolerance or ((F[K,I,J,11] - mean_v)/rms_v) > tolerance:
 *                                         if K==0:
 */
                    __pyx_t_395 = __pyx_v_K;
                    __pyx_t_396 = __pyx_v_I;
                    __pyx_t_397 = __pyx_v_J;
                    __pyx_t_398 = 11;
                    __pyx_t_319 = -1;
                    if (__pyx_t_395 < 0) {
                      __pyx_t_395 += __pyx_pybuffernd_F.diminfo[0].shape;
                      if (unlikely(__pyx_t_395 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_395 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (__pyx_t_396 < 0) {
                      __pyx_t_396 += __pyx_pybuffernd_F.diminfo[1].shape;
                      if (unlikely(__pyx_t_396 < 0)) __pyx_t_319 = 1;
                    } else if (unlikely(__pyx_t_396 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                    if (__pyx_t_397 < 0) {
                      __pyx_t_397 += __pyx_pybuffernd_F.diminfo[2].shape;
                      if (unlikely(__pyx_t_397 < 0)) __pyx_t_319 = 2;
                    } else if (unlikely(__pyx_t_397 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                    if (__pyx_t_398 < 0) {
                      __pyx_t_398 += __pyx_pybuffernd_F.diminfo[3].shape;
                      if (unlikely(__pyx_t_398 < 0)) __pyx_t_319 = 3;
                    } else if (unlikely(__pyx_t_398 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 854, __pyx_L1_error)
                    }
                    *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_395, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_396, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_397, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_398, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_v;

                    /* "openpiv/process.pyx":852
 *                                     rms_u = np.sqrt(sumsquare_array(neighbours[0])/np.float(np.sum(neighbours_present)))#get rms of u
 *                                     rms_v = np.sqrt(sumsquare_array(neighbours[1])/np.float(np.sum(neighbours_present)))
 *                                     if rms_u==0 or rms_v==0:             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v
 */
                    goto __pyx_L71;
                  }

                  /* "openpiv/process.pyx":855
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v
 *                                     elif ((F[K,I,J,10] - mean_u)/rms_u) > tolerance or ((F[K,I,J,11] - mean_v)/rms_v) > tolerance:             # <<<<<<<<<<<<<<
 *                                         if K==0:
 *                                             F[K,I,J,10] = mean_u
 */
                  __pyx_t_399 = __pyx_v_K;
                  __pyx_t_400 = __pyx_v_I;
                  __pyx_t_401 = __pyx_v_J;
                  __pyx_t_402 = 10;
                  __pyx_t_319 = -1;
                  if (__pyx_t_399 < 0) {
                    __pyx_t_399 += __pyx_pybuffernd_F.diminfo[0].shape;
                    if (unlikely(__pyx_t_399 < 0)) __pyx_t_319 = 0;
                  } else if (unlikely(__pyx_t_399 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                  if (__pyx_t_400 < 0) {
                    __pyx_t_400 += __pyx_pybuffernd_F.diminfo[1].shape;
                    if (unlikely(__pyx_t_400 < 0)) __pyx_t_319 = 1;
                  } else if (unlikely(__pyx_t_400 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                  if (__pyx_t_401 < 0) {
                    __pyx_t_401 += __pyx_pybuffernd_F.diminfo[2].shape;
                    if (unlikely(__pyx_t_401 < 0)) __pyx_t_319 = 2;
                  } else if (unlikely(__pyx_t_401 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                  if (__pyx_t_402 < 0) {
                    __pyx_t_402 += __pyx_pybuffernd_F.diminfo[3].shape;
                    if (unlikely(__pyx_t_402 < 0)) __pyx_t_319 = 3;
                  } else if (unlikely(__pyx_t_402 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                  if (unlikely(__pyx_t_319 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_319);
                    __PYX_ERR(0, 855, __pyx_L1_error)
                  }
                  __pyx_t_106 = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_399, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_400, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_401, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_402, __pyx_pybuffernd_F.diminfo[3].strides)) - __pyx_v_mean_u);
                  if (unlikely(__pyx_v_rms_u == 0)) {
                    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                    __PYX_ERR(0, 855, __pyx_L1_error)
                  }
                  __pyx_t_1 = (((__pyx_t_106 / ((__pyx_t_7openpiv_7process_DTYPEf_t)__pyx_v_rms_u)) > __pyx_v_tolerance) != 0);
                  if (!__pyx_t_1) {
                  } else {
                    __pyx_t_128 = __pyx_t_1;
                    goto __pyx_L74_bool_binop_done;
                  }
                  __pyx_t_403 = __pyx_v_K;
                  __pyx_t_404 = __pyx_v_I;
                  __pyx_t_405 = __pyx_v_J;
                  __pyx_t_406 = 11;
                  __pyx_t_319 = -1;
                  if (__pyx_t_403 < 0) {
                    __pyx_t_403 += __pyx_pybuffernd_F.diminfo[0].shape;
                    if (unlikely(__pyx_t_403 < 0)) __pyx_t_319 = 0;
                  } else if (unlikely(__pyx_t_403 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                  if (__pyx_t_404 < 0) {
                    __pyx_t_404 += __pyx_pybuffernd_F.diminfo[1].shape;
                    if (unlikely(__pyx_t_404 < 0)) __pyx_t_319 = 1;
                  } else if (unlikely(__pyx_t_404 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                  if (__pyx_t_405 < 0) {
                    __pyx_t_405 += __pyx_pybuffernd_F.diminfo[2].shape;
                    if (unlikely(__pyx_t_405 < 0)) __pyx_t_319 = 2;
                  } else if (unlikely(__pyx_t_405 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                  if (__pyx_t_406 < 0) {
                    __pyx_t_406 += __pyx_pybuffernd_F.diminfo[3].shape;
                    if (unlikely(__pyx_t_406 < 0)) __pyx_t_319 = 3;
                  } else if (unlikely(__pyx_t_406 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                  if (unlikely(__pyx_t_319 != -1)) {
                    __Pyx_RaiseBufferIndexError(__pyx_t_319);
                    __PYX_ERR(0, 855, __pyx_L1_error)
                  }
                  __pyx_t_106 = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_403, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_404, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_405, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_406, __pyx_pybuffernd_F.diminfo[3].strides)) - __pyx_v_mean_v);
                  if (unlikely(__pyx_v_rms_v == 0)) {
                    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                    __PYX_ERR(0, 855, __pyx_L1_error)
                  }
                  __pyx_t_1 = (((__pyx_t_106 / ((__pyx_t_7openpiv_7process_DTYPEf_t)__pyx_v_rms_v)) > __pyx_v_tolerance) != 0);
                  __pyx_t_128 = __pyx_t_1;
                  __pyx_L74_bool_binop_done:;
                  if (__pyx_t_128) {

                    /* "openpiv/process.pyx":856
 *                                             F[K,I,J,11] = mean_v
 *                                     elif ((F[K,I,J,10] - mean_u)/rms_u) > tolerance or ((F[K,I,J,11] - mean_v)/rms_v) > tolerance:
 *                                         if K==0:             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v
 */
                    __pyx_t_128 = ((__pyx_v_K == 0) != 0);
                    if (__pyx_t_128) {

                      /* "openpiv/process.pyx":857
 *                                     elif ((F[K,I,J,10] - mean_u)/rms_u) > tolerance or ((F[K,I,J,11] - mean_v)/rms_v) > tolerance:
 *                                         if K==0:
 *                                             F[K,I,J,10] = mean_u             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,11] = mean_v
 *                                             (<object>mask)[I,J]=True
 */
                      __pyx_t_407 = __pyx_v_K;
                      __pyx_t_408 = __pyx_v_I;
                      __pyx_t_409 = __pyx_v_J;
                      __pyx_t_410 = 10;
                      __pyx_t_319 = -1;
                      if (__pyx_t_407 < 0) {
                        __pyx_t_407 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_407 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_407 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_408 < 0) {
                        __pyx_t_408 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_408 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_408 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_409 < 0) {
                        __pyx_t_409 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_409 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_409 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_410 < 0) {
                        __pyx_t_410 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_410 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_410 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 857, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_407, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_408, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_409, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_410, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_u;

                      /* "openpiv/process.pyx":858
 *                                         if K==0:
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v             # <<<<<<<<<<<<<<
 *                                             (<object>mask)[I,J]=True
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 */
                      __pyx_t_411 = __pyx_v_K;
                      __pyx_t_412 = __pyx_v_I;
                      __pyx_t_413 = __pyx_v_J;
                      __pyx_t_414 = 11;
                      __pyx_t_319 = -1;
                      if (__pyx_t_411 < 0) {
                        __pyx_t_411 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_411 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_411 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_412 < 0) {
                        __pyx_t_412 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_412 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_412 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_413 < 0) {
                        __pyx_t_413 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_413 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_413 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_414 < 0) {
                        __pyx_t_414 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_414 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_414 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 858, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_411, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_412, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_413, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_414, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_v;

                      /* "openpiv/process.pyx":859
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v
 *                                             (<object>mask)[I,J]=True             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 */
                      __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 859, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_36);
                      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __Pyx_GIVEREF(__pyx_t_36);
                      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_36);
                      __Pyx_GIVEREF(__pyx_t_5);
                      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
                      __pyx_t_36 = 0;
                      __pyx_t_5 = 0;
                      if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_mask), __pyx_t_4, Py_True) < 0)) __PYX_ERR(0, 859, __pyx_L1_error)
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                      /* "openpiv/process.pyx":860
 *                                             F[K,I,J,11] = mean_v
 *                                             (<object>mask)[I,J]=True
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#case if different dimensions : interpolation using previous iteration
 */
                      __pyx_t_415 = __pyx_v_K;
                      __pyx_t_416 = __pyx_v_I;
                      __pyx_t_417 = __pyx_v_J;
                      __pyx_t_418 = 11;
                      __pyx_t_319 = -1;
                      if (__pyx_t_415 < 0) {
                        __pyx_t_415 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_415 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_415 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_416 < 0) {
                        __pyx_t_416 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_416 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_416 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_417 < 0) {
                        __pyx_t_417 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_417 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_417 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_418 < 0) {
                        __pyx_t_418 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_418 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_418 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 860, __pyx_L1_error)
                      }
                      __pyx_t_419 = __pyx_v_K;
                      __pyx_t_420 = __pyx_v_I;
                      __pyx_t_421 = __pyx_v_J;
                      __pyx_t_422 = 4;
                      __pyx_t_319 = -1;
                      if (__pyx_t_419 < 0) {
                        __pyx_t_419 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_419 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_419 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_420 < 0) {
                        __pyx_t_420 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_420 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_420 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_421 < 0) {
                        __pyx_t_421 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_421 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_421 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_422 < 0) {
                        __pyx_t_422 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_422 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_422 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 860, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_419, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_420, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_421, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_422, __pyx_pybuffernd_F.diminfo[3].strides) = ((-(*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_415, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_416, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_417, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_418, __pyx_pybuffernd_F.diminfo[3].strides))) * __pyx_v_dt);

                      /* "openpiv/process.pyx":861
 *                                             (<object>mask)[I,J]=True
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt             # <<<<<<<<<<<<<<
 *                                         elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#case if different dimensions : interpolation using previous iteration
 *                                             F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 */
                      __pyx_t_423 = __pyx_v_K;
                      __pyx_t_424 = __pyx_v_I;
                      __pyx_t_425 = __pyx_v_J;
                      __pyx_t_426 = 10;
                      __pyx_t_319 = -1;
                      if (__pyx_t_423 < 0) {
                        __pyx_t_423 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_423 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_423 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_424 < 0) {
                        __pyx_t_424 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_424 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_424 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_425 < 0) {
                        __pyx_t_425 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_425 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_425 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_426 < 0) {
                        __pyx_t_426 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_426 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_426 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 861, __pyx_L1_error)
                      }
                      __pyx_t_427 = __pyx_v_K;
                      __pyx_t_428 = __pyx_v_I;
                      __pyx_t_429 = __pyx_v_J;
                      __pyx_t_430 = 5;
                      __pyx_t_319 = -1;
                      if (__pyx_t_427 < 0) {
                        __pyx_t_427 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_427 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_427 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_428 < 0) {
                        __pyx_t_428 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_428 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_428 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_429 < 0) {
                        __pyx_t_429 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_429 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_429 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_430 < 0) {
                        __pyx_t_430 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_430 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_430 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 861, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_427, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_428, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_429, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_430, __pyx_pybuffernd_F.diminfo[3].strides) = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_423, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_424, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_425, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_426, __pyx_pybuffernd_F.diminfo[3].strides)) * __pyx_v_dt);

                      /* "openpiv/process.pyx":856
 *                                             F[K,I,J,11] = mean_v
 *                                     elif ((F[K,I,J,10] - mean_u)/rms_u) > tolerance or ((F[K,I,J,11] - mean_v)/rms_v) > tolerance:
 *                                         if K==0:             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v
 */
                      goto __pyx_L76;
                    }

                    /* "openpiv/process.pyx":862
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#case if different dimensions : interpolation using previous iteration             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                             F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 */
                    __pyx_t_1 = ((__pyx_v_K > 0) != 0);
                    if (__pyx_t_1) {
                    } else {
                      __pyx_t_128 = __pyx_t_1;
                      goto __pyx_L77_bool_binop_done;
                    }
                    __pyx_t_431 = __pyx_v_K;
                    __pyx_t_319 = -1;
                    if (__pyx_t_431 < 0) {
                      __pyx_t_431 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
                      if (unlikely(__pyx_t_431 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_431 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 862, __pyx_L1_error)
                    }
                    __pyx_t_432 = (__pyx_v_K - 1);
                    __pyx_t_319 = -1;
                    if (__pyx_t_432 < 0) {
                      __pyx_t_432 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
                      if (unlikely(__pyx_t_432 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_432 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 862, __pyx_L1_error)
                    }
                    __pyx_t_1 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_431, __pyx_pybuffernd_Nrow.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_432, __pyx_pybuffernd_Nrow.diminfo[0].strides))) != 0);
                    if (!__pyx_t_1) {
                    } else {
                      __pyx_t_128 = __pyx_t_1;
                      goto __pyx_L77_bool_binop_done;
                    }
                    __pyx_t_433 = __pyx_v_K;
                    __pyx_t_319 = -1;
                    if (__pyx_t_433 < 0) {
                      __pyx_t_433 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
                      if (unlikely(__pyx_t_433 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_433 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 862, __pyx_L1_error)
                    }
                    __pyx_t_434 = (__pyx_v_K - 1);
                    __pyx_t_319 = -1;
                    if (__pyx_t_434 < 0) {
                      __pyx_t_434 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
                      if (unlikely(__pyx_t_434 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_434 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 862, __pyx_L1_error)
                    }
                    __pyx_t_1 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_433, __pyx_pybuffernd_Ncol.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_434, __pyx_pybuffernd_Ncol.diminfo[0].strides))) != 0);
                    __pyx_t_128 = __pyx_t_1;
                    __pyx_L77_bool_binop_done:;
                    if (__pyx_t_128) {

                      /* "openpiv/process.pyx":863
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#case if different dimensions : interpolation using previous iteration
 *                                             F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 *                                             (<object>mask)[I,J]=True
 */
                      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_interpolate_surroundings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_36 = __Pyx_PyInt_From_long((__pyx_v_K - 1)); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 863, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_36);
                      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_2);
                      __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 863, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_15);
                      __pyx_t_33 = NULL;
                      __pyx_t_319 = 0;
                      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                        __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_5);
                        if (likely(__pyx_t_33)) {
                          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                          __Pyx_INCREF(__pyx_t_33);
                          __Pyx_INCREF(function);
                          __Pyx_DECREF_SET(__pyx_t_5, function);
                          __pyx_t_319 = 1;
                        }
                      }
                      #if CYTHON_FAST_PYCALL
                      if (PyFunction_Check(__pyx_t_5)) {
                        PyObject *__pyx_temp[8] = {__pyx_t_33, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_36, __pyx_t_2, __pyx_t_15, __pyx_int_10};
                        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error)
                        __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                      } else
                      #endif
                      #if CYTHON_FAST_PYCCALL
                      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
                        PyObject *__pyx_temp[8] = {__pyx_t_33, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_36, __pyx_t_2, __pyx_t_15, __pyx_int_10};
                        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error)
                        __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                      } else
                      #endif
                      {
                        __pyx_t_34 = PyTuple_New(7+__pyx_t_319); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 863, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_34);
                        if (__pyx_t_33) {
                          __Pyx_GIVEREF(__pyx_t_33); PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_33); __pyx_t_33 = NULL;
                        }
                        __Pyx_INCREF(((PyObject *)__pyx_v_F));
                        __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
                        PyTuple_SET_ITEM(__pyx_t_34, 0+__pyx_t_319, ((PyObject *)__pyx_v_F));
                        __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
                        __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
                        PyTuple_SET_ITEM(__pyx_t_34, 1+__pyx_t_319, ((PyObject *)__pyx_v_Nrow));
                        __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
                        __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
                        PyTuple_SET_ITEM(__pyx_t_34, 2+__pyx_t_319, ((PyObject *)__pyx_v_Ncol));
                        __Pyx_GIVEREF(__pyx_t_36);
                        PyTuple_SET_ITEM(__pyx_t_34, 3+__pyx_t_319, __pyx_t_36);
                        __Pyx_GIVEREF(__pyx_t_2);
                        PyTuple_SET_ITEM(__pyx_t_34, 4+__pyx_t_319, __pyx_t_2);
                        __Pyx_GIVEREF(__pyx_t_15);
                        PyTuple_SET_ITEM(__pyx_t_34, 5+__pyx_t_319, __pyx_t_15);
                        __Pyx_INCREF(__pyx_int_10);
                        __Pyx_GIVEREF(__pyx_int_10);
                        PyTuple_SET_ITEM(__pyx_t_34, 6+__pyx_t_319, __pyx_int_10);
                        __pyx_t_36 = 0;
                        __pyx_t_2 = 0;
                        __pyx_t_15 = 0;
                        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_34, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                      }
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L1_error)
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __pyx_t_435 = __pyx_v_K;
                      __pyx_t_436 = __pyx_v_I;
                      __pyx_t_437 = __pyx_v_J;
                      __pyx_t_438 = 10;
                      __pyx_t_319 = -1;
                      if (__pyx_t_435 < 0) {
                        __pyx_t_435 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_435 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_435 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_436 < 0) {
                        __pyx_t_436 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_436 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_436 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_437 < 0) {
                        __pyx_t_437 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_437 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_437 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_438 < 0) {
                        __pyx_t_438 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_438 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_438 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 863, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_435, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_436, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_437, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_438, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

                      /* "openpiv/process.pyx":864
 *                                         elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#case if different dimensions : interpolation using previous iteration
 *                                             F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                             F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)             # <<<<<<<<<<<<<<
 *                                             (<object>mask)[I,J]=True
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 */
                      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_interpolate_surroundings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 864, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_34 = __Pyx_PyInt_From_long((__pyx_v_K - 1)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 864, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_34);
                      __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 864, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_15);
                      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_2);
                      __pyx_t_36 = NULL;
                      __pyx_t_319 = 0;
                      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                        __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_5);
                        if (likely(__pyx_t_36)) {
                          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                          __Pyx_INCREF(__pyx_t_36);
                          __Pyx_INCREF(function);
                          __Pyx_DECREF_SET(__pyx_t_5, function);
                          __pyx_t_319 = 1;
                        }
                      }
                      #if CYTHON_FAST_PYCALL
                      if (PyFunction_Check(__pyx_t_5)) {
                        PyObject *__pyx_temp[8] = {__pyx_t_36, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_34, __pyx_t_15, __pyx_t_2, __pyx_int_11};
                        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error)
                        __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                      } else
                      #endif
                      #if CYTHON_FAST_PYCCALL
                      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
                        PyObject *__pyx_temp[8] = {__pyx_t_36, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_34, __pyx_t_15, __pyx_t_2, __pyx_int_11};
                        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_319, 7+__pyx_t_319); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error)
                        __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                      } else
                      #endif
                      {
                        __pyx_t_33 = PyTuple_New(7+__pyx_t_319); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 864, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        if (__pyx_t_36) {
                          __Pyx_GIVEREF(__pyx_t_36); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_36); __pyx_t_36 = NULL;
                        }
                        __Pyx_INCREF(((PyObject *)__pyx_v_F));
                        __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
                        PyTuple_SET_ITEM(__pyx_t_33, 0+__pyx_t_319, ((PyObject *)__pyx_v_F));
                        __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
                        __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
                        PyTuple_SET_ITEM(__pyx_t_33, 1+__pyx_t_319, ((PyObject *)__pyx_v_Nrow));
                        __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
                        __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
                        PyTuple_SET_ITEM(__pyx_t_33, 2+__pyx_t_319, ((PyObject *)__pyx_v_Ncol));
                        __Pyx_GIVEREF(__pyx_t_34);
                        PyTuple_SET_ITEM(__pyx_t_33, 3+__pyx_t_319, __pyx_t_34);
                        __Pyx_GIVEREF(__pyx_t_15);
                        PyTuple_SET_ITEM(__pyx_t_33, 4+__pyx_t_319, __pyx_t_15);
                        __Pyx_GIVEREF(__pyx_t_2);
                        PyTuple_SET_ITEM(__pyx_t_33, 5+__pyx_t_319, __pyx_t_2);
                        __Pyx_INCREF(__pyx_int_11);
                        __Pyx_GIVEREF(__pyx_int_11);
                        PyTuple_SET_ITEM(__pyx_t_33, 6+__pyx_t_319, __pyx_int_11);
                        __pyx_t_34 = 0;
                        __pyx_t_15 = 0;
                        __pyx_t_2 = 0;
                        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_33, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                      }
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L1_error)
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __pyx_t_439 = __pyx_v_K;
                      __pyx_t_440 = __pyx_v_I;
                      __pyx_t_441 = __pyx_v_J;
                      __pyx_t_442 = 11;
                      __pyx_t_319 = -1;
                      if (__pyx_t_439 < 0) {
                        __pyx_t_439 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_439 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_439 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_440 < 0) {
                        __pyx_t_440 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_440 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_440 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_441 < 0) {
                        __pyx_t_441 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_441 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_441 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_442 < 0) {
                        __pyx_t_442 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_442 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_442 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 864, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_439, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_440, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_441, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_442, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

                      /* "openpiv/process.pyx":865
 *                                             F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                             F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 *                                             (<object>mask)[I,J]=True             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 */
                      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 865, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_33 = PyTuple_New(2); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 865, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_33);
                      __Pyx_GIVEREF(__pyx_t_4);
                      PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_4);
                      __Pyx_GIVEREF(__pyx_t_5);
                      PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_t_5);
                      __pyx_t_4 = 0;
                      __pyx_t_5 = 0;
                      if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_mask), __pyx_t_33, Py_True) < 0)) __PYX_ERR(0, 865, __pyx_L1_error)
                      __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;

                      /* "openpiv/process.pyx":866
 *                                             F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 *                                             (<object>mask)[I,J]=True
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] == Nrow[K-1] or Ncol[K] == Ncol[K-1]):#case if same dimensions
 */
                      __pyx_t_443 = __pyx_v_K;
                      __pyx_t_444 = __pyx_v_I;
                      __pyx_t_445 = __pyx_v_J;
                      __pyx_t_446 = 11;
                      __pyx_t_319 = -1;
                      if (__pyx_t_443 < 0) {
                        __pyx_t_443 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_443 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_443 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_444 < 0) {
                        __pyx_t_444 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_444 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_444 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_445 < 0) {
                        __pyx_t_445 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_445 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_445 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_446 < 0) {
                        __pyx_t_446 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_446 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_446 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 866, __pyx_L1_error)
                      }
                      __pyx_t_447 = __pyx_v_K;
                      __pyx_t_448 = __pyx_v_I;
                      __pyx_t_449 = __pyx_v_J;
                      __pyx_t_450 = 4;
                      __pyx_t_319 = -1;
                      if (__pyx_t_447 < 0) {
                        __pyx_t_447 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_447 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_447 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_448 < 0) {
                        __pyx_t_448 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_448 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_448 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_449 < 0) {
                        __pyx_t_449 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_449 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_449 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_450 < 0) {
                        __pyx_t_450 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_450 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_450 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 866, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_447, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_448, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_449, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_450, __pyx_pybuffernd_F.diminfo[3].strides) = ((-(*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_443, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_444, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_445, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_446, __pyx_pybuffernd_F.diminfo[3].strides))) * __pyx_v_dt);

                      /* "openpiv/process.pyx":867
 *                                             (<object>mask)[I,J]=True
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt             # <<<<<<<<<<<<<<
 *                                         elif K>0 and (Nrow[K] == Nrow[K-1] or Ncol[K] == Ncol[K-1]):#case if same dimensions
 *                                             for L in range(3):
 */
                      __pyx_t_451 = __pyx_v_K;
                      __pyx_t_452 = __pyx_v_I;
                      __pyx_t_453 = __pyx_v_J;
                      __pyx_t_454 = 10;
                      __pyx_t_319 = -1;
                      if (__pyx_t_451 < 0) {
                        __pyx_t_451 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_451 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_451 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_452 < 0) {
                        __pyx_t_452 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_452 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_452 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_453 < 0) {
                        __pyx_t_453 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_453 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_453 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_454 < 0) {
                        __pyx_t_454 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_454 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_454 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 867, __pyx_L1_error)
                      }
                      __pyx_t_455 = __pyx_v_K;
                      __pyx_t_456 = __pyx_v_I;
                      __pyx_t_457 = __pyx_v_J;
                      __pyx_t_458 = 5;
                      __pyx_t_319 = -1;
                      if (__pyx_t_455 < 0) {
                        __pyx_t_455 += __pyx_pybuffernd_F.diminfo[0].shape;
                        if (unlikely(__pyx_t_455 < 0)) __pyx_t_319 = 0;
                      } else if (unlikely(__pyx_t_455 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                      if (__pyx_t_456 < 0) {
                        __pyx_t_456 += __pyx_pybuffernd_F.diminfo[1].shape;
                        if (unlikely(__pyx_t_456 < 0)) __pyx_t_319 = 1;
                      } else if (unlikely(__pyx_t_456 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                      if (__pyx_t_457 < 0) {
                        __pyx_t_457 += __pyx_pybuffernd_F.diminfo[2].shape;
                        if (unlikely(__pyx_t_457 < 0)) __pyx_t_319 = 2;
                      } else if (unlikely(__pyx_t_457 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                      if (__pyx_t_458 < 0) {
                        __pyx_t_458 += __pyx_pybuffernd_F.diminfo[3].shape;
                        if (unlikely(__pyx_t_458 < 0)) __pyx_t_319 = 3;
                      } else if (unlikely(__pyx_t_458 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                      if (unlikely(__pyx_t_319 != -1)) {
                        __Pyx_RaiseBufferIndexError(__pyx_t_319);
                        __PYX_ERR(0, 867, __pyx_L1_error)
                      }
                      *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_455, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_456, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_457, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_458, __pyx_pybuffernd_F.diminfo[3].strides) = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_451, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_452, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_453, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_454, __pyx_pybuffernd_F.diminfo[3].strides)) * __pyx_v_dt);

                      /* "openpiv/process.pyx":862
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] != Nrow[K-1] or Ncol[K] != Ncol[K-1]):#case if different dimensions : interpolation using previous iteration             # <<<<<<<<<<<<<<
 *                                             F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                             F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 */
                      goto __pyx_L76;
                    }

                    /* "openpiv/process.pyx":868
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] == Nrow[K-1] or Ncol[K] == Ncol[K-1]):#case if same dimensions             # <<<<<<<<<<<<<<
 *                                             for L in range(3):
 *                                                 for M in range(3):
 */
                    __pyx_t_1 = ((__pyx_v_K > 0) != 0);
                    if (__pyx_t_1) {
                    } else {
                      __pyx_t_128 = __pyx_t_1;
                      goto __pyx_L80_bool_binop_done;
                    }
                    __pyx_t_459 = __pyx_v_K;
                    __pyx_t_319 = -1;
                    if (__pyx_t_459 < 0) {
                      __pyx_t_459 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
                      if (unlikely(__pyx_t_459 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_459 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 868, __pyx_L1_error)
                    }
                    __pyx_t_460 = (__pyx_v_K - 1);
                    __pyx_t_319 = -1;
                    if (__pyx_t_460 < 0) {
                      __pyx_t_460 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
                      if (unlikely(__pyx_t_460 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_460 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 868, __pyx_L1_error)
                    }
                    __pyx_t_1 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_459, __pyx_pybuffernd_Nrow.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_460, __pyx_pybuffernd_Nrow.diminfo[0].strides))) != 0);
                    if (!__pyx_t_1) {
                    } else {
                      __pyx_t_128 = __pyx_t_1;
                      goto __pyx_L80_bool_binop_done;
                    }
                    __pyx_t_461 = __pyx_v_K;
                    __pyx_t_319 = -1;
                    if (__pyx_t_461 < 0) {
                      __pyx_t_461 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
                      if (unlikely(__pyx_t_461 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_461 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 868, __pyx_L1_error)
                    }
                    __pyx_t_462 = (__pyx_v_K - 1);
                    __pyx_t_319 = -1;
                    if (__pyx_t_462 < 0) {
                      __pyx_t_462 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
                      if (unlikely(__pyx_t_462 < 0)) __pyx_t_319 = 0;
                    } else if (unlikely(__pyx_t_462 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_319 = 0;
                    if (unlikely(__pyx_t_319 != -1)) {
                      __Pyx_RaiseBufferIndexError(__pyx_t_319);
                      __PYX_ERR(0, 868, __pyx_L1_error)
                    }
                    __pyx_t_1 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_461, __pyx_pybuffernd_Ncol.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_462, __pyx_pybuffernd_Ncol.diminfo[0].strides))) != 0);
                    __pyx_t_128 = __pyx_t_1;
                    __pyx_L80_bool_binop_done:;
                    if (__pyx_t_128) {

                      /* "openpiv/process.pyx":869
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] == Nrow[K-1] or Ncol[K] == Ncol[K-1]):#case if same dimensions
 *                                             for L in range(3):             # <<<<<<<<<<<<<<
 *                                                 for M in range(3):
 *                                                     if neighbours_present[L,M]:
 */
                      for (__pyx_t_319 = 0; __pyx_t_319 < 3; __pyx_t_319+=1) {
                        __pyx_v_L = __pyx_t_319;

                        /* "openpiv/process.pyx":870
 *                                         elif K>0 and (Nrow[K] == Nrow[K-1] or Ncol[K] == Ncol[K-1]):#case if same dimensions
 *                                             for L in range(3):
 *                                                 for M in range(3):             # <<<<<<<<<<<<<<
 *                                                     if neighbours_present[L,M]:
 *                                                         neighbours[0,L,M]=F[K-1,I+L-1,J+M-1,10]#u
 */
                        for (__pyx_t_322 = 0; __pyx_t_322 < 3; __pyx_t_322+=1) {
                          __pyx_v_M = __pyx_t_322;

                          /* "openpiv/process.pyx":871
 *                                             for L in range(3):
 *                                                 for M in range(3):
 *                                                     if neighbours_present[L,M]:             # <<<<<<<<<<<<<<
 *                                                         neighbours[0,L,M]=F[K-1,I+L-1,J+M-1,10]#u
 *                                                         neighbours[1,L,M]=F[K-1,I+L-1,J+M-1,11]#v
 */
                          __pyx_t_463 = __pyx_v_L;
                          __pyx_t_464 = __pyx_v_M;
                          __pyx_t_465 = -1;
                          if (__pyx_t_463 < 0) {
                            __pyx_t_463 += __pyx_pybuffernd_neighbours_present.diminfo[0].shape;
                            if (unlikely(__pyx_t_463 < 0)) __pyx_t_465 = 0;
                          } else if (unlikely(__pyx_t_463 >= __pyx_pybuffernd_neighbours_present.diminfo[0].shape)) __pyx_t_465 = 0;
                          if (__pyx_t_464 < 0) {
                            __pyx_t_464 += __pyx_pybuffernd_neighbours_present.diminfo[1].shape;
                            if (unlikely(__pyx_t_464 < 0)) __pyx_t_465 = 1;
                          } else if (unlikely(__pyx_t_464 >= __pyx_pybuffernd_neighbours_present.diminfo[1].shape)) __pyx_t_465 = 1;
                          if (unlikely(__pyx_t_465 != -1)) {
                            __Pyx_RaiseBufferIndexError(__pyx_t_465);
                            __PYX_ERR(0, 871, __pyx_L1_error)
                          }
                          __pyx_t_128 = ((*__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer.buf, __pyx_t_463, __pyx_pybuffernd_neighbours_present.diminfo[0].strides, __pyx_t_464, __pyx_pybuffernd_neighbours_present.diminfo[1].strides)) != 0);
                          if (__pyx_t_128) {

                            /* "openpiv/process.pyx":872
 *                                                 for M in range(3):
 *                                                     if neighbours_present[L,M]:
 *                                                         neighbours[0,L,M]=F[K-1,I+L-1,J+M-1,10]#u             # <<<<<<<<<<<<<<
 *                                                         neighbours[1,L,M]=F[K-1,I+L-1,J+M-1,11]#v
 *                                                     else:
 */
                            __pyx_t_466 = (__pyx_v_K - 1);
                            __pyx_t_467 = ((__pyx_v_I + __pyx_v_L) - 1);
                            __pyx_t_468 = ((__pyx_v_J + __pyx_v_M) - 1);
                            __pyx_t_469 = 10;
                            __pyx_t_465 = -1;
                            if (__pyx_t_466 < 0) {
                              __pyx_t_466 += __pyx_pybuffernd_F.diminfo[0].shape;
                              if (unlikely(__pyx_t_466 < 0)) __pyx_t_465 = 0;
                            } else if (unlikely(__pyx_t_466 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_465 = 0;
                            if (__pyx_t_467 < 0) {
                              __pyx_t_467 += __pyx_pybuffernd_F.diminfo[1].shape;
                              if (unlikely(__pyx_t_467 < 0)) __pyx_t_465 = 1;
                            } else if (unlikely(__pyx_t_467 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_465 = 1;
                            if (__pyx_t_468 < 0) {
                              __pyx_t_468 += __pyx_pybuffernd_F.diminfo[2].shape;
                              if (unlikely(__pyx_t_468 < 0)) __pyx_t_465 = 2;
                            } else if (unlikely(__pyx_t_468 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_465 = 2;
                            if (__pyx_t_469 < 0) {
                              __pyx_t_469 += __pyx_pybuffernd_F.diminfo[3].shape;
                              if (unlikely(__pyx_t_469 < 0)) __pyx_t_465 = 3;
                            } else if (unlikely(__pyx_t_469 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_465 = 3;
                            if (unlikely(__pyx_t_465 != -1)) {
                              __Pyx_RaiseBufferIndexError(__pyx_t_465);
                              __PYX_ERR(0, 872, __pyx_L1_error)
                            }
                            __pyx_t_470 = 0;
                            __pyx_t_471 = __pyx_v_L;
                            __pyx_t_472 = __pyx_v_M;
                            __pyx_t_465 = -1;
                            if (__pyx_t_470 < 0) {
                              __pyx_t_470 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                              if (unlikely(__pyx_t_470 < 0)) __pyx_t_465 = 0;
                            } else if (unlikely(__pyx_t_470 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_465 = 0;
                            if (__pyx_t_471 < 0) {
                              __pyx_t_471 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                              if (unlikely(__pyx_t_471 < 0)) __pyx_t_465 = 1;
                            } else if (unlikely(__pyx_t_471 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_465 = 1;
                            if (__pyx_t_472 < 0) {
                              __pyx_t_472 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                              if (unlikely(__pyx_t_472 < 0)) __pyx_t_465 = 2;
                            } else if (unlikely(__pyx_t_472 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_465 = 2;
                            if (unlikely(__pyx_t_465 != -1)) {
                              __Pyx_RaiseBufferIndexError(__pyx_t_465);
                              __PYX_ERR(0, 872, __pyx_L1_error)
                            }
                            *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_470, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_471, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_472, __pyx_pybuffernd_neighbours.diminfo[2].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_466, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_467, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_468, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_469, __pyx_pybuffernd_F.diminfo[3].strides));

                            /* "openpiv/process.pyx":873
 *                                                     if neighbours_present[L,M]:
 *                                                         neighbours[0,L,M]=F[K-1,I+L-1,J+M-1,10]#u
 *                                                         neighbours[1,L,M]=F[K-1,I+L-1,J+M-1,11]#v             # <<<<<<<<<<<<<<
 *                                                     else:
 *                                                         neighbours[0,L,M]=0
 */
                            __pyx_t_473 = (__pyx_v_K - 1);
                            __pyx_t_474 = ((__pyx_v_I + __pyx_v_L) - 1);
                            __pyx_t_475 = ((__pyx_v_J + __pyx_v_M) - 1);
                            __pyx_t_476 = 11;
                            __pyx_t_465 = -1;
                            if (__pyx_t_473 < 0) {
                              __pyx_t_473 += __pyx_pybuffernd_F.diminfo[0].shape;
                              if (unlikely(__pyx_t_473 < 0)) __pyx_t_465 = 0;
                            } else if (unlikely(__pyx_t_473 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_465 = 0;
                            if (__pyx_t_474 < 0) {
                              __pyx_t_474 += __pyx_pybuffernd_F.diminfo[1].shape;
                              if (unlikely(__pyx_t_474 < 0)) __pyx_t_465 = 1;
                            } else if (unlikely(__pyx_t_474 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_465 = 1;
                            if (__pyx_t_475 < 0) {
                              __pyx_t_475 += __pyx_pybuffernd_F.diminfo[2].shape;
                              if (unlikely(__pyx_t_475 < 0)) __pyx_t_465 = 2;
                            } else if (unlikely(__pyx_t_475 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_465 = 2;
                            if (__pyx_t_476 < 0) {
                              __pyx_t_476 += __pyx_pybuffernd_F.diminfo[3].shape;
                              if (unlikely(__pyx_t_476 < 0)) __pyx_t_465 = 3;
                            } else if (unlikely(__pyx_t_476 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_465 = 3;
                            if (unlikely(__pyx_t_465 != -1)) {
                              __Pyx_RaiseBufferIndexError(__pyx_t_465);
                              __PYX_ERR(0, 873, __pyx_L1_error)
                            }
                            __pyx_t_477 = 1;
                            __pyx_t_478 = __pyx_v_L;
                            __pyx_t_479 = __pyx_v_M;
                            __pyx_t_465 = -1;
                            if (__pyx_t_477 < 0) {
                              __pyx_t_477 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                              if (unlikely(__pyx_t_477 < 0)) __pyx_t_465 = 0;
                            } else if (unlikely(__pyx_t_477 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_465 = 0;
                            if (__pyx_t_478 < 0) {
                              __pyx_t_478 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                              if (unlikely(__pyx_t_478 < 0)) __pyx_t_465 = 1;
                            } else if (unlikely(__pyx_t_478 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_465 = 1;
                            if (__pyx_t_479 < 0) {
                              __pyx_t_479 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                              if (unlikely(__pyx_t_479 < 0)) __pyx_t_465 = 2;
                            } else if (unlikely(__pyx_t_479 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_465 = 2;
                            if (unlikely(__pyx_t_465 != -1)) {
                              __Pyx_RaiseBufferIndexError(__pyx_t_465);
                              __PYX_ERR(0, 873, __pyx_L1_error)
                            }
                            *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_477, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_478, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_479, __pyx_pybuffernd_neighbours.diminfo[2].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_473, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_474, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_475, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_476, __pyx_pybuffernd_F.diminfo[3].strides));

                            /* "openpiv/process.pyx":871
 *                                             for L in range(3):
 *                                                 for M in range(3):
 *                                                     if neighbours_present[L,M]:             # <<<<<<<<<<<<<<
 *                                                         neighbours[0,L,M]=F[K-1,I+L-1,J+M-1,10]#u
 *                                                         neighbours[1,L,M]=F[K-1,I+L-1,J+M-1,11]#v
 */
                            goto __pyx_L87;
                          }

                          /* "openpiv/process.pyx":875
 *                                                         neighbours[1,L,M]=F[K-1,I+L-1,J+M-1,11]#v
 *                                                     else:
 *                                                         neighbours[0,L,M]=0             # <<<<<<<<<<<<<<
 *                                                         neighbours[1,L,M]=0
 *                                             if np.sum(neighbours_present) !=0:
 */
                          /*else*/ {
                            __pyx_t_480 = 0;
                            __pyx_t_481 = __pyx_v_L;
                            __pyx_t_482 = __pyx_v_M;
                            __pyx_t_465 = -1;
                            if (__pyx_t_480 < 0) {
                              __pyx_t_480 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                              if (unlikely(__pyx_t_480 < 0)) __pyx_t_465 = 0;
                            } else if (unlikely(__pyx_t_480 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_465 = 0;
                            if (__pyx_t_481 < 0) {
                              __pyx_t_481 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                              if (unlikely(__pyx_t_481 < 0)) __pyx_t_465 = 1;
                            } else if (unlikely(__pyx_t_481 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_465 = 1;
                            if (__pyx_t_482 < 0) {
                              __pyx_t_482 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                              if (unlikely(__pyx_t_482 < 0)) __pyx_t_465 = 2;
                            } else if (unlikely(__pyx_t_482 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_465 = 2;
                            if (unlikely(__pyx_t_465 != -1)) {
                              __Pyx_RaiseBufferIndexError(__pyx_t_465);
                              __PYX_ERR(0, 875, __pyx_L1_error)
                            }
                            *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_480, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_481, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_482, __pyx_pybuffernd_neighbours.diminfo[2].strides) = 0.0;

                            /* "openpiv/process.pyx":876
 *                                                     else:
 *                                                         neighbours[0,L,M]=0
 *                                                         neighbours[1,L,M]=0             # <<<<<<<<<<<<<<
 *                                             if np.sum(neighbours_present) !=0:
 *                                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))
 */
                            __pyx_t_483 = 1;
                            __pyx_t_484 = __pyx_v_L;
                            __pyx_t_485 = __pyx_v_M;
                            __pyx_t_465 = -1;
                            if (__pyx_t_483 < 0) {
                              __pyx_t_483 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
                              if (unlikely(__pyx_t_483 < 0)) __pyx_t_465 = 0;
                            } else if (unlikely(__pyx_t_483 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_465 = 0;
                            if (__pyx_t_484 < 0) {
                              __pyx_t_484 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
                              if (unlikely(__pyx_t_484 < 0)) __pyx_t_465 = 1;
                            } else if (unlikely(__pyx_t_484 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_465 = 1;
                            if (__pyx_t_485 < 0) {
                              __pyx_t_485 += __pyx_pybuffernd_neighbours.diminfo[2].shape;
                              if (unlikely(__pyx_t_485 < 0)) __pyx_t_465 = 2;
                            } else if (unlikely(__pyx_t_485 >= __pyx_pybuffernd_neighbours.diminfo[2].shape)) __pyx_t_465 = 2;
                            if (unlikely(__pyx_t_465 != -1)) {
                              __Pyx_RaiseBufferIndexError(__pyx_t_465);
                              __PYX_ERR(0, 876, __pyx_L1_error)
                            }
                            *__Pyx_BufPtrStrided3d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_483, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_484, __pyx_pybuffernd_neighbours.diminfo[1].strides, __pyx_t_485, __pyx_pybuffernd_neighbours.diminfo[2].strides) = 0.0;
                          }
                          __pyx_L87:;
                        }
                      }

                      /* "openpiv/process.pyx":877
 *                                                         neighbours[0,L,M]=0
 *                                                         neighbours[1,L,M]=0
 *                                             if np.sum(neighbours_present) !=0:             # <<<<<<<<<<<<<<
 *                                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))
 *                                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 */
                      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __pyx_t_5 = NULL;
                      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
                        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
                        if (likely(__pyx_t_5)) {
                          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                          __Pyx_INCREF(__pyx_t_5);
                          __Pyx_INCREF(function);
                          __Pyx_DECREF_SET(__pyx_t_4, function);
                        }
                      }
                      __pyx_t_33 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_neighbours_present));
                      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                      if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 877, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_33);
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_33, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                      __pyx_t_128 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_128 < 0)) __PYX_ERR(0, 877, __pyx_L1_error)
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      if (__pyx_t_128) {

                        /* "openpiv/process.pyx":878
 *                                                         neighbours[1,L,M]=0
 *                                             if np.sum(neighbours_present) !=0:
 *                                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))             # <<<<<<<<<<<<<<
 *                                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                                 F[K,I,J,10] = mean_u
 */
                        __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_5);
                        __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                        __pyx_t_33 = __Pyx_GetItemInt(((PyObject *)__pyx_v_neighbours), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        __pyx_t_2 = NULL;
                        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
                          if (likely(__pyx_t_2)) {
                            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                            __Pyx_INCREF(__pyx_t_2);
                            __Pyx_INCREF(function);
                            __Pyx_DECREF_SET(__pyx_t_5, function);
                          }
                        }
                        __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_33) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_33);
                        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_2);
                        __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_15);
                        __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_sum); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_34);
                        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                        __pyx_t_15 = NULL;
                        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) {
                          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_34);
                          if (likely(__pyx_t_15)) {
                            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
                            __Pyx_INCREF(__pyx_t_15);
                            __Pyx_INCREF(function);
                            __Pyx_DECREF_SET(__pyx_t_34, function);
                          }
                        }
                        __pyx_t_33 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_34, __pyx_t_15, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_34, ((PyObject *)__pyx_v_neighbours_present));
                        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                        if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                        __pyx_t_34 = NULL;
                        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                          __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_2);
                          if (likely(__pyx_t_34)) {
                            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                            __Pyx_INCREF(__pyx_t_34);
                            __Pyx_INCREF(function);
                            __Pyx_DECREF_SET(__pyx_t_2, function);
                          }
                        }
                        __pyx_t_5 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_34, __pyx_t_33) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_33);
                        __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
                        __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_5);
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_2);
                        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L1_error)
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __pyx_v_mean_u = __pyx_t_224;

                        /* "openpiv/process.pyx":879
 *                                             if np.sum(neighbours_present) !=0:
 *                                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))
 *                                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))             # <<<<<<<<<<<<<<
 *                                                 F[K,I,J,10] = mean_u
 *                                                 F[K,I,J,11] = mean_v
 */
                        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_5);
                        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_neighbours), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_5);
                        __pyx_t_33 = NULL;
                        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
                          __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_4);
                          if (likely(__pyx_t_33)) {
                            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                            __Pyx_INCREF(__pyx_t_33);
                            __Pyx_INCREF(function);
                            __Pyx_DECREF_SET(__pyx_t_4, function);
                          }
                        }
                        __pyx_t_2 = (__pyx_t_33) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_33, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
                        __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_2);
                        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_5);
                        __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_34);
                        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_sum); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_15);
                        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
                        __pyx_t_34 = NULL;
                        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
                          __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_15);
                          if (likely(__pyx_t_34)) {
                            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                            __Pyx_INCREF(__pyx_t_34);
                            __Pyx_INCREF(function);
                            __Pyx_DECREF_SET(__pyx_t_15, function);
                          }
                        }
                        __pyx_t_5 = (__pyx_t_34) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_34, ((PyObject *)__pyx_v_neighbours_present)) : __Pyx_PyObject_CallOneArg(__pyx_t_15, ((PyObject *)__pyx_v_neighbours_present));
                        __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
                        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_5);
                        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                        __pyx_t_15 = NULL;
                        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) {
                          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_33);
                          if (likely(__pyx_t_15)) {
                            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33);
                            __Pyx_INCREF(__pyx_t_15);
                            __Pyx_INCREF(function);
                            __Pyx_DECREF_SET(__pyx_t_33, function);
                          }
                        }
                        __pyx_t_4 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_33, __pyx_t_15, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_33, __pyx_t_5);
                        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_4);
                        __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                        __pyx_t_33 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                        __pyx_t_224 = __pyx_PyFloat_AsFloat(__pyx_t_33); if (unlikely((__pyx_t_224 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 879, __pyx_L1_error)
                        __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                        __pyx_v_mean_v = __pyx_t_224;

                        /* "openpiv/process.pyx":880
 *                                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))
 *                                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                                 F[K,I,J,10] = mean_u             # <<<<<<<<<<<<<<
 *                                                 F[K,I,J,11] = mean_v
 *                                                 (<object>mask)[I,J]=True
 */
                        __pyx_t_486 = __pyx_v_K;
                        __pyx_t_487 = __pyx_v_I;
                        __pyx_t_488 = __pyx_v_J;
                        __pyx_t_489 = 10;
                        __pyx_t_319 = -1;
                        if (__pyx_t_486 < 0) {
                          __pyx_t_486 += __pyx_pybuffernd_F.diminfo[0].shape;
                          if (unlikely(__pyx_t_486 < 0)) __pyx_t_319 = 0;
                        } else if (unlikely(__pyx_t_486 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                        if (__pyx_t_487 < 0) {
                          __pyx_t_487 += __pyx_pybuffernd_F.diminfo[1].shape;
                          if (unlikely(__pyx_t_487 < 0)) __pyx_t_319 = 1;
                        } else if (unlikely(__pyx_t_487 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                        if (__pyx_t_488 < 0) {
                          __pyx_t_488 += __pyx_pybuffernd_F.diminfo[2].shape;
                          if (unlikely(__pyx_t_488 < 0)) __pyx_t_319 = 2;
                        } else if (unlikely(__pyx_t_488 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                        if (__pyx_t_489 < 0) {
                          __pyx_t_489 += __pyx_pybuffernd_F.diminfo[3].shape;
                          if (unlikely(__pyx_t_489 < 0)) __pyx_t_319 = 3;
                        } else if (unlikely(__pyx_t_489 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                        if (unlikely(__pyx_t_319 != -1)) {
                          __Pyx_RaiseBufferIndexError(__pyx_t_319);
                          __PYX_ERR(0, 880, __pyx_L1_error)
                        }
                        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_486, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_487, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_488, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_489, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_u;

                        /* "openpiv/process.pyx":881
 *                                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 *                                                 F[K,I,J,10] = mean_u
 *                                                 F[K,I,J,11] = mean_v             # <<<<<<<<<<<<<<
 *                                                 (<object>mask)[I,J]=True
 *                                                 F[K,I,J,4] = -F[K,I,J,11]*dt
 */
                        __pyx_t_490 = __pyx_v_K;
                        __pyx_t_491 = __pyx_v_I;
                        __pyx_t_492 = __pyx_v_J;
                        __pyx_t_493 = 11;
                        __pyx_t_319 = -1;
                        if (__pyx_t_490 < 0) {
                          __pyx_t_490 += __pyx_pybuffernd_F.diminfo[0].shape;
                          if (unlikely(__pyx_t_490 < 0)) __pyx_t_319 = 0;
                        } else if (unlikely(__pyx_t_490 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                        if (__pyx_t_491 < 0) {
                          __pyx_t_491 += __pyx_pybuffernd_F.diminfo[1].shape;
                          if (unlikely(__pyx_t_491 < 0)) __pyx_t_319 = 1;
                        } else if (unlikely(__pyx_t_491 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                        if (__pyx_t_492 < 0) {
                          __pyx_t_492 += __pyx_pybuffernd_F.diminfo[2].shape;
                          if (unlikely(__pyx_t_492 < 0)) __pyx_t_319 = 2;
                        } else if (unlikely(__pyx_t_492 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                        if (__pyx_t_493 < 0) {
                          __pyx_t_493 += __pyx_pybuffernd_F.diminfo[3].shape;
                          if (unlikely(__pyx_t_493 < 0)) __pyx_t_319 = 3;
                        } else if (unlikely(__pyx_t_493 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                        if (unlikely(__pyx_t_319 != -1)) {
                          __Pyx_RaiseBufferIndexError(__pyx_t_319);
                          __PYX_ERR(0, 881, __pyx_L1_error)
                        }
                        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_490, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_491, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_492, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_493, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_v_mean_v;

                        /* "openpiv/process.pyx":882
 *                                                 F[K,I,J,10] = mean_u
 *                                                 F[K,I,J,11] = mean_v
 *                                                 (<object>mask)[I,J]=True             # <<<<<<<<<<<<<<
 *                                                 F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                                 F[K,I,J,5] = F[K,I,J,10]*dt
 */
                        __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 882, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_33);
                        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_4);
                        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
                        __Pyx_GOTREF(__pyx_t_2);
                        __Pyx_GIVEREF(__pyx_t_33);
                        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_33);
                        __Pyx_GIVEREF(__pyx_t_4);
                        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
                        __pyx_t_33 = 0;
                        __pyx_t_4 = 0;
                        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_mask), __pyx_t_2, Py_True) < 0)) __PYX_ERR(0, 882, __pyx_L1_error)
                        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                        /* "openpiv/process.pyx":883
 *                                                 F[K,I,J,11] = mean_v
 *                                                 (<object>mask)[I,J]=True
 *                                                 F[K,I,J,4] = -F[K,I,J,11]*dt             # <<<<<<<<<<<<<<
 *                                                 F[K,I,J,5] = F[K,I,J,10]*dt
 *             # pbar.finish()
 */
                        __pyx_t_494 = __pyx_v_K;
                        __pyx_t_495 = __pyx_v_I;
                        __pyx_t_496 = __pyx_v_J;
                        __pyx_t_497 = 11;
                        __pyx_t_319 = -1;
                        if (__pyx_t_494 < 0) {
                          __pyx_t_494 += __pyx_pybuffernd_F.diminfo[0].shape;
                          if (unlikely(__pyx_t_494 < 0)) __pyx_t_319 = 0;
                        } else if (unlikely(__pyx_t_494 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                        if (__pyx_t_495 < 0) {
                          __pyx_t_495 += __pyx_pybuffernd_F.diminfo[1].shape;
                          if (unlikely(__pyx_t_495 < 0)) __pyx_t_319 = 1;
                        } else if (unlikely(__pyx_t_495 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                        if (__pyx_t_496 < 0) {
                          __pyx_t_496 += __pyx_pybuffernd_F.diminfo[2].shape;
                          if (unlikely(__pyx_t_496 < 0)) __pyx_t_319 = 2;
                        } else if (unlikely(__pyx_t_496 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                        if (__pyx_t_497 < 0) {
                          __pyx_t_497 += __pyx_pybuffernd_F.diminfo[3].shape;
                          if (unlikely(__pyx_t_497 < 0)) __pyx_t_319 = 3;
                        } else if (unlikely(__pyx_t_497 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                        if (unlikely(__pyx_t_319 != -1)) {
                          __Pyx_RaiseBufferIndexError(__pyx_t_319);
                          __PYX_ERR(0, 883, __pyx_L1_error)
                        }
                        __pyx_t_498 = __pyx_v_K;
                        __pyx_t_499 = __pyx_v_I;
                        __pyx_t_500 = __pyx_v_J;
                        __pyx_t_501 = 4;
                        __pyx_t_319 = -1;
                        if (__pyx_t_498 < 0) {
                          __pyx_t_498 += __pyx_pybuffernd_F.diminfo[0].shape;
                          if (unlikely(__pyx_t_498 < 0)) __pyx_t_319 = 0;
                        } else if (unlikely(__pyx_t_498 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                        if (__pyx_t_499 < 0) {
                          __pyx_t_499 += __pyx_pybuffernd_F.diminfo[1].shape;
                          if (unlikely(__pyx_t_499 < 0)) __pyx_t_319 = 1;
                        } else if (unlikely(__pyx_t_499 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                        if (__pyx_t_500 < 0) {
                          __pyx_t_500 += __pyx_pybuffernd_F.diminfo[2].shape;
                          if (unlikely(__pyx_t_500 < 0)) __pyx_t_319 = 2;
                        } else if (unlikely(__pyx_t_500 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                        if (__pyx_t_501 < 0) {
                          __pyx_t_501 += __pyx_pybuffernd_F.diminfo[3].shape;
                          if (unlikely(__pyx_t_501 < 0)) __pyx_t_319 = 3;
                        } else if (unlikely(__pyx_t_501 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                        if (unlikely(__pyx_t_319 != -1)) {
                          __Pyx_RaiseBufferIndexError(__pyx_t_319);
                          __PYX_ERR(0, 883, __pyx_L1_error)
                        }
                        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_498, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_499, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_500, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_501, __pyx_pybuffernd_F.diminfo[3].strides) = ((-(*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_494, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_495, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_496, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_497, __pyx_pybuffernd_F.diminfo[3].strides))) * __pyx_v_dt);

                        /* "openpiv/process.pyx":884
 *                                                 (<object>mask)[I,J]=True
 *                                                 F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                                 F[K,I,J,5] = F[K,I,J,10]*dt             # <<<<<<<<<<<<<<
 *             # pbar.finish()
 *             print("..[DONE]")
 */
                        __pyx_t_502 = __pyx_v_K;
                        __pyx_t_503 = __pyx_v_I;
                        __pyx_t_504 = __pyx_v_J;
                        __pyx_t_505 = 10;
                        __pyx_t_319 = -1;
                        if (__pyx_t_502 < 0) {
                          __pyx_t_502 += __pyx_pybuffernd_F.diminfo[0].shape;
                          if (unlikely(__pyx_t_502 < 0)) __pyx_t_319 = 0;
                        } else if (unlikely(__pyx_t_502 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                        if (__pyx_t_503 < 0) {
                          __pyx_t_503 += __pyx_pybuffernd_F.diminfo[1].shape;
                          if (unlikely(__pyx_t_503 < 0)) __pyx_t_319 = 1;
                        } else if (unlikely(__pyx_t_503 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                        if (__pyx_t_504 < 0) {
                          __pyx_t_504 += __pyx_pybuffernd_F.diminfo[2].shape;
                          if (unlikely(__pyx_t_504 < 0)) __pyx_t_319 = 2;
                        } else if (unlikely(__pyx_t_504 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                        if (__pyx_t_505 < 0) {
                          __pyx_t_505 += __pyx_pybuffernd_F.diminfo[3].shape;
                          if (unlikely(__pyx_t_505 < 0)) __pyx_t_319 = 3;
                        } else if (unlikely(__pyx_t_505 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                        if (unlikely(__pyx_t_319 != -1)) {
                          __Pyx_RaiseBufferIndexError(__pyx_t_319);
                          __PYX_ERR(0, 884, __pyx_L1_error)
                        }
                        __pyx_t_506 = __pyx_v_K;
                        __pyx_t_507 = __pyx_v_I;
                        __pyx_t_508 = __pyx_v_J;
                        __pyx_t_509 = 5;
                        __pyx_t_319 = -1;
                        if (__pyx_t_506 < 0) {
                          __pyx_t_506 += __pyx_pybuffernd_F.diminfo[0].shape;
                          if (unlikely(__pyx_t_506 < 0)) __pyx_t_319 = 0;
                        } else if (unlikely(__pyx_t_506 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_319 = 0;
                        if (__pyx_t_507 < 0) {
                          __pyx_t_507 += __pyx_pybuffernd_F.diminfo[1].shape;
                          if (unlikely(__pyx_t_507 < 0)) __pyx_t_319 = 1;
                        } else if (unlikely(__pyx_t_507 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_319 = 1;
                        if (__pyx_t_508 < 0) {
                          __pyx_t_508 += __pyx_pybuffernd_F.diminfo[2].shape;
                          if (unlikely(__pyx_t_508 < 0)) __pyx_t_319 = 2;
                        } else if (unlikely(__pyx_t_508 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_319 = 2;
                        if (__pyx_t_509 < 0) {
                          __pyx_t_509 += __pyx_pybuffernd_F.diminfo[3].shape;
                          if (unlikely(__pyx_t_509 < 0)) __pyx_t_319 = 3;
                        } else if (unlikely(__pyx_t_509 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_319 = 3;
                        if (unlikely(__pyx_t_319 != -1)) {
                          __Pyx_RaiseBufferIndexError(__pyx_t_319);
                          __PYX_ERR(0, 884, __pyx_L1_error)
                        }
                        *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_506, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_507, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_508, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_509, __pyx_pybuffernd_F.diminfo[3].strides) = ((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_502, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_503, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_504, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_505, __pyx_pybuffernd_F.diminfo[3].strides)) * __pyx_v_dt);

                        /* "openpiv/process.pyx":877
 *                                                         neighbours[0,L,M]=0
 *                                                         neighbours[1,L,M]=0
 *                                             if np.sum(neighbours_present) !=0:             # <<<<<<<<<<<<<<
 *                                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))
 *                                                 mean_v = np.sum(neighbours[1])/np.float(np.sum(neighbours_present))
 */
                      }

                      /* "openpiv/process.pyx":868
 *                                             F[K,I,J,4] = -F[K,I,J,11]*dt
 *                                             F[K,I,J,5] = F[K,I,J,10]*dt
 *                                         elif K>0 and (Nrow[K] == Nrow[K-1] or Ncol[K] == Ncol[K-1]):#case if same dimensions             # <<<<<<<<<<<<<<
 *                                             for L in range(3):
 *                                                 for M in range(3):
 */
                    }
                    __pyx_L76:;

                    /* "openpiv/process.pyx":855
 *                                             F[K,I,J,10] = mean_u
 *                                             F[K,I,J,11] = mean_v
 *                                     elif ((F[K,I,J,10] - mean_u)/rms_u) > tolerance or ((F[K,I,J,11] - mean_v)/rms_v) > tolerance:             # <<<<<<<<<<<<<<
 *                                         if K==0:
 *                                             F[K,I,J,10] = mean_u
 */
                  }
                  __pyx_L71:;

                  /* "openpiv/process.pyx":849
 *                                         F[K,I,J,10] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 10)
 *                                         F[K,I,J,11] = interpolate_surroundings(F,Nrow,Ncol,K-1,I,J, 11)
 *                                 if validation_method=='mean_velocity':#add a validation with the mean and rms values             # <<<<<<<<<<<<<<
 *                                     rms_u = np.sqrt(sumsquare_array(neighbours[0])/np.float(np.sum(neighbours_present)))#get rms of u
 *                                     rms_v = np.sqrt(sumsquare_array(neighbours[1])/np.float(np.sum(neighbours_present)))
 */
                }

                /* "openpiv/process.pyx":835
 *                                     neighbours[1,L,M]=0
 * 
 *                             if np.sum(neighbours_present) !=0 and mark[np.int(F[K,I,J,0]), np.int(F[K,I,J,1])] == 1:             # <<<<<<<<<<<<<<
 *                             #if np.sum(neighbours_present):
 *                                 mean_u = np.sum(neighbours[0])/np.float(np.sum(neighbours_present))#computing the mean velocity
 */
              }
            }
          }
        }
      }

      /* "openpiv/process.pyx":886
 *                                                 F[K,I,J,5] = F[K,I,J,10]*dt
 *             # pbar.finish()
 *             print("..[DONE]")             # <<<<<<<<<<<<<<
 *             print(" ")
 *         #end of validation
 */
      if (__Pyx_PrintOne(0, __pyx_kp_s_DONE) < 0) __PYX_ERR(0, 886, __pyx_L1_error)

      /* "openpiv/process.pyx":887
 *             # pbar.finish()
 *             print("..[DONE]")
 *             print(" ")             # <<<<<<<<<<<<<<
 *         #end of validation
 *         ##############################################################################
 */
      if (__Pyx_PrintOne(0, __pyx_kp_s__11) < 0) __PYX_ERR(0, 887, __pyx_L1_error)
    }
    __pyx_L44:;

    /* "openpiv/process.pyx":891
 *         ##############################################################################
 *         #stop process if this is the last iteration
 *         if K==nb_iter_max-1:             # <<<<<<<<<<<<<<
 *             print("//////////////////////////////////////////////////////////////////")
 *             print("end of iterative process.. Re-arranging vector fields..")
 */
    __pyx_t_128 = ((__pyx_v_K == (__pyx_v_nb_iter_max - 1)) != 0);
    if (__pyx_t_128) {

      /* "openpiv/process.pyx":892
 *         #stop process if this is the last iteration
 *         if K==nb_iter_max-1:
 *             print("//////////////////////////////////////////////////////////////////")             # <<<<<<<<<<<<<<
 *             print("end of iterative process.. Re-arranging vector fields..")
 *             for I in range(Nrow[K]):#assembling the u,v and x,y fields for outputs
 */
      if (__Pyx_PrintOne(0, __pyx_kp_s__12) < 0) __PYX_ERR(0, 892, __pyx_L1_error)

      /* "openpiv/process.pyx":893
 *         if K==nb_iter_max-1:
 *             print("//////////////////////////////////////////////////////////////////")
 *             print("end of iterative process.. Re-arranging vector fields..")             # <<<<<<<<<<<<<<
 *             for I in range(Nrow[K]):#assembling the u,v and x,y fields for outputs
 *                 for J in range(Ncol[K]):
 */
      if (__Pyx_PrintOne(0, __pyx_kp_s_end_of_iterative_process_Re_arra) < 0) __PYX_ERR(0, 893, __pyx_L1_error)

      /* "openpiv/process.pyx":894
 *             print("//////////////////////////////////////////////////////////////////")
 *             print("end of iterative process.. Re-arranging vector fields..")
 *             for I in range(Nrow[K]):#assembling the u,v and x,y fields for outputs             # <<<<<<<<<<<<<<
 *                 for J in range(Ncol[K]):
 *                     x[I,J]=F[K,I,J,1]
 */
      __pyx_t_510 = __pyx_v_K;
      __pyx_t_20 = -1;
      if (__pyx_t_510 < 0) {
        __pyx_t_510 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
        if (unlikely(__pyx_t_510 < 0)) __pyx_t_20 = 0;
      } else if (unlikely(__pyx_t_510 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
      if (unlikely(__pyx_t_20 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_20);
        __PYX_ERR(0, 894, __pyx_L1_error)
      }
      __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_510, __pyx_pybuffernd_Nrow.diminfo[0].strides));
      __pyx_t_27 = __pyx_t_16;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_27; __pyx_t_20+=1) {
        __pyx_v_I = __pyx_t_20;

        /* "openpiv/process.pyx":895
 *             print("end of iterative process.. Re-arranging vector fields..")
 *             for I in range(Nrow[K]):#assembling the u,v and x,y fields for outputs
 *                 for J in range(Ncol[K]):             # <<<<<<<<<<<<<<
 *                     x[I,J]=F[K,I,J,1]
 *                     y[I,J]=F[K,Nrow[K]-I-1,J,0]
 */
        __pyx_t_511 = __pyx_v_K;
        __pyx_t_60 = -1;
        if (__pyx_t_511 < 0) {
          __pyx_t_511 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
          if (unlikely(__pyx_t_511 < 0)) __pyx_t_60 = 0;
        } else if (unlikely(__pyx_t_511 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_60 = 0;
        if (unlikely(__pyx_t_60 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_60);
          __PYX_ERR(0, 895, __pyx_L1_error)
        }
        __pyx_t_61 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_511, __pyx_pybuffernd_Ncol.diminfo[0].strides));
        __pyx_t_62 = __pyx_t_61;
        for (__pyx_t_60 = 0; __pyx_t_60 < __pyx_t_62; __pyx_t_60+=1) {
          __pyx_v_J = __pyx_t_60;

          /* "openpiv/process.pyx":896
 *             for I in range(Nrow[K]):#assembling the u,v and x,y fields for outputs
 *                 for J in range(Ncol[K]):
 *                     x[I,J]=F[K,I,J,1]             # <<<<<<<<<<<<<<
 *                     y[I,J]=F[K,Nrow[K]-I-1,J,0]
 *                     u[I,J]=F[K,I,J,10]
 */
          __pyx_t_512 = __pyx_v_K;
          __pyx_t_513 = __pyx_v_I;
          __pyx_t_514 = __pyx_v_J;
          __pyx_t_515 = 1;
          __pyx_t_64 = -1;
          if (__pyx_t_512 < 0) {
            __pyx_t_512 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_512 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_512 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_513 < 0) {
            __pyx_t_513 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_513 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_513 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_514 < 0) {
            __pyx_t_514 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_514 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_514 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_515 < 0) {
            __pyx_t_515 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_515 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_515 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 896, __pyx_L1_error)
          }
          __pyx_t_516 = __pyx_v_I;
          __pyx_t_517 = __pyx_v_J;
          __pyx_t_64 = -1;
          if (__pyx_t_516 < 0) {
            __pyx_t_516 += __pyx_pybuffernd_x.diminfo[0].shape;
            if (unlikely(__pyx_t_516 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_516 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_517 < 0) {
            __pyx_t_517 += __pyx_pybuffernd_x.diminfo[1].shape;
            if (unlikely(__pyx_t_517 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_517 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_64 = 1;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 896, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_516, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_517, __pyx_pybuffernd_x.diminfo[1].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_512, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_513, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_514, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_515, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":897
 *                 for J in range(Ncol[K]):
 *                     x[I,J]=F[K,I,J,1]
 *                     y[I,J]=F[K,Nrow[K]-I-1,J,0]             # <<<<<<<<<<<<<<
 *                     u[I,J]=F[K,I,J,10]
 *                     v[I,J]=F[K,I,J,11]
 */
          __pyx_t_518 = __pyx_v_K;
          __pyx_t_64 = -1;
          if (__pyx_t_518 < 0) {
            __pyx_t_518 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
            if (unlikely(__pyx_t_518 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_518 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_64 = 0;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 897, __pyx_L1_error)
          }
          __pyx_t_519 = __pyx_v_K;
          __pyx_t_520 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_518, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - __pyx_v_I) - 1);
          __pyx_t_521 = __pyx_v_J;
          __pyx_t_522 = 0;
          __pyx_t_64 = -1;
          if (__pyx_t_519 < 0) {
            __pyx_t_519 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_519 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_519 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_520 < 0) {
            __pyx_t_520 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_520 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_520 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_521 < 0) {
            __pyx_t_521 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_521 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_521 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_522 < 0) {
            __pyx_t_522 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_522 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_522 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 897, __pyx_L1_error)
          }
          __pyx_t_523 = __pyx_v_I;
          __pyx_t_524 = __pyx_v_J;
          __pyx_t_64 = -1;
          if (__pyx_t_523 < 0) {
            __pyx_t_523 += __pyx_pybuffernd_y.diminfo[0].shape;
            if (unlikely(__pyx_t_523 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_523 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_524 < 0) {
            __pyx_t_524 += __pyx_pybuffernd_y.diminfo[1].shape;
            if (unlikely(__pyx_t_524 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_524 >= __pyx_pybuffernd_y.diminfo[1].shape)) __pyx_t_64 = 1;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 897, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_523, __pyx_pybuffernd_y.diminfo[0].strides, __pyx_t_524, __pyx_pybuffernd_y.diminfo[1].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_519, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_520, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_521, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_522, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":898
 *                     x[I,J]=F[K,I,J,1]
 *                     y[I,J]=F[K,Nrow[K]-I-1,J,0]
 *                     u[I,J]=F[K,I,J,10]             # <<<<<<<<<<<<<<
 *                     v[I,J]=F[K,I,J,11]
 *             print("...[DONE]")
 */
          __pyx_t_525 = __pyx_v_K;
          __pyx_t_526 = __pyx_v_I;
          __pyx_t_527 = __pyx_v_J;
          __pyx_t_528 = 10;
          __pyx_t_64 = -1;
          if (__pyx_t_525 < 0) {
            __pyx_t_525 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_525 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_525 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_526 < 0) {
            __pyx_t_526 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_526 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_526 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_527 < 0) {
            __pyx_t_527 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_527 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_527 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_528 < 0) {
            __pyx_t_528 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_528 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_528 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 898, __pyx_L1_error)
          }
          __pyx_t_529 = __pyx_v_I;
          __pyx_t_530 = __pyx_v_J;
          __pyx_t_64 = -1;
          if (__pyx_t_529 < 0) {
            __pyx_t_529 += __pyx_pybuffernd_u.diminfo[0].shape;
            if (unlikely(__pyx_t_529 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_529 >= __pyx_pybuffernd_u.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_530 < 0) {
            __pyx_t_530 += __pyx_pybuffernd_u.diminfo[1].shape;
            if (unlikely(__pyx_t_530 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_530 >= __pyx_pybuffernd_u.diminfo[1].shape)) __pyx_t_64 = 1;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 898, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_u.rcbuffer->pybuffer.buf, __pyx_t_529, __pyx_pybuffernd_u.diminfo[0].strides, __pyx_t_530, __pyx_pybuffernd_u.diminfo[1].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_525, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_526, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_527, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_528, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":899
 *                     y[I,J]=F[K,Nrow[K]-I-1,J,0]
 *                     u[I,J]=F[K,I,J,10]
 *                     v[I,J]=F[K,I,J,11]             # <<<<<<<<<<<<<<
 *             print("...[DONE]")
 *             end(startTime)
 */
          __pyx_t_531 = __pyx_v_K;
          __pyx_t_532 = __pyx_v_I;
          __pyx_t_533 = __pyx_v_J;
          __pyx_t_534 = 11;
          __pyx_t_64 = -1;
          if (__pyx_t_531 < 0) {
            __pyx_t_531 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_531 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_531 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_532 < 0) {
            __pyx_t_532 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_532 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_532 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_533 < 0) {
            __pyx_t_533 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_533 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_533 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_534 < 0) {
            __pyx_t_534 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_534 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_534 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 899, __pyx_L1_error)
          }
          __pyx_t_535 = __pyx_v_I;
          __pyx_t_536 = __pyx_v_J;
          __pyx_t_64 = -1;
          if (__pyx_t_535 < 0) {
            __pyx_t_535 += __pyx_pybuffernd_v.diminfo[0].shape;
            if (unlikely(__pyx_t_535 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_535 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_536 < 0) {
            __pyx_t_536 += __pyx_pybuffernd_v.diminfo[1].shape;
            if (unlikely(__pyx_t_536 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_536 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_64 = 1;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 899, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_535, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_536, __pyx_pybuffernd_v.diminfo[1].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_531, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_532, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_533, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_534, __pyx_pybuffernd_F.diminfo[3].strides));
        }
      }

      /* "openpiv/process.pyx":900
 *                     u[I,J]=F[K,I,J,10]
 *                     v[I,J]=F[K,I,J,11]
 *             print("...[DONE]")             # <<<<<<<<<<<<<<
 *             end(startTime)
 *             return x, y, u, v, (<object>mask)
 */
      if (__Pyx_PrintOne(0, __pyx_kp_s_DONE_2) < 0) __PYX_ERR(0, 900, __pyx_L1_error)

      /* "openpiv/process.pyx":901
 *                     v[I,J]=F[K,I,J,11]
 *             print("...[DONE]")
 *             end(startTime)             # <<<<<<<<<<<<<<
 *             return x, y, u, v, (<object>mask)
 *         #############################################################################
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_33 = PyFloat_FromDouble(__pyx_v_startTime); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_33);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_33) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_33);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "openpiv/process.pyx":902
 *             print("...[DONE]")
 *             end(startTime)
 *             return x, y, u, v, (<object>mask)             # <<<<<<<<<<<<<<
 *         #############################################################################
 *         #go to next iteration : compute the predictors dpx and dpy from the current displacements
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_x));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_x));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_x));
      __Pyx_INCREF(((PyObject *)__pyx_v_y));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_y));
      PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_y));
      __Pyx_INCREF(((PyObject *)__pyx_v_u));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_u));
      PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_u));
      __Pyx_INCREF(((PyObject *)__pyx_v_v));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
      PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_v));
      __Pyx_INCREF(((PyObject *)__pyx_v_mask));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_mask));
      PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_v_mask));
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":891
 *         ##############################################################################
 *         #stop process if this is the last iteration
 *         if K==nb_iter_max-1:             # <<<<<<<<<<<<<<
 *             print("//////////////////////////////////////////////////////////////////")
 *             print("end of iterative process.. Re-arranging vector fields..")
 */
    }

    /* "openpiv/process.pyx":905
 *         #############################################################################
 *         #go to next iteration : compute the predictors dpx and dpy from the current displacements
 *         print("going to next iteration.. ")             # <<<<<<<<<<<<<<
 *         print("performing interpolation of the displacement field")
 *         print(" ")
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_going_to_next_iteration) < 0) __PYX_ERR(0, 905, __pyx_L1_error)

    /* "openpiv/process.pyx":906
 *         #go to next iteration : compute the predictors dpx and dpy from the current displacements
 *         print("going to next iteration.. ")
 *         print("performing interpolation of the displacement field")             # <<<<<<<<<<<<<<
 *         print(" ")
 *         # widgets = ['Performing interpolations : ', Percentage(), ' ', Bar(marker='-',left='[',right=']'),
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_performing_interpolation_of_the) < 0) __PYX_ERR(0, 906, __pyx_L1_error)

    /* "openpiv/process.pyx":907
 *         print("going to next iteration.. ")
 *         print("performing interpolation of the displacement field")
 *         print(" ")             # <<<<<<<<<<<<<<
 *         # widgets = ['Performing interpolations : ', Percentage(), ' ', Bar(marker='-',left='[',right=']'),
 *         #    ' ', ETA(), ' ', FileTransferSpeed()]
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s__11) < 0) __PYX_ERR(0, 907, __pyx_L1_error)

    /* "openpiv/process.pyx":912
 *         # pbar = ProgressBar(widgets=widgets, maxval=100)
 *         # pbar.start()
 *         for I in range(Nrow[K+1]):             # <<<<<<<<<<<<<<
 *             # pbar.update(100*I/Nrow[K+1])
 *             for J in range(Ncol[K+1]):
 */
    __pyx_t_537 = (__pyx_v_K + 1);
    __pyx_t_20 = -1;
    if (__pyx_t_537 < 0) {
      __pyx_t_537 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
      if (unlikely(__pyx_t_537 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_537 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      __PYX_ERR(0, 912, __pyx_L1_error)
    }
    __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_537, __pyx_pybuffernd_Nrow.diminfo[0].strides));
    __pyx_t_27 = __pyx_t_16;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_27; __pyx_t_20+=1) {
      __pyx_v_I = __pyx_t_20;

      /* "openpiv/process.pyx":914
 *         for I in range(Nrow[K+1]):
 *             # pbar.update(100*I/Nrow[K+1])
 *             for J in range(Ncol[K+1]):             # <<<<<<<<<<<<<<
 *                 if Nrow[K+1]==Nrow[K] and Ncol[K+1]==Ncol[K]:
 *                     F[K+1,I,J,6] = F[K,I,J,4]#dpx_k+1 = dx_k
 */
      __pyx_t_538 = (__pyx_v_K + 1);
      __pyx_t_60 = -1;
      if (__pyx_t_538 < 0) {
        __pyx_t_538 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_538 < 0)) __pyx_t_60 = 0;
      } else if (unlikely(__pyx_t_538 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_60 = 0;
      if (unlikely(__pyx_t_60 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_60);
        __PYX_ERR(0, 914, __pyx_L1_error)
      }
      __pyx_t_61 = (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_538, __pyx_pybuffernd_Ncol.diminfo[0].strides));
      __pyx_t_62 = __pyx_t_61;
      for (__pyx_t_60 = 0; __pyx_t_60 < __pyx_t_62; __pyx_t_60+=1) {
        __pyx_v_J = __pyx_t_60;

        /* "openpiv/process.pyx":915
 *             # pbar.update(100*I/Nrow[K+1])
 *             for J in range(Ncol[K+1]):
 *                 if Nrow[K+1]==Nrow[K] and Ncol[K+1]==Ncol[K]:             # <<<<<<<<<<<<<<
 *                     F[K+1,I,J,6] = F[K,I,J,4]#dpx_k+1 = dx_k
 *                     F[K+1,I,J,7] = F[K,I,J,5]#dpy_k+1 = dy_k
 */
        __pyx_t_539 = (__pyx_v_K + 1);
        __pyx_t_64 = -1;
        if (__pyx_t_539 < 0) {
          __pyx_t_539 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
          if (unlikely(__pyx_t_539 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_539 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 915, __pyx_L1_error)
        }
        __pyx_t_540 = __pyx_v_K;
        __pyx_t_64 = -1;
        if (__pyx_t_540 < 0) {
          __pyx_t_540 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
          if (unlikely(__pyx_t_540 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_540 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 915, __pyx_L1_error)
        }
        __pyx_t_1 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_539, __pyx_pybuffernd_Nrow.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_540, __pyx_pybuffernd_Nrow.diminfo[0].strides))) != 0);
        if (__pyx_t_1) {
        } else {
          __pyx_t_128 = __pyx_t_1;
          goto __pyx_L99_bool_binop_done;
        }
        __pyx_t_541 = (__pyx_v_K + 1);
        __pyx_t_64 = -1;
        if (__pyx_t_541 < 0) {
          __pyx_t_541 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
          if (unlikely(__pyx_t_541 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_541 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 915, __pyx_L1_error)
        }
        __pyx_t_542 = __pyx_v_K;
        __pyx_t_64 = -1;
        if (__pyx_t_542 < 0) {
          __pyx_t_542 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
          if (unlikely(__pyx_t_542 < 0)) __pyx_t_64 = 0;
        } else if (unlikely(__pyx_t_542 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_64 = 0;
        if (unlikely(__pyx_t_64 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_64);
          __PYX_ERR(0, 915, __pyx_L1_error)
        }
        __pyx_t_1 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_541, __pyx_pybuffernd_Ncol.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_542, __pyx_pybuffernd_Ncol.diminfo[0].strides))) != 0);
        __pyx_t_128 = __pyx_t_1;
        __pyx_L99_bool_binop_done:;
        if (__pyx_t_128) {

          /* "openpiv/process.pyx":916
 *             for J in range(Ncol[K+1]):
 *                 if Nrow[K+1]==Nrow[K] and Ncol[K+1]==Ncol[K]:
 *                     F[K+1,I,J,6] = F[K,I,J,4]#dpx_k+1 = dx_k             # <<<<<<<<<<<<<<
 *                     F[K+1,I,J,7] = F[K,I,J,5]#dpy_k+1 = dy_k
 *                 else:#interpolate if dimensions do not agree
 */
          __pyx_t_543 = __pyx_v_K;
          __pyx_t_544 = __pyx_v_I;
          __pyx_t_545 = __pyx_v_J;
          __pyx_t_546 = 4;
          __pyx_t_64 = -1;
          if (__pyx_t_543 < 0) {
            __pyx_t_543 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_543 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_543 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_544 < 0) {
            __pyx_t_544 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_544 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_544 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_545 < 0) {
            __pyx_t_545 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_545 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_545 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_546 < 0) {
            __pyx_t_546 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_546 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_546 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 916, __pyx_L1_error)
          }
          __pyx_t_547 = (__pyx_v_K + 1);
          __pyx_t_548 = __pyx_v_I;
          __pyx_t_549 = __pyx_v_J;
          __pyx_t_550 = 6;
          __pyx_t_64 = -1;
          if (__pyx_t_547 < 0) {
            __pyx_t_547 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_547 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_547 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_548 < 0) {
            __pyx_t_548 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_548 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_548 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_549 < 0) {
            __pyx_t_549 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_549 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_549 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_550 < 0) {
            __pyx_t_550 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_550 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_550 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 916, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_547, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_548, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_549, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_550, __pyx_pybuffernd_F.diminfo[3].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_543, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_544, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_545, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_546, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":917
 *                 if Nrow[K+1]==Nrow[K] and Ncol[K+1]==Ncol[K]:
 *                     F[K+1,I,J,6] = F[K,I,J,4]#dpx_k+1 = dx_k
 *                     F[K+1,I,J,7] = F[K,I,J,5]#dpy_k+1 = dy_k             # <<<<<<<<<<<<<<
 *                 else:#interpolate if dimensions do not agree
 *                     F[K+1,I,J,6] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 4)
 */
          __pyx_t_551 = __pyx_v_K;
          __pyx_t_552 = __pyx_v_I;
          __pyx_t_553 = __pyx_v_J;
          __pyx_t_554 = 5;
          __pyx_t_64 = -1;
          if (__pyx_t_551 < 0) {
            __pyx_t_551 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_551 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_551 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_552 < 0) {
            __pyx_t_552 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_552 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_552 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_553 < 0) {
            __pyx_t_553 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_553 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_553 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_554 < 0) {
            __pyx_t_554 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_554 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_554 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 917, __pyx_L1_error)
          }
          __pyx_t_555 = (__pyx_v_K + 1);
          __pyx_t_556 = __pyx_v_I;
          __pyx_t_557 = __pyx_v_J;
          __pyx_t_558 = 7;
          __pyx_t_64 = -1;
          if (__pyx_t_555 < 0) {
            __pyx_t_555 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_555 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_555 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_556 < 0) {
            __pyx_t_556 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_556 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_556 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_557 < 0) {
            __pyx_t_557 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_557 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_557 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_558 < 0) {
            __pyx_t_558 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_558 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_558 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 917, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_555, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_556, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_557, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_558, __pyx_pybuffernd_F.diminfo[3].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_551, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_552, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_553, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_554, __pyx_pybuffernd_F.diminfo[3].strides));

          /* "openpiv/process.pyx":915
 *             # pbar.update(100*I/Nrow[K+1])
 *             for J in range(Ncol[K+1]):
 *                 if Nrow[K+1]==Nrow[K] and Ncol[K+1]==Ncol[K]:             # <<<<<<<<<<<<<<
 *                     F[K+1,I,J,6] = F[K,I,J,4]#dpx_k+1 = dx_k
 *                     F[K+1,I,J,7] = F[K,I,J,5]#dpy_k+1 = dy_k
 */
          goto __pyx_L98;
        }

        /* "openpiv/process.pyx":919
 *                     F[K+1,I,J,7] = F[K,I,J,5]#dpy_k+1 = dy_k
 *                 else:#interpolate if dimensions do not agree
 *                     F[K+1,I,J,6] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 4)             # <<<<<<<<<<<<<<
 *                     F[K+1,I,J,7] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 5)
 *         # pbar.finish()
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_interpolate_surroundings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 919, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 919, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_34 = NULL;
          __pyx_t_64 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_34)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_34);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_64 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[8] = {__pyx_t_34, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_33, __pyx_t_5, __pyx_t_15, __pyx_int_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_64, 7+__pyx_t_64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[8] = {__pyx_t_34, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_33, __pyx_t_5, __pyx_t_15, __pyx_int_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_64, 7+__pyx_t_64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          } else
          #endif
          {
            __pyx_t_36 = PyTuple_New(7+__pyx_t_64); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 919, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_36);
            if (__pyx_t_34) {
              __Pyx_GIVEREF(__pyx_t_34); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_34); __pyx_t_34 = NULL;
            }
            __Pyx_INCREF(((PyObject *)__pyx_v_F));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
            PyTuple_SET_ITEM(__pyx_t_36, 0+__pyx_t_64, ((PyObject *)__pyx_v_F));
            __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
            PyTuple_SET_ITEM(__pyx_t_36, 1+__pyx_t_64, ((PyObject *)__pyx_v_Nrow));
            __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
            PyTuple_SET_ITEM(__pyx_t_36, 2+__pyx_t_64, ((PyObject *)__pyx_v_Ncol));
            __Pyx_GIVEREF(__pyx_t_33);
            PyTuple_SET_ITEM(__pyx_t_36, 3+__pyx_t_64, __pyx_t_33);
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_36, 4+__pyx_t_64, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_15);
            PyTuple_SET_ITEM(__pyx_t_36, 5+__pyx_t_64, __pyx_t_15);
            __Pyx_INCREF(__pyx_int_4);
            __Pyx_GIVEREF(__pyx_int_4);
            PyTuple_SET_ITEM(__pyx_t_36, 6+__pyx_t_64, __pyx_int_4);
            __pyx_t_33 = 0;
            __pyx_t_5 = 0;
            __pyx_t_15 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 919, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_559 = (__pyx_v_K + 1);
          __pyx_t_560 = __pyx_v_I;
          __pyx_t_561 = __pyx_v_J;
          __pyx_t_562 = 6;
          __pyx_t_64 = -1;
          if (__pyx_t_559 < 0) {
            __pyx_t_559 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_559 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_559 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_560 < 0) {
            __pyx_t_560 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_560 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_560 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_561 < 0) {
            __pyx_t_561 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_561 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_561 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_562 < 0) {
            __pyx_t_562 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_562 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_562 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 919, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_559, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_560, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_561, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_562, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;

          /* "openpiv/process.pyx":920
 *                 else:#interpolate if dimensions do not agree
 *                     F[K+1,I,J,6] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 4)
 *                     F[K+1,I,J,7] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 5)             # <<<<<<<<<<<<<<
 *         # pbar.finish()
 *         print("..[DONE] -----> going to iteration ",K+1)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_interpolate_surroundings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_J); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_33 = NULL;
          __pyx_t_64 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_33)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_33);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_64 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[8] = {__pyx_t_33, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_36, __pyx_t_15, __pyx_t_5, __pyx_int_5};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_64, 7+__pyx_t_64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[8] = {__pyx_t_33, ((PyObject *)__pyx_v_F), ((PyObject *)__pyx_v_Nrow), ((PyObject *)__pyx_v_Ncol), __pyx_t_36, __pyx_t_15, __pyx_t_5, __pyx_int_5};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_64, 7+__pyx_t_64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          {
            __pyx_t_34 = PyTuple_New(7+__pyx_t_64); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 920, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_34);
            if (__pyx_t_33) {
              __Pyx_GIVEREF(__pyx_t_33); PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_33); __pyx_t_33 = NULL;
            }
            __Pyx_INCREF(((PyObject *)__pyx_v_F));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
            PyTuple_SET_ITEM(__pyx_t_34, 0+__pyx_t_64, ((PyObject *)__pyx_v_F));
            __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
            PyTuple_SET_ITEM(__pyx_t_34, 1+__pyx_t_64, ((PyObject *)__pyx_v_Nrow));
            __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
            PyTuple_SET_ITEM(__pyx_t_34, 2+__pyx_t_64, ((PyObject *)__pyx_v_Ncol));
            __Pyx_GIVEREF(__pyx_t_36);
            PyTuple_SET_ITEM(__pyx_t_34, 3+__pyx_t_64, __pyx_t_36);
            __Pyx_GIVEREF(__pyx_t_15);
            PyTuple_SET_ITEM(__pyx_t_34, 4+__pyx_t_64, __pyx_t_15);
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_34, 5+__pyx_t_64, __pyx_t_5);
            __Pyx_INCREF(__pyx_int_5);
            __Pyx_GIVEREF(__pyx_int_5);
            PyTuple_SET_ITEM(__pyx_t_34, 6+__pyx_t_64, __pyx_int_5);
            __pyx_t_36 = 0;
            __pyx_t_15 = 0;
            __pyx_t_5 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_106 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_106 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_563 = (__pyx_v_K + 1);
          __pyx_t_564 = __pyx_v_I;
          __pyx_t_565 = __pyx_v_J;
          __pyx_t_566 = 7;
          __pyx_t_64 = -1;
          if (__pyx_t_563 < 0) {
            __pyx_t_563 += __pyx_pybuffernd_F.diminfo[0].shape;
            if (unlikely(__pyx_t_563 < 0)) __pyx_t_64 = 0;
          } else if (unlikely(__pyx_t_563 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_64 = 0;
          if (__pyx_t_564 < 0) {
            __pyx_t_564 += __pyx_pybuffernd_F.diminfo[1].shape;
            if (unlikely(__pyx_t_564 < 0)) __pyx_t_64 = 1;
          } else if (unlikely(__pyx_t_564 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_64 = 1;
          if (__pyx_t_565 < 0) {
            __pyx_t_565 += __pyx_pybuffernd_F.diminfo[2].shape;
            if (unlikely(__pyx_t_565 < 0)) __pyx_t_64 = 2;
          } else if (unlikely(__pyx_t_565 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_64 = 2;
          if (__pyx_t_566 < 0) {
            __pyx_t_566 += __pyx_pybuffernd_F.diminfo[3].shape;
            if (unlikely(__pyx_t_566 < 0)) __pyx_t_64 = 3;
          } else if (unlikely(__pyx_t_566 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_64 = 3;
          if (unlikely(__pyx_t_64 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_64);
            __PYX_ERR(0, 920, __pyx_L1_error)
          }
          *__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_563, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_564, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_565, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_566, __pyx_pybuffernd_F.diminfo[3].strides) = __pyx_t_106;
        }
        __pyx_L98:;
      }
    }

    /* "openpiv/process.pyx":922
 *                     F[K+1,I,J,7] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 5)
 *         # pbar.finish()
 *         print("..[DONE] -----> going to iteration ",K+1)             # <<<<<<<<<<<<<<
 *         print(" ")
 * 
 */
    __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_K + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_kp_s_DONE_going_to_iteration);
    __Pyx_GIVEREF(__pyx_kp_s_DONE_going_to_iteration);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_DONE_going_to_iteration);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    if (__Pyx_PrintOne(0, __pyx_t_4) < 0) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "openpiv/process.pyx":923
 *         # pbar.finish()
 *         print("..[DONE] -----> going to iteration ",K+1)
 *         print(" ")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s__11) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
  }

  /* "openpiv/process.pyx":536
 * 
 * ##################################################################
 * def WiDIM( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *            np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *            np.ndarray[DTYPEi_t, ndim=2] mark,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_33);
  __Pyx_XDECREF(__pyx_t_34);
  __Pyx_XDECREF(__pyx_t_35);
  __Pyx_XDECREF(__pyx_t_36);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ncol.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Nrow.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Overlap.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_W.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_a.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_b.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mark.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_neighbours.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("openpiv.process.WiDIM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ncol.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Nrow.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Overlap.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_W.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_a.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_frame_b.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mark.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_neighbours.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_neighbours_present.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Nrow);
  __Pyx_XDECREF((PyObject *)__pyx_v_Ncol);
  __Pyx_XDECREF((PyObject *)__pyx_v_W);
  __Pyx_XDECREF((PyObject *)__pyx_v_Overlap);
  __Pyx_XDECREF((PyObject *)__pyx_v_F);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_u);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF((PyObject *)__pyx_v_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XDECREF((PyObject *)__pyx_v_neighbours);
  __Pyx_XDECREF((PyObject *)__pyx_v_neighbours_present);
  __Pyx_XDECREF(__pyx_v_window_a);
  __Pyx_XDECREF(__pyx_v_window_b);
  __Pyx_XDECREF(__pyx_v_corr);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_validation_method);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":926
 * 
 * 
 * def interpolate_surroundings(np.ndarray[DTYPEf_t, ndim=4] F,             # <<<<<<<<<<<<<<
 *                              np.ndarray[DTYPEi_t, ndim=1] Nrow,
 *                              np.ndarray[DTYPEi_t, ndim=1] Ncol,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_13interpolate_surroundings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_12interpolate_surroundings[] = "Perform interpolation of between to iterations of the F 4d-array for a specific location I,J and the data type dat.\n    \n    Parameters\n    ----------\n    F :  4d np.ndarray\n        The main array of the WIDIM algorithm.\n\n    Nrow : 1d np.ndarray\n        list of the numbers of row for each iteration K\n       \n    Ncol : 1d np.ndarray\n        list of the numbers of column for each iteration K\n    \n    K : int\n        the iteration that contains the valid data. K+1 will be the iteration at which the interpolation is needed.\n    \n    I,J : int\n        indices of the point that need interpolation (in iteration K+1)\n    \n    dat : int\n        the index of the data to interpolate.\n    \n    Returns\n    -------\n    the interpolated data (type float)\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_13interpolate_surroundings = {"interpolate_surroundings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_13interpolate_surroundings, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_12interpolate_surroundings};
static PyObject *__pyx_pw_7openpiv_7process_13interpolate_surroundings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_F = 0;
  PyArrayObject *__pyx_v_Nrow = 0;
  PyArrayObject *__pyx_v_Ncol = 0;
  int __pyx_v_K;
  int __pyx_v_I;
  int __pyx_v_J;
  int __pyx_v_dat;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("interpolate_surroundings (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_F,&__pyx_n_s_Nrow,&__pyx_n_s_Ncol,&__pyx_n_s_K,&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_dat,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_F)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nrow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("interpolate_surroundings", 1, 7, 7, 1); __PYX_ERR(0, 926, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Ncol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("interpolate_surroundings", 1, 7, 7, 2); __PYX_ERR(0, 926, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_K)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("interpolate_surroundings", 1, 7, 7, 3); __PYX_ERR(0, 926, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("interpolate_surroundings", 1, 7, 7, 4); __PYX_ERR(0, 926, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("interpolate_surroundings", 1, 7, 7, 5); __PYX_ERR(0, 926, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dat)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("interpolate_surroundings", 1, 7, 7, 6); __PYX_ERR(0, 926, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "interpolate_surroundings") < 0)) __PYX_ERR(0, 926, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_F = ((PyArrayObject *)values[0]);
    __pyx_v_Nrow = ((PyArrayObject *)values[1]);
    __pyx_v_Ncol = ((PyArrayObject *)values[2]);
    __pyx_v_K = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_K == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error)
    __pyx_v_I = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_I == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L3_error)
    __pyx_v_J = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_J == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 931, __pyx_L3_error)
    __pyx_v_dat = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_dat == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("interpolate_surroundings", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 926, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.interpolate_surroundings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_F), __pyx_ptype_5numpy_ndarray, 1, "F", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Nrow), __pyx_ptype_5numpy_ndarray, 1, "Nrow", 0))) __PYX_ERR(0, 927, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Ncol), __pyx_ptype_5numpy_ndarray, 1, "Ncol", 0))) __PYX_ERR(0, 928, __pyx_L1_error)
  __pyx_r = __pyx_pf_7openpiv_7process_12interpolate_surroundings(__pyx_self, __pyx_v_F, __pyx_v_Nrow, __pyx_v_Ncol, __pyx_v_K, __pyx_v_I, __pyx_v_J, __pyx_v_dat);

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

static PyObject *__pyx_pf_7openpiv_7process_12interpolate_surroundings(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_F, PyArrayObject *__pyx_v_Nrow, PyArrayObject *__pyx_v_Ncol, int __pyx_v_K, int __pyx_v_I, int __pyx_v_J, int __pyx_v_dat) {
  float __pyx_v_lower_lim_previous_x;
  float __pyx_v_lower_lim_previous_y;
  float __pyx_v_upper_lim_previous_x;
  float __pyx_v_upper_lim_previous_y;
  float __pyx_v_pos_now_x;
  float __pyx_v_pos_now_y;
  PyArrayObject *__pyx_v_Q1 = 0;
  PyArrayObject *__pyx_v_Q4 = 0;
  PyObject *__pyx_v_low_y = NULL;
  PyObject *__pyx_v_high_y = NULL;
  PyObject *__pyx_v_low_x = NULL;
  PyObject *__pyx_v_high_x = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_F;
  __Pyx_Buffer __pyx_pybuffer_F;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_Ncol;
  __Pyx_Buffer __pyx_pybuffer_Ncol;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_Nrow;
  __Pyx_Buffer __pyx_pybuffer_Nrow;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_Q1;
  __Pyx_Buffer __pyx_pybuffer_Q1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_Q4;
  __Pyx_Buffer __pyx_pybuffer_Q4;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  PyObject *__pyx_t_30 = NULL;
  PyObject *__pyx_t_31 = NULL;
  PyObject *__pyx_t_32 = NULL;
  PyArrayObject *__pyx_t_33 = NULL;
  PyArrayObject *__pyx_t_34 = NULL;
  int __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  PyObject *__pyx_t_45 = NULL;
  PyObject *__pyx_t_46 = NULL;
  PyObject *__pyx_t_47 = NULL;
  PyObject *(*__pyx_t_48)(PyObject *);
  PyObject *__pyx_t_49 = NULL;
  PyObject *__pyx_t_50 = NULL;
  PyObject *__pyx_t_51 = NULL;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  PyObject *__pyx_t_66 = NULL;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  __pyx_t_7openpiv_7process_DTYPEi_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  int __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  PyObject *__pyx_t_84 = NULL;
  PyObject *__pyx_t_85 = NULL;
  PyObject *__pyx_t_86 = NULL;
  PyObject *__pyx_t_87 = NULL;
  __Pyx_RefNannySetupContext("interpolate_surroundings", 0);
  __pyx_pybuffer_Q1.pybuffer.buf = NULL;
  __pyx_pybuffer_Q1.refcount = 0;
  __pyx_pybuffernd_Q1.data = NULL;
  __pyx_pybuffernd_Q1.rcbuffer = &__pyx_pybuffer_Q1;
  __pyx_pybuffer_Q4.pybuffer.buf = NULL;
  __pyx_pybuffer_Q4.refcount = 0;
  __pyx_pybuffernd_Q4.data = NULL;
  __pyx_pybuffernd_Q4.rcbuffer = &__pyx_pybuffer_Q4;
  __pyx_pybuffer_F.pybuffer.buf = NULL;
  __pyx_pybuffer_F.refcount = 0;
  __pyx_pybuffernd_F.data = NULL;
  __pyx_pybuffernd_F.rcbuffer = &__pyx_pybuffer_F;
  __pyx_pybuffer_Nrow.pybuffer.buf = NULL;
  __pyx_pybuffer_Nrow.refcount = 0;
  __pyx_pybuffernd_Nrow.data = NULL;
  __pyx_pybuffernd_Nrow.rcbuffer = &__pyx_pybuffer_Nrow;
  __pyx_pybuffer_Ncol.pybuffer.buf = NULL;
  __pyx_pybuffer_Ncol.refcount = 0;
  __pyx_pybuffernd_Ncol.data = NULL;
  __pyx_pybuffernd_Ncol.rcbuffer = &__pyx_pybuffer_Ncol;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_F.rcbuffer->pybuffer, (PyObject*)__pyx_v_F, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 926, __pyx_L1_error)
  }
  __pyx_pybuffernd_F.diminfo[0].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_F.diminfo[0].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_F.diminfo[1].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_F.diminfo[1].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_F.diminfo[2].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_F.diminfo[2].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_F.diminfo[3].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_F.diminfo[3].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[3];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Nrow.rcbuffer->pybuffer, (PyObject*)__pyx_v_Nrow, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 926, __pyx_L1_error)
  }
  __pyx_pybuffernd_Nrow.diminfo[0].strides = __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Nrow.diminfo[0].shape = __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ncol.rcbuffer->pybuffer, (PyObject*)__pyx_v_Ncol, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 926, __pyx_L1_error)
  }
  __pyx_pybuffernd_Ncol.diminfo[0].strides = __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Ncol.diminfo[0].shape = __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.shape[0];

  /* "openpiv/process.pyx":961
 *     """
 *     #interpolate data dat from previous iteration
 *     cdef float lower_lim_previous_x = F[K,0,0,0]             # <<<<<<<<<<<<<<
 *     cdef float lower_lim_previous_y = F[K,0,0,1]
 *     cdef float upper_lim_previous_x = F[K,Nrow[K]-1,Ncol[K]-1,0]
 */
  __pyx_t_1 = __pyx_v_K;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_1 < 0) {
    __pyx_t_1 += __pyx_pybuffernd_F.diminfo[0].shape;
    if (unlikely(__pyx_t_1 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
  if (__pyx_t_2 < 0) {
    __pyx_t_2 += __pyx_pybuffernd_F.diminfo[1].shape;
    if (unlikely(__pyx_t_2 < 0)) __pyx_t_5 = 1;
  } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
  if (__pyx_t_3 < 0) {
    __pyx_t_3 += __pyx_pybuffernd_F.diminfo[2].shape;
    if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 2;
  } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
  if (__pyx_t_4 < 0) {
    __pyx_t_4 += __pyx_pybuffernd_F.diminfo[3].shape;
    if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 3;
  } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 961, __pyx_L1_error)
  }
  __pyx_v_lower_lim_previous_x = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_2, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_3, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_4, __pyx_pybuffernd_F.diminfo[3].strides));

  /* "openpiv/process.pyx":962
 *     #interpolate data dat from previous iteration
 *     cdef float lower_lim_previous_x = F[K,0,0,0]
 *     cdef float lower_lim_previous_y = F[K,0,0,1]             # <<<<<<<<<<<<<<
 *     cdef float upper_lim_previous_x = F[K,Nrow[K]-1,Ncol[K]-1,0]
 *     cdef float upper_lim_previous_y = F[K,Nrow[K]-1,Ncol[K]-1,1]
 */
  __pyx_t_6 = __pyx_v_K;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 1;
  __pyx_t_5 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_pybuffernd_F.diminfo[0].shape;
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_pybuffernd_F.diminfo[1].shape;
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
  } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_pybuffernd_F.diminfo[2].shape;
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 2;
  } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_pybuffernd_F.diminfo[3].shape;
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 3;
  } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 962, __pyx_L1_error)
  }
  __pyx_v_lower_lim_previous_y = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_9, __pyx_pybuffernd_F.diminfo[3].strides));

  /* "openpiv/process.pyx":963
 *     cdef float lower_lim_previous_x = F[K,0,0,0]
 *     cdef float lower_lim_previous_y = F[K,0,0,1]
 *     cdef float upper_lim_previous_x = F[K,Nrow[K]-1,Ncol[K]-1,0]             # <<<<<<<<<<<<<<
 *     cdef float upper_lim_previous_y = F[K,Nrow[K]-1,Ncol[K]-1,1]
 *     cdef float pos_now_x = F[K+1,I,J,0]
 */
  __pyx_t_10 = __pyx_v_K;
  __pyx_t_5 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 963, __pyx_L1_error)
  }
  __pyx_t_11 = __pyx_v_K;
  __pyx_t_5 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 963, __pyx_L1_error)
  }
  __pyx_t_12 = __pyx_v_K;
  __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1);
  __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1);
  __pyx_t_15 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_pybuffernd_F.diminfo[0].shape;
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
  if (__pyx_t_13 < 0) {
    __pyx_t_13 += __pyx_pybuffernd_F.diminfo[1].shape;
    if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 1;
  } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
  if (__pyx_t_14 < 0) {
    __pyx_t_14 += __pyx_pybuffernd_F.diminfo[2].shape;
    if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 2;
  } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
  if (__pyx_t_15 < 0) {
    __pyx_t_15 += __pyx_pybuffernd_F.diminfo[3].shape;
    if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 3;
  } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 963, __pyx_L1_error)
  }
  __pyx_v_upper_lim_previous_x = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_F.diminfo[3].strides));

  /* "openpiv/process.pyx":964
 *     cdef float lower_lim_previous_y = F[K,0,0,1]
 *     cdef float upper_lim_previous_x = F[K,Nrow[K]-1,Ncol[K]-1,0]
 *     cdef float upper_lim_previous_y = F[K,Nrow[K]-1,Ncol[K]-1,1]             # <<<<<<<<<<<<<<
 *     cdef float pos_now_x = F[K+1,I,J,0]
 *     cdef float pos_now_y = F[K+1,I,J,1]
 */
  __pyx_t_16 = __pyx_v_K;
  __pyx_t_5 = -1;
  if (__pyx_t_16 < 0) {
    __pyx_t_16 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
    if (unlikely(__pyx_t_16 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 964, __pyx_L1_error)
  }
  __pyx_t_17 = __pyx_v_K;
  __pyx_t_5 = -1;
  if (__pyx_t_17 < 0) {
    __pyx_t_17 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
    if (unlikely(__pyx_t_17 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 964, __pyx_L1_error)
  }
  __pyx_t_18 = __pyx_v_K;
  __pyx_t_19 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1);
  __pyx_t_20 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1);
  __pyx_t_21 = 1;
  __pyx_t_5 = -1;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_pybuffernd_F.diminfo[0].shape;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_pybuffernd_F.diminfo[1].shape;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 1;
  } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
  if (__pyx_t_20 < 0) {
    __pyx_t_20 += __pyx_pybuffernd_F.diminfo[2].shape;
    if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 2;
  } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
  if (__pyx_t_21 < 0) {
    __pyx_t_21 += __pyx_pybuffernd_F.diminfo[3].shape;
    if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 3;
  } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 964, __pyx_L1_error)
  }
  __pyx_v_upper_lim_previous_y = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_21, __pyx_pybuffernd_F.diminfo[3].strides));

  /* "openpiv/process.pyx":965
 *     cdef float upper_lim_previous_x = F[K,Nrow[K]-1,Ncol[K]-1,0]
 *     cdef float upper_lim_previous_y = F[K,Nrow[K]-1,Ncol[K]-1,1]
 *     cdef float pos_now_x = F[K+1,I,J,0]             # <<<<<<<<<<<<<<
 *     cdef float pos_now_y = F[K+1,I,J,1]
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q1 = np.zeros(2, dtype=DTYPEi)
 */
  __pyx_t_22 = (__pyx_v_K + 1);
  __pyx_t_23 = __pyx_v_I;
  __pyx_t_24 = __pyx_v_J;
  __pyx_t_25 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_22 < 0) {
    __pyx_t_22 += __pyx_pybuffernd_F.diminfo[0].shape;
    if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
  if (__pyx_t_23 < 0) {
    __pyx_t_23 += __pyx_pybuffernd_F.diminfo[1].shape;
    if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 1;
  } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
  if (__pyx_t_24 < 0) {
    __pyx_t_24 += __pyx_pybuffernd_F.diminfo[2].shape;
    if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 2;
  } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
  if (__pyx_t_25 < 0) {
    __pyx_t_25 += __pyx_pybuffernd_F.diminfo[3].shape;
    if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 3;
  } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 965, __pyx_L1_error)
  }
  __pyx_v_pos_now_x = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_25, __pyx_pybuffernd_F.diminfo[3].strides));

  /* "openpiv/process.pyx":966
 *     cdef float upper_lim_previous_y = F[K,Nrow[K]-1,Ncol[K]-1,1]
 *     cdef float pos_now_x = F[K+1,I,J,0]
 *     cdef float pos_now_y = F[K+1,I,J,1]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q1 = np.zeros(2, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)
 */
  __pyx_t_26 = (__pyx_v_K + 1);
  __pyx_t_27 = __pyx_v_I;
  __pyx_t_28 = __pyx_v_J;
  __pyx_t_29 = 1;
  __pyx_t_5 = -1;
  if (__pyx_t_26 < 0) {
    __pyx_t_26 += __pyx_pybuffernd_F.diminfo[0].shape;
    if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
  if (__pyx_t_27 < 0) {
    __pyx_t_27 += __pyx_pybuffernd_F.diminfo[1].shape;
    if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 1;
  } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
  if (__pyx_t_28 < 0) {
    __pyx_t_28 += __pyx_pybuffernd_F.diminfo[2].shape;
    if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 2;
  } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
  if (__pyx_t_29 < 0) {
    __pyx_t_29 += __pyx_pybuffernd_F.diminfo[3].shape;
    if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 3;
  } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 966, __pyx_L1_error)
  }
  __pyx_v_pos_now_y = (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_29, __pyx_pybuffernd_F.diminfo[3].strides));

  /* "openpiv/process.pyx":967
 *     cdef float pos_now_x = F[K+1,I,J,0]
 *     cdef float pos_now_y = F[K+1,I,J,1]
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q1 = np.zeros(2, dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)
 *     if pos_now_x < lower_lim_previous_x:#top row
 */
  __Pyx_GetModuleGlobalName(__pyx_t_30, __pyx_n_s_np); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_30);
  __pyx_t_31 = __Pyx_PyObject_GetAttrStr(__pyx_t_30, __pyx_n_s_zeros); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_31);
  __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
  __pyx_t_30 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_30);
  __Pyx_GetModuleGlobalName(__pyx_t_32, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_32);
  if (PyDict_SetItem(__pyx_t_30, __pyx_n_s_dtype, __pyx_t_32) < 0) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
  __pyx_t_32 = __Pyx_PyObject_Call(__pyx_t_31, __pyx_tuple__13, __pyx_t_30); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_32);
  __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
  __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
  if (!(likely(((__pyx_t_32) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_32, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 967, __pyx_L1_error)
  __pyx_t_33 = ((PyArrayObject *)__pyx_t_32);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q1.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_Q1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Q1.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 967, __pyx_L1_error)
    } else {__pyx_pybuffernd_Q1.diminfo[0].strides = __pyx_pybuffernd_Q1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q1.diminfo[0].shape = __pyx_pybuffernd_Q1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_33 = 0;
  __pyx_v_Q1 = ((PyArrayObject *)__pyx_t_32);
  __pyx_t_32 = 0;

  /* "openpiv/process.pyx":968
 *     cdef float pos_now_y = F[K+1,I,J,1]
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q1 = np.zeros(2, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     if pos_now_x < lower_lim_previous_x:#top row
 *         if pos_now_y < lower_lim_previous_y:#top left corner
 */
  __Pyx_GetModuleGlobalName(__pyx_t_32, __pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_32);
  __pyx_t_30 = __Pyx_PyObject_GetAttrStr(__pyx_t_32, __pyx_n_s_zeros); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_30);
  __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
  __pyx_t_32 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_32);
  __Pyx_GetModuleGlobalName(__pyx_t_31, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_31);
  if (PyDict_SetItem(__pyx_t_32, __pyx_n_s_dtype, __pyx_t_31) < 0) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
  __pyx_t_31 = __Pyx_PyObject_Call(__pyx_t_30, __pyx_tuple__13, __pyx_t_32); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_31);
  __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
  __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
  if (!(likely(((__pyx_t_31) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_31, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 968, __pyx_L1_error)
  __pyx_t_34 = ((PyArrayObject *)__pyx_t_31);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q4.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_Q4 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Q4.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 968, __pyx_L1_error)
    } else {__pyx_pybuffernd_Q4.diminfo[0].strides = __pyx_pybuffernd_Q4.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q4.diminfo[0].shape = __pyx_pybuffernd_Q4.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_34 = 0;
  __pyx_v_Q4 = ((PyArrayObject *)__pyx_t_31);
  __pyx_t_31 = 0;

  /* "openpiv/process.pyx":969
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q1 = np.zeros(2, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)
 *     if pos_now_x < lower_lim_previous_x:#top row             # <<<<<<<<<<<<<<
 *         if pos_now_y < lower_lim_previous_y:#top left corner
 *             return F[K,0,0,dat]
 */
  __pyx_t_35 = ((__pyx_v_pos_now_x < __pyx_v_lower_lim_previous_x) != 0);
  if (__pyx_t_35) {

    /* "openpiv/process.pyx":970
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)
 *     if pos_now_x < lower_lim_previous_x:#top row
 *         if pos_now_y < lower_lim_previous_y:#top left corner             # <<<<<<<<<<<<<<
 *             return F[K,0,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#top right corner
 */
    __pyx_t_35 = ((__pyx_v_pos_now_y < __pyx_v_lower_lim_previous_y) != 0);
    if (__pyx_t_35) {

      /* "openpiv/process.pyx":971
 *     if pos_now_x < lower_lim_previous_x:#top row
 *         if pos_now_y < lower_lim_previous_y:#top left corner
 *             return F[K,0,0,dat]             # <<<<<<<<<<<<<<
 *         elif pos_now_y > upper_lim_previous_y:#top right corner
 *             return F[K,0,Ncol[K]-1,dat]
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_36 = __pyx_v_K;
      __pyx_t_37 = 0;
      __pyx_t_38 = 0;
      __pyx_t_39 = __pyx_v_dat;
      __pyx_t_5 = -1;
      if (__pyx_t_36 < 0) {
        __pyx_t_36 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_37 < 0) {
        __pyx_t_37 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
      if (__pyx_t_38 < 0) {
        __pyx_t_38 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 2;
      } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
      if (__pyx_t_39 < 0) {
        __pyx_t_39 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 3;
      } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 971, __pyx_L1_error)
      }
      __pyx_t_31 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_39, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_r = __pyx_t_31;
      __pyx_t_31 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":970
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)
 *     if pos_now_x < lower_lim_previous_x:#top row
 *         if pos_now_y < lower_lim_previous_y:#top left corner             # <<<<<<<<<<<<<<
 *             return F[K,0,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#top right corner
 */
    }

    /* "openpiv/process.pyx":972
 *         if pos_now_y < lower_lim_previous_y:#top left corner
 *             return F[K,0,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#top right corner             # <<<<<<<<<<<<<<
 *             return F[K,0,Ncol[K]-1,dat]
 *         else:#top row no corners
 */
    __pyx_t_35 = ((__pyx_v_pos_now_y > __pyx_v_upper_lim_previous_y) != 0);
    if (__pyx_t_35) {

      /* "openpiv/process.pyx":973
 *             return F[K,0,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#top right corner
 *             return F[K,0,Ncol[K]-1,dat]             # <<<<<<<<<<<<<<
 *         else:#top row no corners
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_40 = __pyx_v_K;
      __pyx_t_5 = -1;
      if (__pyx_t_40 < 0) {
        __pyx_t_40 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 973, __pyx_L1_error)
      }
      __pyx_t_41 = __pyx_v_K;
      __pyx_t_42 = 0;
      __pyx_t_43 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1);
      __pyx_t_44 = __pyx_v_dat;
      __pyx_t_5 = -1;
      if (__pyx_t_41 < 0) {
        __pyx_t_41 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_42 < 0) {
        __pyx_t_42 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
      if (__pyx_t_43 < 0) {
        __pyx_t_43 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_43 < 0)) __pyx_t_5 = 2;
      } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
      if (__pyx_t_44 < 0) {
        __pyx_t_44 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 3;
      } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 973, __pyx_L1_error)
      }
      __pyx_t_31 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_44, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_r = __pyx_t_31;
      __pyx_t_31 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":972
 *         if pos_now_y < lower_lim_previous_y:#top left corner
 *             return F[K,0,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#top right corner             # <<<<<<<<<<<<<<
 *             return F[K,0,Ncol[K]-1,dat]
 *         else:#top row no corners
 */
    }

    /* "openpiv/process.pyx":975
 *             return F[K,0,Ncol[K]-1,dat]
 *         else:#top row no corners
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)             # <<<<<<<<<<<<<<
 *             if low_y == high_y:
 *                 return F[K,0,low_y,dat]
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_32, __pyx_n_s_F_dichotomy); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_45 = PyFloat_FromDouble(__pyx_v_pos_now_y); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      __pyx_t_46 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_32))) {
        __pyx_t_46 = PyMethod_GET_SELF(__pyx_t_32);
        if (likely(__pyx_t_46)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_32);
          __Pyx_INCREF(__pyx_t_46);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_32, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_32)) {
        PyObject *__pyx_temp[6] = {__pyx_t_46, ((PyObject *)__pyx_v_F), __pyx_t_30, ((PyObject *)__pyx_v_Ncol), __pyx_n_s_y_axis, __pyx_t_45};
        __pyx_t_31 = __Pyx_PyFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 975, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
        __Pyx_GOTREF(__pyx_t_31);
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_32)) {
        PyObject *__pyx_temp[6] = {__pyx_t_46, ((PyObject *)__pyx_v_F), __pyx_t_30, ((PyObject *)__pyx_v_Ncol), __pyx_n_s_y_axis, __pyx_t_45};
        __pyx_t_31 = __Pyx_PyCFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 975, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
        __Pyx_GOTREF(__pyx_t_31);
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
      } else
      #endif
      {
        __pyx_t_47 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 975, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        if (__pyx_t_46) {
          __Pyx_GIVEREF(__pyx_t_46); PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_46); __pyx_t_46 = NULL;
        }
        __Pyx_INCREF(((PyObject *)__pyx_v_F));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
        PyTuple_SET_ITEM(__pyx_t_47, 0+__pyx_t_5, ((PyObject *)__pyx_v_F));
        __Pyx_GIVEREF(__pyx_t_30);
        PyTuple_SET_ITEM(__pyx_t_47, 1+__pyx_t_5, __pyx_t_30);
        __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
        PyTuple_SET_ITEM(__pyx_t_47, 2+__pyx_t_5, ((PyObject *)__pyx_v_Ncol));
        __Pyx_INCREF(__pyx_n_s_y_axis);
        __Pyx_GIVEREF(__pyx_n_s_y_axis);
        PyTuple_SET_ITEM(__pyx_t_47, 3+__pyx_t_5, __pyx_n_s_y_axis);
        __Pyx_GIVEREF(__pyx_t_45);
        PyTuple_SET_ITEM(__pyx_t_47, 4+__pyx_t_5, __pyx_t_45);
        __pyx_t_30 = 0;
        __pyx_t_45 = 0;
        __pyx_t_31 = __Pyx_PyObject_Call(__pyx_t_32, __pyx_t_47, NULL); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 975, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_31);
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      }
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_31))) || (PyList_CheckExact(__pyx_t_31))) {
        PyObject* sequence = __pyx_t_31;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 975, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_32 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_47 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_32 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_47 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_32);
        __Pyx_INCREF(__pyx_t_47);
        #else
        __pyx_t_32 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 975, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_32);
        __pyx_t_47 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 975, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        #endif
        __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_45 = PyObject_GetIter(__pyx_t_31); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 975, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_45);
        __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
        __pyx_t_48 = Py_TYPE(__pyx_t_45)->tp_iternext;
        index = 0; __pyx_t_32 = __pyx_t_48(__pyx_t_45); if (unlikely(!__pyx_t_32)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_32);
        index = 1; __pyx_t_47 = __pyx_t_48(__pyx_t_45); if (unlikely(!__pyx_t_47)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_47);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_48(__pyx_t_45), 2) < 0) __PYX_ERR(0, 975, __pyx_L1_error)
        __pyx_t_48 = NULL;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        goto __pyx_L6_unpacking_done;
        __pyx_L5_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __pyx_t_48 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 975, __pyx_L1_error)
        __pyx_L6_unpacking_done:;
      }
      __pyx_v_low_y = __pyx_t_32;
      __pyx_t_32 = 0;
      __pyx_v_high_y = __pyx_t_47;
      __pyx_t_47 = 0;

      /* "openpiv/process.pyx":976
 *         else:#top row no corners
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *             if low_y == high_y:             # <<<<<<<<<<<<<<
 *                 return F[K,0,low_y,dat]
 *             else:
 */
      __pyx_t_31 = PyObject_RichCompare(__pyx_v_low_y, __pyx_v_high_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_31); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 976, __pyx_L1_error)
      __pyx_t_35 = __Pyx_PyObject_IsTrue(__pyx_t_31); if (unlikely(__pyx_t_35 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      if (__pyx_t_35) {

        /* "openpiv/process.pyx":977
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *             if low_y == high_y:
 *                 return F[K,0,low_y,dat]             # <<<<<<<<<<<<<<
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,0,low_y,dat], F[K,0,high_y,dat])
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_31);
        __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        __pyx_t_32 = PyTuple_New(4); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_32);
        __Pyx_GIVEREF(__pyx_t_31);
        PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_31);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_v_low_y);
        PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_t_47);
        PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_t_47);
        __pyx_t_31 = 0;
        __pyx_t_47 = 0;
        __pyx_t_47 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_32); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
        __pyx_r = __pyx_t_47;
        __pyx_t_47 = 0;
        goto __pyx_L0;

        /* "openpiv/process.pyx":976
 *         else:#top row no corners
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *             if low_y == high_y:             # <<<<<<<<<<<<<<
 *                 return F[K,0,low_y,dat]
 *             else:
 */
      }

      /* "openpiv/process.pyx":979
 *                 return F[K,0,low_y,dat]
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,0,low_y,dat], F[K,0,high_y,dat])             # <<<<<<<<<<<<<<
 *     elif pos_now_x > upper_lim_previous_x:#bottom row
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_GetModuleGlobalName(__pyx_t_32, __pyx_n_s_linear_interpolation); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_32);
        __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_31);
        __pyx_t_45 = PyTuple_New(4); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_45);
        __Pyx_GIVEREF(__pyx_t_31);
        PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_31);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_45, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_v_low_y);
        PyTuple_SET_ITEM(__pyx_t_45, 2, __pyx_v_low_y);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_45, 3, __pyx_int_1);
        __pyx_t_31 = 0;
        __pyx_t_31 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_45); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_31);
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __pyx_t_45 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_45);
        __pyx_t_30 = PyTuple_New(4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        __Pyx_GIVEREF(__pyx_t_45);
        PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_45);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_30, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_high_y);
        __Pyx_GIVEREF(__pyx_v_high_y);
        PyTuple_SET_ITEM(__pyx_t_30, 2, __pyx_v_high_y);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_30, 3, __pyx_int_1);
        __pyx_t_45 = 0;
        __pyx_t_45 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_30); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_45);
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_30 = PyFloat_FromDouble(__pyx_v_pos_now_y); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __pyx_t_49 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_49);
        __pyx_t_50 = PyTuple_New(4); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_50);
        __Pyx_GIVEREF(__pyx_t_46);
        PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_t_46);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_50, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_v_low_y);
        PyTuple_SET_ITEM(__pyx_t_50, 2, __pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_t_49);
        PyTuple_SET_ITEM(__pyx_t_50, 3, __pyx_t_49);
        __pyx_t_46 = 0;
        __pyx_t_49 = 0;
        __pyx_t_49 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_50); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_49);
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_50);
        __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __pyx_t_51 = PyTuple_New(4); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_51);
        __Pyx_GIVEREF(__pyx_t_50);
        PyTuple_SET_ITEM(__pyx_t_51, 0, __pyx_t_50);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_51, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_high_y);
        __Pyx_GIVEREF(__pyx_v_high_y);
        PyTuple_SET_ITEM(__pyx_t_51, 2, __pyx_v_high_y);
        __Pyx_GIVEREF(__pyx_t_46);
        PyTuple_SET_ITEM(__pyx_t_51, 3, __pyx_t_46);
        __pyx_t_50 = 0;
        __pyx_t_46 = 0;
        __pyx_t_46 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_51); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 979, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_51); __pyx_t_51 = 0;
        __pyx_t_51 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_32))) {
          __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_32);
          if (likely(__pyx_t_51)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_32);
            __Pyx_INCREF(__pyx_t_51);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_32, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_32)) {
          PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_31, __pyx_t_45, __pyx_t_30, __pyx_t_49, __pyx_t_46};
          __pyx_t_47 = __Pyx_PyFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 979, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
          __Pyx_GOTREF(__pyx_t_47);
          __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
          __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
          __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
          __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
          __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_32)) {
          PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_31, __pyx_t_45, __pyx_t_30, __pyx_t_49, __pyx_t_46};
          __pyx_t_47 = __Pyx_PyCFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 979, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
          __Pyx_GOTREF(__pyx_t_47);
          __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
          __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
          __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
          __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
          __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
        } else
        #endif
        {
          __pyx_t_50 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 979, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_50);
          if (__pyx_t_51) {
            __Pyx_GIVEREF(__pyx_t_51); PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_t_51); __pyx_t_51 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_31);
          PyTuple_SET_ITEM(__pyx_t_50, 0+__pyx_t_5, __pyx_t_31);
          __Pyx_GIVEREF(__pyx_t_45);
          PyTuple_SET_ITEM(__pyx_t_50, 1+__pyx_t_5, __pyx_t_45);
          __Pyx_GIVEREF(__pyx_t_30);
          PyTuple_SET_ITEM(__pyx_t_50, 2+__pyx_t_5, __pyx_t_30);
          __Pyx_GIVEREF(__pyx_t_49);
          PyTuple_SET_ITEM(__pyx_t_50, 3+__pyx_t_5, __pyx_t_49);
          __Pyx_GIVEREF(__pyx_t_46);
          PyTuple_SET_ITEM(__pyx_t_50, 4+__pyx_t_5, __pyx_t_46);
          __pyx_t_31 = 0;
          __pyx_t_45 = 0;
          __pyx_t_30 = 0;
          __pyx_t_49 = 0;
          __pyx_t_46 = 0;
          __pyx_t_47 = __Pyx_PyObject_Call(__pyx_t_32, __pyx_t_50, NULL); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 979, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_47);
          __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        }
        __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
        __pyx_r = __pyx_t_47;
        __pyx_t_47 = 0;
        goto __pyx_L0;
      }
    }

    /* "openpiv/process.pyx":969
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q1 = np.zeros(2, dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)
 *     if pos_now_x < lower_lim_previous_x:#top row             # <<<<<<<<<<<<<<
 *         if pos_now_y < lower_lim_previous_y:#top left corner
 *             return F[K,0,0,dat]
 */
  }

  /* "openpiv/process.pyx":980
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,0,low_y,dat], F[K,0,high_y,dat])
 *     elif pos_now_x > upper_lim_previous_x:#bottom row             # <<<<<<<<<<<<<<
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner
 *             return F[K,Nrow[K]-1,0,dat]
 */
  __pyx_t_35 = ((__pyx_v_pos_now_x > __pyx_v_upper_lim_previous_x) != 0);
  if (__pyx_t_35) {

    /* "openpiv/process.pyx":981
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,0,low_y,dat], F[K,0,high_y,dat])
 *     elif pos_now_x > upper_lim_previous_x:#bottom row
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner             # <<<<<<<<<<<<<<
 *             return F[K,Nrow[K]-1,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#bottom right corner
 */
    __pyx_t_35 = ((__pyx_v_pos_now_y < __pyx_v_lower_lim_previous_y) != 0);
    if (__pyx_t_35) {

      /* "openpiv/process.pyx":982
 *     elif pos_now_x > upper_lim_previous_x:#bottom row
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner
 *             return F[K,Nrow[K]-1,0,dat]             # <<<<<<<<<<<<<<
 *         elif pos_now_y > upper_lim_previous_y:#bottom right corner
 *             return F[K,Nrow[K]-1,Ncol[K]-1,dat]
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_52 = __pyx_v_K;
      __pyx_t_5 = -1;
      if (__pyx_t_52 < 0) {
        __pyx_t_52 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
        if (unlikely(__pyx_t_52 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 982, __pyx_L1_error)
      }
      __pyx_t_53 = __pyx_v_K;
      __pyx_t_54 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1);
      __pyx_t_55 = 0;
      __pyx_t_56 = __pyx_v_dat;
      __pyx_t_5 = -1;
      if (__pyx_t_53 < 0) {
        __pyx_t_53 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_53 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_54 < 0) {
        __pyx_t_54 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_54 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
      if (__pyx_t_55 < 0) {
        __pyx_t_55 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_55 < 0)) __pyx_t_5 = 2;
      } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
      if (__pyx_t_56 < 0) {
        __pyx_t_56 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_56 < 0)) __pyx_t_5 = 3;
      } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 982, __pyx_L1_error)
      }
      __pyx_t_47 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_55, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_56, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 982, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __pyx_r = __pyx_t_47;
      __pyx_t_47 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":981
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,0,low_y,dat], F[K,0,high_y,dat])
 *     elif pos_now_x > upper_lim_previous_x:#bottom row
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner             # <<<<<<<<<<<<<<
 *             return F[K,Nrow[K]-1,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#bottom right corner
 */
    }

    /* "openpiv/process.pyx":983
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner
 *             return F[K,Nrow[K]-1,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#bottom right corner             # <<<<<<<<<<<<<<
 *             return F[K,Nrow[K]-1,Ncol[K]-1,dat]
 *         else:#bottom row no corners
 */
    __pyx_t_35 = ((__pyx_v_pos_now_y > __pyx_v_upper_lim_previous_y) != 0);
    if (__pyx_t_35) {

      /* "openpiv/process.pyx":984
 *             return F[K,Nrow[K]-1,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#bottom right corner
 *             return F[K,Nrow[K]-1,Ncol[K]-1,dat]             # <<<<<<<<<<<<<<
 *         else:#bottom row no corners
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_57 = __pyx_v_K;
      __pyx_t_5 = -1;
      if (__pyx_t_57 < 0) {
        __pyx_t_57 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
        if (unlikely(__pyx_t_57 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 984, __pyx_L1_error)
      }
      __pyx_t_58 = __pyx_v_K;
      __pyx_t_5 = -1;
      if (__pyx_t_58 < 0) {
        __pyx_t_58 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_58 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 984, __pyx_L1_error)
      }
      __pyx_t_59 = __pyx_v_K;
      __pyx_t_60 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1);
      __pyx_t_61 = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1);
      __pyx_t_62 = __pyx_v_dat;
      __pyx_t_5 = -1;
      if (__pyx_t_59 < 0) {
        __pyx_t_59 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_59 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_60 < 0) {
        __pyx_t_60 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_60 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_5 = 1;
      if (__pyx_t_61 < 0) {
        __pyx_t_61 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_61 < 0)) __pyx_t_5 = 2;
      } else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_5 = 2;
      if (__pyx_t_62 < 0) {
        __pyx_t_62 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_62 < 0)) __pyx_t_5 = 3;
      } else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_5 = 3;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 984, __pyx_L1_error)
      }
      __pyx_t_47 = PyFloat_FromDouble((*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_61, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_62, __pyx_pybuffernd_F.diminfo[3].strides))); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __pyx_r = __pyx_t_47;
      __pyx_t_47 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":983
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner
 *             return F[K,Nrow[K]-1,0,dat]
 *         elif pos_now_y > upper_lim_previous_y:#bottom right corner             # <<<<<<<<<<<<<<
 *             return F[K,Nrow[K]-1,Ncol[K]-1,dat]
 *         else:#bottom row no corners
 */
    }

    /* "openpiv/process.pyx":986
 *             return F[K,Nrow[K]-1,Ncol[K]-1,dat]
 *         else:#bottom row no corners
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)             # <<<<<<<<<<<<<<
 *             #print low_y, high_y
 *             if low_y == high_y:
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_32, __pyx_n_s_F_dichotomy); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 986, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 986, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __pyx_t_46 = PyFloat_FromDouble(__pyx_v_pos_now_y); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 986, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __pyx_t_49 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_32))) {
        __pyx_t_49 = PyMethod_GET_SELF(__pyx_t_32);
        if (likely(__pyx_t_49)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_32);
          __Pyx_INCREF(__pyx_t_49);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_32, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_32)) {
        PyObject *__pyx_temp[6] = {__pyx_t_49, ((PyObject *)__pyx_v_F), __pyx_t_50, ((PyObject *)__pyx_v_Ncol), __pyx_n_s_y_axis, __pyx_t_46};
        __pyx_t_47 = __Pyx_PyFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 986, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_49); __pyx_t_49 = 0;
        __Pyx_GOTREF(__pyx_t_47);
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_32)) {
        PyObject *__pyx_temp[6] = {__pyx_t_49, ((PyObject *)__pyx_v_F), __pyx_t_50, ((PyObject *)__pyx_v_Ncol), __pyx_n_s_y_axis, __pyx_t_46};
        __pyx_t_47 = __Pyx_PyCFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 986, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_49); __pyx_t_49 = 0;
        __Pyx_GOTREF(__pyx_t_47);
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
      } else
      #endif
      {
        __pyx_t_30 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        if (__pyx_t_49) {
          __Pyx_GIVEREF(__pyx_t_49); PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_49); __pyx_t_49 = NULL;
        }
        __Pyx_INCREF(((PyObject *)__pyx_v_F));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
        PyTuple_SET_ITEM(__pyx_t_30, 0+__pyx_t_5, ((PyObject *)__pyx_v_F));
        __Pyx_GIVEREF(__pyx_t_50);
        PyTuple_SET_ITEM(__pyx_t_30, 1+__pyx_t_5, __pyx_t_50);
        __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
        PyTuple_SET_ITEM(__pyx_t_30, 2+__pyx_t_5, ((PyObject *)__pyx_v_Ncol));
        __Pyx_INCREF(__pyx_n_s_y_axis);
        __Pyx_GIVEREF(__pyx_n_s_y_axis);
        PyTuple_SET_ITEM(__pyx_t_30, 3+__pyx_t_5, __pyx_n_s_y_axis);
        __Pyx_GIVEREF(__pyx_t_46);
        PyTuple_SET_ITEM(__pyx_t_30, 4+__pyx_t_5, __pyx_t_46);
        __pyx_t_50 = 0;
        __pyx_t_46 = 0;
        __pyx_t_47 = __Pyx_PyObject_Call(__pyx_t_32, __pyx_t_30, NULL); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      }
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_47))) || (PyList_CheckExact(__pyx_t_47))) {
        PyObject* sequence = __pyx_t_47;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 986, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_32 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_30 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_32 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_30 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_32);
        __Pyx_INCREF(__pyx_t_30);
        #else
        __pyx_t_32 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_32);
        __pyx_t_30 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        #endif
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_46 = PyObject_GetIter(__pyx_t_47); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
        __pyx_t_48 = Py_TYPE(__pyx_t_46)->tp_iternext;
        index = 0; __pyx_t_32 = __pyx_t_48(__pyx_t_46); if (unlikely(!__pyx_t_32)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_32);
        index = 1; __pyx_t_30 = __pyx_t_48(__pyx_t_46); if (unlikely(!__pyx_t_30)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_30);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_48(__pyx_t_46), 2) < 0) __PYX_ERR(0, 986, __pyx_L1_error)
        __pyx_t_48 = NULL;
        __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
        goto __pyx_L10_unpacking_done;
        __pyx_L9_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
        __pyx_t_48 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 986, __pyx_L1_error)
        __pyx_L10_unpacking_done:;
      }
      __pyx_v_low_y = __pyx_t_32;
      __pyx_t_32 = 0;
      __pyx_v_high_y = __pyx_t_30;
      __pyx_t_30 = 0;

      /* "openpiv/process.pyx":988
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *             #print low_y, high_y
 *             if low_y == high_y:             # <<<<<<<<<<<<<<
 *                 return F[K,Nrow[K]-1,low_y,dat]
 *             else:
 */
      __pyx_t_47 = PyObject_RichCompare(__pyx_v_low_y, __pyx_v_high_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_47); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 988, __pyx_L1_error)
      __pyx_t_35 = __Pyx_PyObject_IsTrue(__pyx_t_47); if (unlikely(__pyx_t_35 < 0)) __PYX_ERR(0, 988, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      if (__pyx_t_35) {

        /* "openpiv/process.pyx":989
 *             #print low_y, high_y
 *             if low_y == high_y:
 *                 return F[K,Nrow[K]-1,low_y,dat]             # <<<<<<<<<<<<<<
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,Nrow[K]-1,low_y,dat], F[K,Nrow[K]-1,high_y,dat])
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        __pyx_t_63 = __pyx_v_K;
        __pyx_t_5 = -1;
        if (__pyx_t_63 < 0) {
          __pyx_t_63 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
          if (unlikely(__pyx_t_63 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_5 = 0;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          __PYX_ERR(0, 989, __pyx_L1_error)
        }
        __pyx_t_30 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_32);
        __pyx_t_46 = PyTuple_New(4); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_GIVEREF(__pyx_t_47);
        PyTuple_SET_ITEM(__pyx_t_46, 0, __pyx_t_47);
        __Pyx_GIVEREF(__pyx_t_30);
        PyTuple_SET_ITEM(__pyx_t_46, 1, __pyx_t_30);
        __Pyx_INCREF(__pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_v_low_y);
        PyTuple_SET_ITEM(__pyx_t_46, 2, __pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_t_32);
        PyTuple_SET_ITEM(__pyx_t_46, 3, __pyx_t_32);
        __pyx_t_47 = 0;
        __pyx_t_30 = 0;
        __pyx_t_32 = 0;
        __pyx_t_32 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_46); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_32);
        __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
        __pyx_r = __pyx_t_32;
        __pyx_t_32 = 0;
        goto __pyx_L0;

        /* "openpiv/process.pyx":988
 *             low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *             #print low_y, high_y
 *             if low_y == high_y:             # <<<<<<<<<<<<<<
 *                 return F[K,Nrow[K]-1,low_y,dat]
 *             else:
 */
      }

      /* "openpiv/process.pyx":991
 *                 return F[K,Nrow[K]-1,low_y,dat]
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,Nrow[K]-1,low_y,dat], F[K,Nrow[K]-1,high_y,dat])             # <<<<<<<<<<<<<<
 *     elif pos_now_y < lower_lim_previous_y:#left column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_GetModuleGlobalName(__pyx_t_46, __pyx_n_s_linear_interpolation); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        __pyx_t_47 = PyTuple_New(4); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        __Pyx_GIVEREF(__pyx_t_30);
        PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_30);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_47, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_v_low_y);
        PyTuple_SET_ITEM(__pyx_t_47, 2, __pyx_v_low_y);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_47, 3, __pyx_int_1);
        __pyx_t_30 = 0;
        __pyx_t_30 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_47); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
        __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        __pyx_t_50 = PyTuple_New(4); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_50);
        __Pyx_GIVEREF(__pyx_t_47);
        PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_t_47);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_50, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_high_y);
        __Pyx_GIVEREF(__pyx_v_high_y);
        PyTuple_SET_ITEM(__pyx_t_50, 2, __pyx_v_high_y);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_50, 3, __pyx_int_1);
        __pyx_t_47 = 0;
        __pyx_t_47 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_50); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_47);
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __pyx_t_50 = PyFloat_FromDouble(__pyx_v_pos_now_y); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_50);
        __pyx_t_49 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_49);
        __pyx_t_64 = __pyx_v_K;
        __pyx_t_5 = -1;
        if (__pyx_t_64 < 0) {
          __pyx_t_64 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
          if (unlikely(__pyx_t_64 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_5 = 0;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          __PYX_ERR(0, 991, __pyx_L1_error)
        }
        __pyx_t_45 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_45);
        __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_31);
        __pyx_t_51 = PyTuple_New(4); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_51);
        __Pyx_GIVEREF(__pyx_t_49);
        PyTuple_SET_ITEM(__pyx_t_51, 0, __pyx_t_49);
        __Pyx_GIVEREF(__pyx_t_45);
        PyTuple_SET_ITEM(__pyx_t_51, 1, __pyx_t_45);
        __Pyx_INCREF(__pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_v_low_y);
        PyTuple_SET_ITEM(__pyx_t_51, 2, __pyx_v_low_y);
        __Pyx_GIVEREF(__pyx_t_31);
        PyTuple_SET_ITEM(__pyx_t_51, 3, __pyx_t_31);
        __pyx_t_49 = 0;
        __pyx_t_45 = 0;
        __pyx_t_31 = 0;
        __pyx_t_31 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_51); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_31);
        __Pyx_DECREF(__pyx_t_51); __pyx_t_51 = 0;
        __pyx_t_51 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_51);
        __pyx_t_65 = __pyx_v_K;
        __pyx_t_5 = -1;
        if (__pyx_t_65 < 0) {
          __pyx_t_65 += __pyx_pybuffernd_Nrow.diminfo[0].shape;
          if (unlikely(__pyx_t_65 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_Nrow.diminfo[0].shape)) __pyx_t_5 = 0;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          __PYX_ERR(0, 991, __pyx_L1_error)
        }
        __pyx_t_45 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Nrow.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_Nrow.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_45);
        __pyx_t_49 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_49);
        __pyx_t_66 = PyTuple_New(4); if (unlikely(!__pyx_t_66)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_66);
        __Pyx_GIVEREF(__pyx_t_51);
        PyTuple_SET_ITEM(__pyx_t_66, 0, __pyx_t_51);
        __Pyx_GIVEREF(__pyx_t_45);
        PyTuple_SET_ITEM(__pyx_t_66, 1, __pyx_t_45);
        __Pyx_INCREF(__pyx_v_high_y);
        __Pyx_GIVEREF(__pyx_v_high_y);
        PyTuple_SET_ITEM(__pyx_t_66, 2, __pyx_v_high_y);
        __Pyx_GIVEREF(__pyx_t_49);
        PyTuple_SET_ITEM(__pyx_t_66, 3, __pyx_t_49);
        __pyx_t_51 = 0;
        __pyx_t_45 = 0;
        __pyx_t_49 = 0;
        __pyx_t_49 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_66); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_49);
        __Pyx_DECREF(__pyx_t_66); __pyx_t_66 = 0;
        __pyx_t_66 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
          __pyx_t_66 = PyMethod_GET_SELF(__pyx_t_46);
          if (likely(__pyx_t_66)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
            __Pyx_INCREF(__pyx_t_66);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_46, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_46)) {
          PyObject *__pyx_temp[6] = {__pyx_t_66, __pyx_t_30, __pyx_t_47, __pyx_t_50, __pyx_t_31, __pyx_t_49};
          __pyx_t_32 = __Pyx_PyFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 991, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_66); __pyx_t_66 = 0;
          __Pyx_GOTREF(__pyx_t_32);
          __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
          __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
          __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
          __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
          __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_46)) {
          PyObject *__pyx_temp[6] = {__pyx_t_66, __pyx_t_30, __pyx_t_47, __pyx_t_50, __pyx_t_31, __pyx_t_49};
          __pyx_t_32 = __Pyx_PyCFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 991, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_66); __pyx_t_66 = 0;
          __Pyx_GOTREF(__pyx_t_32);
          __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
          __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
          __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
          __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
          __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
        } else
        #endif
        {
          __pyx_t_45 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_45);
          if (__pyx_t_66) {
            __Pyx_GIVEREF(__pyx_t_66); PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_66); __pyx_t_66 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_30);
          PyTuple_SET_ITEM(__pyx_t_45, 0+__pyx_t_5, __pyx_t_30);
          __Pyx_GIVEREF(__pyx_t_47);
          PyTuple_SET_ITEM(__pyx_t_45, 1+__pyx_t_5, __pyx_t_47);
          __Pyx_GIVEREF(__pyx_t_50);
          PyTuple_SET_ITEM(__pyx_t_45, 2+__pyx_t_5, __pyx_t_50);
          __Pyx_GIVEREF(__pyx_t_31);
          PyTuple_SET_ITEM(__pyx_t_45, 3+__pyx_t_5, __pyx_t_31);
          __Pyx_GIVEREF(__pyx_t_49);
          PyTuple_SET_ITEM(__pyx_t_45, 4+__pyx_t_5, __pyx_t_49);
          __pyx_t_30 = 0;
          __pyx_t_47 = 0;
          __pyx_t_50 = 0;
          __pyx_t_31 = 0;
          __pyx_t_49 = 0;
          __pyx_t_32 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_45, NULL); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_32);
          __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        }
        __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
        __pyx_r = __pyx_t_32;
        __pyx_t_32 = 0;
        goto __pyx_L0;
      }
    }

    /* "openpiv/process.pyx":980
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,0,low_y,dat], F[K,0,high_y,dat])
 *     elif pos_now_x > upper_lim_previous_x:#bottom row             # <<<<<<<<<<<<<<
 *         if pos_now_y < lower_lim_previous_y:#bottom left corner
 *             return F[K,Nrow[K]-1,0,dat]
 */
  }

  /* "openpiv/process.pyx":992
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,Nrow[K]-1,low_y,dat], F[K,Nrow[K]-1,high_y,dat])
 *     elif pos_now_y < lower_lim_previous_y:#left column no corners             # <<<<<<<<<<<<<<
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:
 */
  __pyx_t_35 = ((__pyx_v_pos_now_y < __pyx_v_lower_lim_previous_y) != 0);
  if (__pyx_t_35) {

    /* "openpiv/process.pyx":993
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,Nrow[K]-1,low_y,dat], F[K,Nrow[K]-1,high_y,dat])
 *     elif pos_now_y < lower_lim_previous_y:#left column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)             # <<<<<<<<<<<<<<
 *         if low_x == high_x:
 *             return F[K,low_x,0,dat]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_46, __pyx_n_s_F_dichotomy); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __pyx_t_45 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_45);
    __pyx_t_49 = PyFloat_FromDouble(__pyx_v_pos_now_x); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_49);
    __pyx_t_31 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
      __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_46);
      if (likely(__pyx_t_31)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
        __Pyx_INCREF(__pyx_t_31);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_46, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_46)) {
      PyObject *__pyx_temp[6] = {__pyx_t_31, ((PyObject *)__pyx_v_F), __pyx_t_45, ((PyObject *)__pyx_v_Nrow), __pyx_n_s_x_axis, __pyx_t_49};
      __pyx_t_32 = __Pyx_PyFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
      __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_46)) {
      PyObject *__pyx_temp[6] = {__pyx_t_31, ((PyObject *)__pyx_v_F), __pyx_t_45, ((PyObject *)__pyx_v_Nrow), __pyx_n_s_x_axis, __pyx_t_49};
      __pyx_t_32 = __Pyx_PyCFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
      __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
    } else
    #endif
    {
      __pyx_t_50 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      if (__pyx_t_31) {
        __Pyx_GIVEREF(__pyx_t_31); PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_t_31); __pyx_t_31 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
      PyTuple_SET_ITEM(__pyx_t_50, 0+__pyx_t_5, ((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(__pyx_t_45);
      PyTuple_SET_ITEM(__pyx_t_50, 1+__pyx_t_5, __pyx_t_45);
      __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
      PyTuple_SET_ITEM(__pyx_t_50, 2+__pyx_t_5, ((PyObject *)__pyx_v_Nrow));
      __Pyx_INCREF(__pyx_n_s_x_axis);
      __Pyx_GIVEREF(__pyx_n_s_x_axis);
      PyTuple_SET_ITEM(__pyx_t_50, 3+__pyx_t_5, __pyx_n_s_x_axis);
      __Pyx_GIVEREF(__pyx_t_49);
      PyTuple_SET_ITEM(__pyx_t_50, 4+__pyx_t_5, __pyx_t_49);
      __pyx_t_45 = 0;
      __pyx_t_49 = 0;
      __pyx_t_32 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_50, NULL); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
    }
    __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_32))) || (PyList_CheckExact(__pyx_t_32))) {
      PyObject* sequence = __pyx_t_32;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 993, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_46 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_50 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_46 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_50 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_46);
      __Pyx_INCREF(__pyx_t_50);
      #else
      __pyx_t_46 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __pyx_t_50 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      #endif
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_49 = PyObject_GetIter(__pyx_t_32); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_49);
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_48 = Py_TYPE(__pyx_t_49)->tp_iternext;
      index = 0; __pyx_t_46 = __pyx_t_48(__pyx_t_49); if (unlikely(!__pyx_t_46)) goto __pyx_L12_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_46);
      index = 1; __pyx_t_50 = __pyx_t_48(__pyx_t_49); if (unlikely(!__pyx_t_50)) goto __pyx_L12_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_50);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_48(__pyx_t_49), 2) < 0) __PYX_ERR(0, 993, __pyx_L1_error)
      __pyx_t_48 = NULL;
      __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
      goto __pyx_L13_unpacking_done;
      __pyx_L12_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
      __pyx_t_48 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 993, __pyx_L1_error)
      __pyx_L13_unpacking_done:;
    }
    __pyx_v_low_x = __pyx_t_46;
    __pyx_t_46 = 0;
    __pyx_v_high_x = __pyx_t_50;
    __pyx_t_50 = 0;

    /* "openpiv/process.pyx":994
 *     elif pos_now_y < lower_lim_previous_y:#left column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:             # <<<<<<<<<<<<<<
 *             return F[K,low_x,0,dat]
 *         else:
 */
    __pyx_t_32 = PyObject_RichCompare(__pyx_v_low_x, __pyx_v_high_x, Py_EQ); __Pyx_XGOTREF(__pyx_t_32); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 994, __pyx_L1_error)
    __pyx_t_35 = __Pyx_PyObject_IsTrue(__pyx_t_32); if (unlikely(__pyx_t_35 < 0)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
    if (__pyx_t_35) {

      /* "openpiv/process.pyx":995
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:
 *             return F[K,low_x,0,dat]             # <<<<<<<<<<<<<<
 *         else:
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,0,dat], F[K,high_x,0,dat])
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __pyx_t_46 = PyTuple_New(4); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_GIVEREF(__pyx_t_32);
      PyTuple_SET_ITEM(__pyx_t_46, 0, __pyx_t_32);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_46, 1, __pyx_v_low_x);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_46, 2, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_50);
      PyTuple_SET_ITEM(__pyx_t_46, 3, __pyx_t_50);
      __pyx_t_32 = 0;
      __pyx_t_50 = 0;
      __pyx_t_50 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_46); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
      __pyx_r = __pyx_t_50;
      __pyx_t_50 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":994
 *     elif pos_now_y < lower_lim_previous_y:#left column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:             # <<<<<<<<<<<<<<
 *             return F[K,low_x,0,dat]
 *         else:
 */
    }

    /* "openpiv/process.pyx":997
 *             return F[K,low_x,0,dat]
 *         else:
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,0,dat], F[K,high_x,0,dat])             # <<<<<<<<<<<<<<
 *     elif pos_now_y > upper_lim_previous_y:#right column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_46, __pyx_n_s_linear_interpolation); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __pyx_t_49 = PyTuple_New(4); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_49);
      __Pyx_GIVEREF(__pyx_t_32);
      PyTuple_SET_ITEM(__pyx_t_49, 0, __pyx_t_32);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_49, 1, __pyx_v_low_x);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_49, 2, __pyx_int_0);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_49, 3, __pyx_int_0);
      __pyx_t_32 = 0;
      __pyx_t_32 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_49); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
      __pyx_t_49 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_49);
      __pyx_t_45 = PyTuple_New(4); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      __Pyx_GIVEREF(__pyx_t_49);
      PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_49);
      __Pyx_INCREF(__pyx_v_high_x);
      __Pyx_GIVEREF(__pyx_v_high_x);
      PyTuple_SET_ITEM(__pyx_t_45, 1, __pyx_v_high_x);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_45, 2, __pyx_int_0);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_45, 3, __pyx_int_0);
      __pyx_t_49 = 0;
      __pyx_t_49 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_45); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_49);
      __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
      __pyx_t_45 = PyFloat_FromDouble(__pyx_v_pos_now_x); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __pyx_t_30 = PyTuple_New(4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_GIVEREF(__pyx_t_31);
      PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_31);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_30, 1, __pyx_v_low_x);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_30, 2, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_47);
      PyTuple_SET_ITEM(__pyx_t_30, 3, __pyx_t_47);
      __pyx_t_31 = 0;
      __pyx_t_47 = 0;
      __pyx_t_47 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_30); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_t_66 = PyTuple_New(4); if (unlikely(!__pyx_t_66)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_66);
      __Pyx_GIVEREF(__pyx_t_30);
      PyTuple_SET_ITEM(__pyx_t_66, 0, __pyx_t_30);
      __Pyx_INCREF(__pyx_v_high_x);
      __Pyx_GIVEREF(__pyx_v_high_x);
      PyTuple_SET_ITEM(__pyx_t_66, 1, __pyx_v_high_x);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_66, 2, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_31);
      PyTuple_SET_ITEM(__pyx_t_66, 3, __pyx_t_31);
      __pyx_t_30 = 0;
      __pyx_t_31 = 0;
      __pyx_t_31 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_66); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __Pyx_DECREF(__pyx_t_66); __pyx_t_66 = 0;
      __pyx_t_66 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
        __pyx_t_66 = PyMethod_GET_SELF(__pyx_t_46);
        if (likely(__pyx_t_66)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
          __Pyx_INCREF(__pyx_t_66);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_46, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_46)) {
        PyObject *__pyx_temp[6] = {__pyx_t_66, __pyx_t_32, __pyx_t_49, __pyx_t_45, __pyx_t_47, __pyx_t_31};
        __pyx_t_50 = __Pyx_PyFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 997, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_66); __pyx_t_66 = 0;
        __Pyx_GOTREF(__pyx_t_50);
        __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
        __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
        __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_46)) {
        PyObject *__pyx_temp[6] = {__pyx_t_66, __pyx_t_32, __pyx_t_49, __pyx_t_45, __pyx_t_47, __pyx_t_31};
        __pyx_t_50 = __Pyx_PyCFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 997, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_66); __pyx_t_66 = 0;
        __Pyx_GOTREF(__pyx_t_50);
        __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
        __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
        __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      } else
      #endif
      {
        __pyx_t_30 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 997, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_30);
        if (__pyx_t_66) {
          __Pyx_GIVEREF(__pyx_t_66); PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_66); __pyx_t_66 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_32);
        PyTuple_SET_ITEM(__pyx_t_30, 0+__pyx_t_5, __pyx_t_32);
        __Pyx_GIVEREF(__pyx_t_49);
        PyTuple_SET_ITEM(__pyx_t_30, 1+__pyx_t_5, __pyx_t_49);
        __Pyx_GIVEREF(__pyx_t_45);
        PyTuple_SET_ITEM(__pyx_t_30, 2+__pyx_t_5, __pyx_t_45);
        __Pyx_GIVEREF(__pyx_t_47);
        PyTuple_SET_ITEM(__pyx_t_30, 3+__pyx_t_5, __pyx_t_47);
        __Pyx_GIVEREF(__pyx_t_31);
        PyTuple_SET_ITEM(__pyx_t_30, 4+__pyx_t_5, __pyx_t_31);
        __pyx_t_32 = 0;
        __pyx_t_49 = 0;
        __pyx_t_45 = 0;
        __pyx_t_47 = 0;
        __pyx_t_31 = 0;
        __pyx_t_50 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_30, NULL); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 997, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_50);
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      }
      __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
      __pyx_r = __pyx_t_50;
      __pyx_t_50 = 0;
      goto __pyx_L0;
    }

    /* "openpiv/process.pyx":992
 *             else:
 *                 return linear_interpolation(F[K,0,low_y,1], F[K,0,high_y,1], pos_now_y, F[K,Nrow[K]-1,low_y,dat], F[K,Nrow[K]-1,high_y,dat])
 *     elif pos_now_y < lower_lim_previous_y:#left column no corners             # <<<<<<<<<<<<<<
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:
 */
  }

  /* "openpiv/process.pyx":998
 *         else:
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,0,dat], F[K,high_x,0,dat])
 *     elif pos_now_y > upper_lim_previous_y:#right column no corners             # <<<<<<<<<<<<<<
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:
 */
  __pyx_t_35 = ((__pyx_v_pos_now_y > __pyx_v_upper_lim_previous_y) != 0);
  if (__pyx_t_35) {

    /* "openpiv/process.pyx":999
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,0,dat], F[K,high_x,0,dat])
 *     elif pos_now_y > upper_lim_previous_y:#right column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)             # <<<<<<<<<<<<<<
 *         if low_x == high_x:
 *             return F[K,low_x,Ncol[K]-1,dat]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_46, __pyx_n_s_F_dichotomy); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_30);
    __pyx_t_31 = PyFloat_FromDouble(__pyx_v_pos_now_x); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_31);
    __pyx_t_47 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
      __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_46);
      if (likely(__pyx_t_47)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
        __Pyx_INCREF(__pyx_t_47);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_46, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_46)) {
      PyObject *__pyx_temp[6] = {__pyx_t_47, ((PyObject *)__pyx_v_F), __pyx_t_30, ((PyObject *)__pyx_v_Nrow), __pyx_n_s_x_axis, __pyx_t_31};
      __pyx_t_50 = __Pyx_PyFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
      __Pyx_GOTREF(__pyx_t_50);
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_46)) {
      PyObject *__pyx_temp[6] = {__pyx_t_47, ((PyObject *)__pyx_v_F), __pyx_t_30, ((PyObject *)__pyx_v_Nrow), __pyx_n_s_x_axis, __pyx_t_31};
      __pyx_t_50 = __Pyx_PyCFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
      __Pyx_GOTREF(__pyx_t_50);
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
    } else
    #endif
    {
      __pyx_t_45 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      if (__pyx_t_47) {
        __Pyx_GIVEREF(__pyx_t_47); PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_t_47); __pyx_t_47 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
      PyTuple_SET_ITEM(__pyx_t_45, 0+__pyx_t_5, ((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(__pyx_t_30);
      PyTuple_SET_ITEM(__pyx_t_45, 1+__pyx_t_5, __pyx_t_30);
      __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
      PyTuple_SET_ITEM(__pyx_t_45, 2+__pyx_t_5, ((PyObject *)__pyx_v_Nrow));
      __Pyx_INCREF(__pyx_n_s_x_axis);
      __Pyx_GIVEREF(__pyx_n_s_x_axis);
      PyTuple_SET_ITEM(__pyx_t_45, 3+__pyx_t_5, __pyx_n_s_x_axis);
      __Pyx_GIVEREF(__pyx_t_31);
      PyTuple_SET_ITEM(__pyx_t_45, 4+__pyx_t_5, __pyx_t_31);
      __pyx_t_30 = 0;
      __pyx_t_31 = 0;
      __pyx_t_50 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_45, NULL); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
    }
    __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_50))) || (PyList_CheckExact(__pyx_t_50))) {
      PyObject* sequence = __pyx_t_50;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 999, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_46 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_45 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_46 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_45 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_46);
      __Pyx_INCREF(__pyx_t_45);
      #else
      __pyx_t_46 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __pyx_t_45 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      #endif
      __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_31 = PyObject_GetIter(__pyx_t_50); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
      __pyx_t_48 = Py_TYPE(__pyx_t_31)->tp_iternext;
      index = 0; __pyx_t_46 = __pyx_t_48(__pyx_t_31); if (unlikely(!__pyx_t_46)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_46);
      index = 1; __pyx_t_45 = __pyx_t_48(__pyx_t_31); if (unlikely(!__pyx_t_45)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_45);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_48(__pyx_t_31), 2) < 0) __PYX_ERR(0, 999, __pyx_L1_error)
      __pyx_t_48 = NULL;
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      __pyx_t_48 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 999, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }
    __pyx_v_low_x = __pyx_t_46;
    __pyx_t_46 = 0;
    __pyx_v_high_x = __pyx_t_45;
    __pyx_t_45 = 0;

    /* "openpiv/process.pyx":1000
 *     elif pos_now_y > upper_lim_previous_y:#right column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:             # <<<<<<<<<<<<<<
 *             return F[K,low_x,Ncol[K]-1,dat]
 *         else:
 */
    __pyx_t_50 = PyObject_RichCompare(__pyx_v_low_x, __pyx_v_high_x, Py_EQ); __Pyx_XGOTREF(__pyx_t_50); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 1000, __pyx_L1_error)
    __pyx_t_35 = __Pyx_PyObject_IsTrue(__pyx_t_50); if (unlikely(__pyx_t_35 < 0)) __PYX_ERR(0, 1000, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
    if (__pyx_t_35) {

      /* "openpiv/process.pyx":1001
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:
 *             return F[K,low_x,Ncol[K]-1,dat]             # <<<<<<<<<<<<<<
 *         else:
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,Ncol[K]-1,dat], F[K,high_x,Ncol[K]-1,dat])
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __pyx_t_67 = __pyx_v_K;
      __pyx_t_5 = -1;
      if (__pyx_t_67 < 0) {
        __pyx_t_67 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_67 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 1001, __pyx_L1_error)
      }
      __pyx_t_45 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __pyx_t_31 = PyTuple_New(4); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __Pyx_GIVEREF(__pyx_t_50);
      PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_50);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_31, 1, __pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_t_45);
      PyTuple_SET_ITEM(__pyx_t_31, 2, __pyx_t_45);
      __Pyx_GIVEREF(__pyx_t_46);
      PyTuple_SET_ITEM(__pyx_t_31, 3, __pyx_t_46);
      __pyx_t_50 = 0;
      __pyx_t_45 = 0;
      __pyx_t_46 = 0;
      __pyx_t_46 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_31); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      __pyx_r = __pyx_t_46;
      __pyx_t_46 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":1000
 *     elif pos_now_y > upper_lim_previous_y:#right column no corners
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:             # <<<<<<<<<<<<<<
 *             return F[K,low_x,Ncol[K]-1,dat]
 *         else:
 */
    }

    /* "openpiv/process.pyx":1003
 *             return F[K,low_x,Ncol[K]-1,dat]
 *         else:
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,Ncol[K]-1,dat], F[K,high_x,Ncol[K]-1,dat])             # <<<<<<<<<<<<<<
 *     else:#interior grid
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_31, __pyx_n_s_linear_interpolation); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_t_45 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      __pyx_t_50 = PyTuple_New(4); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __Pyx_GIVEREF(__pyx_t_45);
      PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_t_45);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_50, 1, __pyx_v_low_x);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_50, 2, __pyx_int_0);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_50, 3, __pyx_int_0);
      __pyx_t_45 = 0;
      __pyx_t_45 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_50); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
      __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __pyx_t_30 = PyTuple_New(4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_GIVEREF(__pyx_t_50);
      PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_50);
      __Pyx_INCREF(__pyx_v_high_x);
      __Pyx_GIVEREF(__pyx_v_high_x);
      PyTuple_SET_ITEM(__pyx_t_30, 1, __pyx_v_high_x);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_30, 2, __pyx_int_0);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_30, 3, __pyx_int_0);
      __pyx_t_50 = 0;
      __pyx_t_50 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_30); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = PyFloat_FromDouble(__pyx_v_pos_now_x); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __pyx_t_68 = __pyx_v_K;
      __pyx_t_5 = -1;
      if (__pyx_t_68 < 0) {
        __pyx_t_68 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_68 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 1003, __pyx_L1_error)
      }
      __pyx_t_49 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_49);
      __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __pyx_t_66 = PyTuple_New(4); if (unlikely(!__pyx_t_66)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_66);
      __Pyx_GIVEREF(__pyx_t_47);
      PyTuple_SET_ITEM(__pyx_t_66, 0, __pyx_t_47);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_66, 1, __pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_t_49);
      PyTuple_SET_ITEM(__pyx_t_66, 2, __pyx_t_49);
      __Pyx_GIVEREF(__pyx_t_32);
      PyTuple_SET_ITEM(__pyx_t_66, 3, __pyx_t_32);
      __pyx_t_47 = 0;
      __pyx_t_49 = 0;
      __pyx_t_32 = 0;
      __pyx_t_32 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_66); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_DECREF(__pyx_t_66); __pyx_t_66 = 0;
      __pyx_t_66 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_66)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_66);
      __pyx_t_69 = __pyx_v_K;
      __pyx_t_5 = -1;
      if (__pyx_t_69 < 0) {
        __pyx_t_69 += __pyx_pybuffernd_Ncol.diminfo[0].shape;
        if (unlikely(__pyx_t_69 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_Ncol.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 1003, __pyx_L1_error)
      }
      __pyx_t_49 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Ncol.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_Ncol.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_49);
      __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __pyx_t_51 = PyTuple_New(4); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_51);
      __Pyx_GIVEREF(__pyx_t_66);
      PyTuple_SET_ITEM(__pyx_t_51, 0, __pyx_t_66);
      __Pyx_INCREF(__pyx_v_high_x);
      __Pyx_GIVEREF(__pyx_v_high_x);
      PyTuple_SET_ITEM(__pyx_t_51, 1, __pyx_v_high_x);
      __Pyx_GIVEREF(__pyx_t_49);
      PyTuple_SET_ITEM(__pyx_t_51, 2, __pyx_t_49);
      __Pyx_GIVEREF(__pyx_t_47);
      PyTuple_SET_ITEM(__pyx_t_51, 3, __pyx_t_47);
      __pyx_t_66 = 0;
      __pyx_t_49 = 0;
      __pyx_t_47 = 0;
      __pyx_t_47 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_51); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __Pyx_DECREF(__pyx_t_51); __pyx_t_51 = 0;
      __pyx_t_51 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_31))) {
        __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_31);
        if (likely(__pyx_t_51)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_31);
          __Pyx_INCREF(__pyx_t_51);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_31, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_31)) {
        PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_45, __pyx_t_50, __pyx_t_30, __pyx_t_32, __pyx_t_47};
        __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_31, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1003, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
        __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_31)) {
        PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_45, __pyx_t_50, __pyx_t_30, __pyx_t_32, __pyx_t_47};
        __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_31, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1003, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
        __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      } else
      #endif
      {
        __pyx_t_49 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 1003, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_49);
        if (__pyx_t_51) {
          __Pyx_GIVEREF(__pyx_t_51); PyTuple_SET_ITEM(__pyx_t_49, 0, __pyx_t_51); __pyx_t_51 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_45);
        PyTuple_SET_ITEM(__pyx_t_49, 0+__pyx_t_5, __pyx_t_45);
        __Pyx_GIVEREF(__pyx_t_50);
        PyTuple_SET_ITEM(__pyx_t_49, 1+__pyx_t_5, __pyx_t_50);
        __Pyx_GIVEREF(__pyx_t_30);
        PyTuple_SET_ITEM(__pyx_t_49, 2+__pyx_t_5, __pyx_t_30);
        __Pyx_GIVEREF(__pyx_t_32);
        PyTuple_SET_ITEM(__pyx_t_49, 3+__pyx_t_5, __pyx_t_32);
        __Pyx_GIVEREF(__pyx_t_47);
        PyTuple_SET_ITEM(__pyx_t_49, 4+__pyx_t_5, __pyx_t_47);
        __pyx_t_45 = 0;
        __pyx_t_50 = 0;
        __pyx_t_30 = 0;
        __pyx_t_32 = 0;
        __pyx_t_47 = 0;
        __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_31, __pyx_t_49, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1003, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
      }
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      __pyx_r = __pyx_t_46;
      __pyx_t_46 = 0;
      goto __pyx_L0;
    }

    /* "openpiv/process.pyx":998
 *         else:
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,0,dat], F[K,high_x,0,dat])
 *     elif pos_now_y > upper_lim_previous_y:#right column no corners             # <<<<<<<<<<<<<<
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         if low_x == high_x:
 */
  }

  /* "openpiv/process.pyx":1005
 *             return linear_interpolation(F[K,low_x,0,0], F[K,high_x,0,0], pos_now_x, F[K,low_x,Ncol[K]-1,dat], F[K,high_x,Ncol[K]-1,dat])
 *     else:#interior grid
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)             # <<<<<<<<<<<<<<
 *         low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *         Q1[0] = F[K,low_x,0,0]
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_31, __pyx_n_s_F_dichotomy); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_31);
    __pyx_t_49 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_49);
    __pyx_t_47 = PyFloat_FromDouble(__pyx_v_pos_now_x); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_47);
    __pyx_t_32 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_31))) {
      __pyx_t_32 = PyMethod_GET_SELF(__pyx_t_31);
      if (likely(__pyx_t_32)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_31);
        __Pyx_INCREF(__pyx_t_32);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_31, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_31)) {
      PyObject *__pyx_temp[6] = {__pyx_t_32, ((PyObject *)__pyx_v_F), __pyx_t_49, ((PyObject *)__pyx_v_Nrow), __pyx_n_s_x_axis, __pyx_t_47};
      __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_31, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0;
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_31)) {
      PyObject *__pyx_temp[6] = {__pyx_t_32, ((PyObject *)__pyx_v_F), __pyx_t_49, ((PyObject *)__pyx_v_Nrow), __pyx_n_s_x_axis, __pyx_t_47};
      __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_31, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0;
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
    } else
    #endif
    {
      __pyx_t_30 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      if (__pyx_t_32) {
        __Pyx_GIVEREF(__pyx_t_32); PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_32); __pyx_t_32 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
      PyTuple_SET_ITEM(__pyx_t_30, 0+__pyx_t_5, ((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(__pyx_t_49);
      PyTuple_SET_ITEM(__pyx_t_30, 1+__pyx_t_5, __pyx_t_49);
      __Pyx_INCREF(((PyObject *)__pyx_v_Nrow));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_Nrow));
      PyTuple_SET_ITEM(__pyx_t_30, 2+__pyx_t_5, ((PyObject *)__pyx_v_Nrow));
      __Pyx_INCREF(__pyx_n_s_x_axis);
      __Pyx_GIVEREF(__pyx_n_s_x_axis);
      PyTuple_SET_ITEM(__pyx_t_30, 3+__pyx_t_5, __pyx_n_s_x_axis);
      __Pyx_GIVEREF(__pyx_t_47);
      PyTuple_SET_ITEM(__pyx_t_30, 4+__pyx_t_5, __pyx_t_47);
      __pyx_t_49 = 0;
      __pyx_t_47 = 0;
      __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_31, __pyx_t_30, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
    }
    __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_46))) || (PyList_CheckExact(__pyx_t_46))) {
      PyObject* sequence = __pyx_t_46;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1005, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_31 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_30 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_31 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_30 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_31);
      __Pyx_INCREF(__pyx_t_30);
      #else
      __pyx_t_31 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_t_30 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      #endif
      __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_47 = PyObject_GetIter(__pyx_t_46); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
      __pyx_t_48 = Py_TYPE(__pyx_t_47)->tp_iternext;
      index = 0; __pyx_t_31 = __pyx_t_48(__pyx_t_47); if (unlikely(!__pyx_t_31)) goto __pyx_L18_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_31);
      index = 1; __pyx_t_30 = __pyx_t_48(__pyx_t_47); if (unlikely(!__pyx_t_30)) goto __pyx_L18_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_30);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_48(__pyx_t_47), 2) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
      __pyx_t_48 = NULL;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      goto __pyx_L19_unpacking_done;
      __pyx_L18_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      __pyx_t_48 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1005, __pyx_L1_error)
      __pyx_L19_unpacking_done:;
    }
    __pyx_v_low_x = __pyx_t_31;
    __pyx_t_31 = 0;
    __pyx_v_high_x = __pyx_t_30;
    __pyx_t_30 = 0;

    /* "openpiv/process.pyx":1006
 *     else:#interior grid
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)             # <<<<<<<<<<<<<<
 *         Q1[0] = F[K,low_x,0,0]
 *         Q1[1] = F[K,0,low_y,1]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_30, __pyx_n_s_F_dichotomy); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_30);
    __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_31);
    __pyx_t_47 = PyFloat_FromDouble(__pyx_v_pos_now_y); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_47);
    __pyx_t_49 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_30))) {
      __pyx_t_49 = PyMethod_GET_SELF(__pyx_t_30);
      if (likely(__pyx_t_49)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_30);
        __Pyx_INCREF(__pyx_t_49);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_30, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_30)) {
      PyObject *__pyx_temp[6] = {__pyx_t_49, ((PyObject *)__pyx_v_F), __pyx_t_31, ((PyObject *)__pyx_v_Ncol), __pyx_n_s_y_axis, __pyx_t_47};
      __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_30, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_49); __pyx_t_49 = 0;
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_30)) {
      PyObject *__pyx_temp[6] = {__pyx_t_49, ((PyObject *)__pyx_v_F), __pyx_t_31, ((PyObject *)__pyx_v_Ncol), __pyx_n_s_y_axis, __pyx_t_47};
      __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_30, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_49); __pyx_t_49 = 0;
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
    } else
    #endif
    {
      __pyx_t_32 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      if (__pyx_t_49) {
        __Pyx_GIVEREF(__pyx_t_49); PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_49); __pyx_t_49 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_F));
      PyTuple_SET_ITEM(__pyx_t_32, 0+__pyx_t_5, ((PyObject *)__pyx_v_F));
      __Pyx_GIVEREF(__pyx_t_31);
      PyTuple_SET_ITEM(__pyx_t_32, 1+__pyx_t_5, __pyx_t_31);
      __Pyx_INCREF(((PyObject *)__pyx_v_Ncol));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_Ncol));
      PyTuple_SET_ITEM(__pyx_t_32, 2+__pyx_t_5, ((PyObject *)__pyx_v_Ncol));
      __Pyx_INCREF(__pyx_n_s_y_axis);
      __Pyx_GIVEREF(__pyx_n_s_y_axis);
      PyTuple_SET_ITEM(__pyx_t_32, 3+__pyx_t_5, __pyx_n_s_y_axis);
      __Pyx_GIVEREF(__pyx_t_47);
      PyTuple_SET_ITEM(__pyx_t_32, 4+__pyx_t_5, __pyx_t_47);
      __pyx_t_31 = 0;
      __pyx_t_47 = 0;
      __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_30, __pyx_t_32, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
    }
    __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_46))) || (PyList_CheckExact(__pyx_t_46))) {
      PyObject* sequence = __pyx_t_46;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1006, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_30 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_32 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_30 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_32 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_30);
      __Pyx_INCREF(__pyx_t_32);
      #else
      __pyx_t_30 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_32 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      #endif
      __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_47 = PyObject_GetIter(__pyx_t_46); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
      __pyx_t_48 = Py_TYPE(__pyx_t_47)->tp_iternext;
      index = 0; __pyx_t_30 = __pyx_t_48(__pyx_t_47); if (unlikely(!__pyx_t_30)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_30);
      index = 1; __pyx_t_32 = __pyx_t_48(__pyx_t_47); if (unlikely(!__pyx_t_32)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_32);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_48(__pyx_t_47), 2) < 0) __PYX_ERR(0, 1006, __pyx_L1_error)
      __pyx_t_48 = NULL;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      goto __pyx_L21_unpacking_done;
      __pyx_L20_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
      __pyx_t_48 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1006, __pyx_L1_error)
      __pyx_L21_unpacking_done:;
    }
    __pyx_v_low_y = __pyx_t_30;
    __pyx_t_30 = 0;
    __pyx_v_high_y = __pyx_t_32;
    __pyx_t_32 = 0;

    /* "openpiv/process.pyx":1007
 *         low_x, high_x = F_dichotomy(F,K,Nrow,'x_axis',pos_now_x)
 *         low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *         Q1[0] = F[K,low_x,0,0]             # <<<<<<<<<<<<<<
 *         Q1[1] = F[K,0,low_y,1]
 *         Q4[0] = F[K,high_x,0,0]
 */
    __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __pyx_t_32 = PyTuple_New(4); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_32);
    __Pyx_GIVEREF(__pyx_t_46);
    PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_46);
    __Pyx_INCREF(__pyx_v_low_x);
    __Pyx_GIVEREF(__pyx_v_low_x);
    PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_v_low_x);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_int_0);
    __pyx_t_46 = 0;
    __pyx_t_46 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_32); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
    __pyx_t_70 = __Pyx_PyInt_As_npy_int32(__pyx_t_46); if (unlikely((__pyx_t_70 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1007, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    __pyx_t_71 = 0;
    __pyx_t_5 = -1;
    if (__pyx_t_71 < 0) {
      __pyx_t_71 += __pyx_pybuffernd_Q1.diminfo[0].shape;
      if (unlikely(__pyx_t_71 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_Q1.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1007, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q1.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_Q1.diminfo[0].strides) = __pyx_t_70;

    /* "openpiv/process.pyx":1008
 *         low_y, high_y = F_dichotomy(F,K,Ncol,'y_axis',pos_now_y)
 *         Q1[0] = F[K,low_x,0,0]
 *         Q1[1] = F[K,0,low_y,1]             # <<<<<<<<<<<<<<
 *         Q4[0] = F[K,high_x,0,0]
 *         Q4[1] = F[K,0,high_y,1]
 */
    __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __pyx_t_32 = PyTuple_New(4); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_32);
    __Pyx_GIVEREF(__pyx_t_46);
    PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_46);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_int_0);
    __Pyx_INCREF(__pyx_v_low_y);
    __Pyx_GIVEREF(__pyx_v_low_y);
    PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_v_low_y);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_int_1);
    __pyx_t_46 = 0;
    __pyx_t_46 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_32); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
    __pyx_t_70 = __Pyx_PyInt_As_npy_int32(__pyx_t_46); if (unlikely((__pyx_t_70 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    __pyx_t_72 = 1;
    __pyx_t_5 = -1;
    if (__pyx_t_72 < 0) {
      __pyx_t_72 += __pyx_pybuffernd_Q1.diminfo[0].shape;
      if (unlikely(__pyx_t_72 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_Q1.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1008, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q1.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_Q1.diminfo[0].strides) = __pyx_t_70;

    /* "openpiv/process.pyx":1009
 *         Q1[0] = F[K,low_x,0,0]
 *         Q1[1] = F[K,0,low_y,1]
 *         Q4[0] = F[K,high_x,0,0]             # <<<<<<<<<<<<<<
 *         Q4[1] = F[K,0,high_y,1]
 *         if pos_now_x >= Q1[0] and pos_now_x <= Q4[0] and pos_now_y >= Q1[1] and pos_now_y <= Q4[1]:
 */
    __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __pyx_t_32 = PyTuple_New(4); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_32);
    __Pyx_GIVEREF(__pyx_t_46);
    PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_46);
    __Pyx_INCREF(__pyx_v_high_x);
    __Pyx_GIVEREF(__pyx_v_high_x);
    PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_v_high_x);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_int_0);
    __pyx_t_46 = 0;
    __pyx_t_46 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_32); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
    __pyx_t_70 = __Pyx_PyInt_As_npy_int32(__pyx_t_46); if (unlikely((__pyx_t_70 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    __pyx_t_73 = 0;
    __pyx_t_5 = -1;
    if (__pyx_t_73 < 0) {
      __pyx_t_73 += __pyx_pybuffernd_Q4.diminfo[0].shape;
      if (unlikely(__pyx_t_73 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_Q4.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1009, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q4.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_Q4.diminfo[0].strides) = __pyx_t_70;

    /* "openpiv/process.pyx":1010
 *         Q1[1] = F[K,0,low_y,1]
 *         Q4[0] = F[K,high_x,0,0]
 *         Q4[1] = F[K,0,high_y,1]             # <<<<<<<<<<<<<<
 *         if pos_now_x >= Q1[0] and pos_now_x <= Q4[0] and pos_now_y >= Q1[1] and pos_now_y <= Q4[1]:
 *             return bilinear_interpolation(Q1[0],Q4[0],Q1[1],Q4[1],pos_now_x,pos_now_y,F[K,low_x,low_y,dat],F[K,low_x,high_y,dat],F[K,high_x,low_y,dat],F[K,high_x,high_y,dat])
 */
    __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __pyx_t_32 = PyTuple_New(4); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_32);
    __Pyx_GIVEREF(__pyx_t_46);
    PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_46);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_int_0);
    __Pyx_INCREF(__pyx_v_high_y);
    __Pyx_GIVEREF(__pyx_v_high_y);
    PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_v_high_y);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_int_1);
    __pyx_t_46 = 0;
    __pyx_t_46 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_32); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_46);
    __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
    __pyx_t_70 = __Pyx_PyInt_As_npy_int32(__pyx_t_46); if (unlikely((__pyx_t_70 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
    __pyx_t_74 = 1;
    __pyx_t_5 = -1;
    if (__pyx_t_74 < 0) {
      __pyx_t_74 += __pyx_pybuffernd_Q4.diminfo[0].shape;
      if (unlikely(__pyx_t_74 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd_Q4.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1010, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q4.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd_Q4.diminfo[0].strides) = __pyx_t_70;

    /* "openpiv/process.pyx":1011
 *         Q4[0] = F[K,high_x,0,0]
 *         Q4[1] = F[K,0,high_y,1]
 *         if pos_now_x >= Q1[0] and pos_now_x <= Q4[0] and pos_now_y >= Q1[1] and pos_now_y <= Q4[1]:             # <<<<<<<<<<<<<<
 *             return bilinear_interpolation(Q1[0],Q4[0],Q1[1],Q4[1],pos_now_x,pos_now_y,F[K,low_x,low_y,dat],F[K,low_x,high_y,dat],F[K,high_x,low_y,dat],F[K,high_x,high_y,dat])
 *         else:
 */
    __pyx_t_75 = 0;
    __pyx_t_5 = -1;
    if (__pyx_t_75 < 0) {
      __pyx_t_75 += __pyx_pybuffernd_Q1.diminfo[0].shape;
      if (unlikely(__pyx_t_75 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_75 >= __pyx_pybuffernd_Q1.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1011, __pyx_L1_error)
    }
    __pyx_t_76 = ((__pyx_v_pos_now_x >= (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q1.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_Q1.diminfo[0].strides))) != 0);
    if (__pyx_t_76) {
    } else {
      __pyx_t_35 = __pyx_t_76;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_77 = 0;
    __pyx_t_5 = -1;
    if (__pyx_t_77 < 0) {
      __pyx_t_77 += __pyx_pybuffernd_Q4.diminfo[0].shape;
      if (unlikely(__pyx_t_77 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_Q4.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1011, __pyx_L1_error)
    }
    __pyx_t_76 = ((__pyx_v_pos_now_x <= (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q4.rcbuffer->pybuffer.buf, __pyx_t_77, __pyx_pybuffernd_Q4.diminfo[0].strides))) != 0);
    if (__pyx_t_76) {
    } else {
      __pyx_t_35 = __pyx_t_76;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_78 = 1;
    __pyx_t_5 = -1;
    if (__pyx_t_78 < 0) {
      __pyx_t_78 += __pyx_pybuffernd_Q1.diminfo[0].shape;
      if (unlikely(__pyx_t_78 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_Q1.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1011, __pyx_L1_error)
    }
    __pyx_t_76 = ((__pyx_v_pos_now_y >= (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q1.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_Q1.diminfo[0].strides))) != 0);
    if (__pyx_t_76) {
    } else {
      __pyx_t_35 = __pyx_t_76;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_79 = 1;
    __pyx_t_5 = -1;
    if (__pyx_t_79 < 0) {
      __pyx_t_79 += __pyx_pybuffernd_Q4.diminfo[0].shape;
      if (unlikely(__pyx_t_79 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_Q4.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 1011, __pyx_L1_error)
    }
    __pyx_t_76 = ((__pyx_v_pos_now_y <= (*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q4.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_Q4.diminfo[0].strides))) != 0);
    __pyx_t_35 = __pyx_t_76;
    __pyx_L23_bool_binop_done:;
    if (likely(__pyx_t_35)) {

      /* "openpiv/process.pyx":1012
 *         Q4[1] = F[K,0,high_y,1]
 *         if pos_now_x >= Q1[0] and pos_now_x <= Q4[0] and pos_now_y >= Q1[1] and pos_now_y <= Q4[1]:
 *             return bilinear_interpolation(Q1[0],Q4[0],Q1[1],Q4[1],pos_now_x,pos_now_y,F[K,low_x,low_y,dat],F[K,low_x,high_y,dat],F[K,high_x,low_y,dat],F[K,high_x,high_y,dat])             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError( "cannot perform interpolation, a problem occured" )
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_32, __pyx_n_s_bilinear_interpolation); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __pyx_t_80 = 0;
      __pyx_t_5 = -1;
      if (__pyx_t_80 < 0) {
        __pyx_t_80 += __pyx_pybuffernd_Q1.diminfo[0].shape;
        if (unlikely(__pyx_t_80 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_Q1.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 1012, __pyx_L1_error)
      }
      __pyx_t_30 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q1.rcbuffer->pybuffer.buf, __pyx_t_80, __pyx_pybuffernd_Q1.diminfo[0].strides))); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_81 = 0;
      __pyx_t_5 = -1;
      if (__pyx_t_81 < 0) {
        __pyx_t_81 += __pyx_pybuffernd_Q4.diminfo[0].shape;
        if (unlikely(__pyx_t_81 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_Q4.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 1012, __pyx_L1_error)
      }
      __pyx_t_47 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q4.rcbuffer->pybuffer.buf, __pyx_t_81, __pyx_pybuffernd_Q4.diminfo[0].strides))); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_47);
      __pyx_t_82 = 1;
      __pyx_t_5 = -1;
      if (__pyx_t_82 < 0) {
        __pyx_t_82 += __pyx_pybuffernd_Q1.diminfo[0].shape;
        if (unlikely(__pyx_t_82 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_Q1.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 1012, __pyx_L1_error)
      }
      __pyx_t_31 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q1.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_Q1.diminfo[0].strides))); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_t_83 = 1;
      __pyx_t_5 = -1;
      if (__pyx_t_83 < 0) {
        __pyx_t_83 += __pyx_pybuffernd_Q4.diminfo[0].shape;
        if (unlikely(__pyx_t_83 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_Q4.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(0, 1012, __pyx_L1_error)
      }
      __pyx_t_49 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_Q4.rcbuffer->pybuffer.buf, __pyx_t_83, __pyx_pybuffernd_Q4.diminfo[0].strides))); if (unlikely(!__pyx_t_49)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_49);
      __pyx_t_50 = PyFloat_FromDouble(__pyx_v_pos_now_x); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_50);
      __pyx_t_45 = PyFloat_FromDouble(__pyx_v_pos_now_y); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_45);
      __pyx_t_51 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_51);
      __pyx_t_66 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_66)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_66);
      __pyx_t_84 = PyTuple_New(4); if (unlikely(!__pyx_t_84)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_84);
      __Pyx_GIVEREF(__pyx_t_51);
      PyTuple_SET_ITEM(__pyx_t_84, 0, __pyx_t_51);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_84, 1, __pyx_v_low_x);
      __Pyx_INCREF(__pyx_v_low_y);
      __Pyx_GIVEREF(__pyx_v_low_y);
      PyTuple_SET_ITEM(__pyx_t_84, 2, __pyx_v_low_y);
      __Pyx_GIVEREF(__pyx_t_66);
      PyTuple_SET_ITEM(__pyx_t_84, 3, __pyx_t_66);
      __pyx_t_51 = 0;
      __pyx_t_66 = 0;
      __pyx_t_66 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_84); if (unlikely(!__pyx_t_66)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_66);
      __Pyx_DECREF(__pyx_t_84); __pyx_t_84 = 0;
      __pyx_t_84 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_84)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_84);
      __pyx_t_51 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_51);
      __pyx_t_85 = PyTuple_New(4); if (unlikely(!__pyx_t_85)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_85);
      __Pyx_GIVEREF(__pyx_t_84);
      PyTuple_SET_ITEM(__pyx_t_85, 0, __pyx_t_84);
      __Pyx_INCREF(__pyx_v_low_x);
      __Pyx_GIVEREF(__pyx_v_low_x);
      PyTuple_SET_ITEM(__pyx_t_85, 1, __pyx_v_low_x);
      __Pyx_INCREF(__pyx_v_high_y);
      __Pyx_GIVEREF(__pyx_v_high_y);
      PyTuple_SET_ITEM(__pyx_t_85, 2, __pyx_v_high_y);
      __Pyx_GIVEREF(__pyx_t_51);
      PyTuple_SET_ITEM(__pyx_t_85, 3, __pyx_t_51);
      __pyx_t_84 = 0;
      __pyx_t_51 = 0;
      __pyx_t_51 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_85); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_51);
      __Pyx_DECREF(__pyx_t_85); __pyx_t_85 = 0;
      __pyx_t_85 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_85)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_85);
      __pyx_t_84 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_84)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_84);
      __pyx_t_86 = PyTuple_New(4); if (unlikely(!__pyx_t_86)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_86);
      __Pyx_GIVEREF(__pyx_t_85);
      PyTuple_SET_ITEM(__pyx_t_86, 0, __pyx_t_85);
      __Pyx_INCREF(__pyx_v_high_x);
      __Pyx_GIVEREF(__pyx_v_high_x);
      PyTuple_SET_ITEM(__pyx_t_86, 1, __pyx_v_high_x);
      __Pyx_INCREF(__pyx_v_low_y);
      __Pyx_GIVEREF(__pyx_v_low_y);
      PyTuple_SET_ITEM(__pyx_t_86, 2, __pyx_v_low_y);
      __Pyx_GIVEREF(__pyx_t_84);
      PyTuple_SET_ITEM(__pyx_t_86, 3, __pyx_t_84);
      __pyx_t_85 = 0;
      __pyx_t_84 = 0;
      __pyx_t_84 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_86); if (unlikely(!__pyx_t_84)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_84);
      __Pyx_DECREF(__pyx_t_86); __pyx_t_86 = 0;
      __pyx_t_86 = __Pyx_PyInt_From_int(__pyx_v_K); if (unlikely(!__pyx_t_86)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_86);
      __pyx_t_85 = __Pyx_PyInt_From_int(__pyx_v_dat); if (unlikely(!__pyx_t_85)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_85);
      __pyx_t_87 = PyTuple_New(4); if (unlikely(!__pyx_t_87)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_87);
      __Pyx_GIVEREF(__pyx_t_86);
      PyTuple_SET_ITEM(__pyx_t_87, 0, __pyx_t_86);
      __Pyx_INCREF(__pyx_v_high_x);
      __Pyx_GIVEREF(__pyx_v_high_x);
      PyTuple_SET_ITEM(__pyx_t_87, 1, __pyx_v_high_x);
      __Pyx_INCREF(__pyx_v_high_y);
      __Pyx_GIVEREF(__pyx_v_high_y);
      PyTuple_SET_ITEM(__pyx_t_87, 2, __pyx_v_high_y);
      __Pyx_GIVEREF(__pyx_t_85);
      PyTuple_SET_ITEM(__pyx_t_87, 3, __pyx_t_85);
      __pyx_t_86 = 0;
      __pyx_t_85 = 0;
      __pyx_t_85 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_87); if (unlikely(!__pyx_t_85)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_85);
      __Pyx_DECREF(__pyx_t_87); __pyx_t_87 = 0;
      __pyx_t_87 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_32))) {
        __pyx_t_87 = PyMethod_GET_SELF(__pyx_t_32);
        if (likely(__pyx_t_87)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_32);
          __Pyx_INCREF(__pyx_t_87);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_32, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_32)) {
        PyObject *__pyx_temp[11] = {__pyx_t_87, __pyx_t_30, __pyx_t_47, __pyx_t_31, __pyx_t_49, __pyx_t_50, __pyx_t_45, __pyx_t_66, __pyx_t_51, __pyx_t_84, __pyx_t_85};
        __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 10+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1012, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_87); __pyx_t_87 = 0;
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
        __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
        __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __Pyx_DECREF(__pyx_t_66); __pyx_t_66 = 0;
        __Pyx_DECREF(__pyx_t_51); __pyx_t_51 = 0;
        __Pyx_DECREF(__pyx_t_84); __pyx_t_84 = 0;
        __Pyx_DECREF(__pyx_t_85); __pyx_t_85 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_32)) {
        PyObject *__pyx_temp[11] = {__pyx_t_87, __pyx_t_30, __pyx_t_47, __pyx_t_31, __pyx_t_49, __pyx_t_50, __pyx_t_45, __pyx_t_66, __pyx_t_51, __pyx_t_84, __pyx_t_85};
        __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_32, __pyx_temp+1-__pyx_t_5, 10+__pyx_t_5); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1012, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_87); __pyx_t_87 = 0;
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
        __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
        __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
        __Pyx_DECREF(__pyx_t_49); __pyx_t_49 = 0;
        __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
        __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
        __Pyx_DECREF(__pyx_t_66); __pyx_t_66 = 0;
        __Pyx_DECREF(__pyx_t_51); __pyx_t_51 = 0;
        __Pyx_DECREF(__pyx_t_84); __pyx_t_84 = 0;
        __Pyx_DECREF(__pyx_t_85); __pyx_t_85 = 0;
      } else
      #endif
      {
        __pyx_t_86 = PyTuple_New(10+__pyx_t_5); if (unlikely(!__pyx_t_86)) __PYX_ERR(0, 1012, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_86);
        if (__pyx_t_87) {
          __Pyx_GIVEREF(__pyx_t_87); PyTuple_SET_ITEM(__pyx_t_86, 0, __pyx_t_87); __pyx_t_87 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_30);
        PyTuple_SET_ITEM(__pyx_t_86, 0+__pyx_t_5, __pyx_t_30);
        __Pyx_GIVEREF(__pyx_t_47);
        PyTuple_SET_ITEM(__pyx_t_86, 1+__pyx_t_5, __pyx_t_47);
        __Pyx_GIVEREF(__pyx_t_31);
        PyTuple_SET_ITEM(__pyx_t_86, 2+__pyx_t_5, __pyx_t_31);
        __Pyx_GIVEREF(__pyx_t_49);
        PyTuple_SET_ITEM(__pyx_t_86, 3+__pyx_t_5, __pyx_t_49);
        __Pyx_GIVEREF(__pyx_t_50);
        PyTuple_SET_ITEM(__pyx_t_86, 4+__pyx_t_5, __pyx_t_50);
        __Pyx_GIVEREF(__pyx_t_45);
        PyTuple_SET_ITEM(__pyx_t_86, 5+__pyx_t_5, __pyx_t_45);
        __Pyx_GIVEREF(__pyx_t_66);
        PyTuple_SET_ITEM(__pyx_t_86, 6+__pyx_t_5, __pyx_t_66);
        __Pyx_GIVEREF(__pyx_t_51);
        PyTuple_SET_ITEM(__pyx_t_86, 7+__pyx_t_5, __pyx_t_51);
        __Pyx_GIVEREF(__pyx_t_84);
        PyTuple_SET_ITEM(__pyx_t_86, 8+__pyx_t_5, __pyx_t_84);
        __Pyx_GIVEREF(__pyx_t_85);
        PyTuple_SET_ITEM(__pyx_t_86, 9+__pyx_t_5, __pyx_t_85);
        __pyx_t_30 = 0;
        __pyx_t_47 = 0;
        __pyx_t_31 = 0;
        __pyx_t_49 = 0;
        __pyx_t_50 = 0;
        __pyx_t_45 = 0;
        __pyx_t_66 = 0;
        __pyx_t_51 = 0;
        __pyx_t_84 = 0;
        __pyx_t_85 = 0;
        __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_32, __pyx_t_86, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1012, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_46);
        __Pyx_DECREF(__pyx_t_86); __pyx_t_86 = 0;
      }
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_r = __pyx_t_46;
      __pyx_t_46 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":1011
 *         Q4[0] = F[K,high_x,0,0]
 *         Q4[1] = F[K,0,high_y,1]
 *         if pos_now_x >= Q1[0] and pos_now_x <= Q4[0] and pos_now_y >= Q1[1] and pos_now_y <= Q4[1]:             # <<<<<<<<<<<<<<
 *             return bilinear_interpolation(Q1[0],Q4[0],Q1[1],Q4[1],pos_now_x,pos_now_y,F[K,low_x,low_y,dat],F[K,low_x,high_y,dat],F[K,high_x,low_y,dat],F[K,high_x,high_y,dat])
 *         else:
 */
    }

    /* "openpiv/process.pyx":1014
 *             return bilinear_interpolation(Q1[0],Q4[0],Q1[1],Q4[1],pos_now_x,pos_now_y,F[K,low_x,low_y,dat],F[K,low_x,high_y,dat],F[K,high_x,low_y,dat],F[K,high_x,high_y,dat])
 *         else:
 *             raise ValueError( "cannot perform interpolation, a problem occured" )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_t_46 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 1014, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_46);
      __Pyx_Raise(__pyx_t_46, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
      __PYX_ERR(0, 1014, __pyx_L1_error)
    }
  }

  /* "openpiv/process.pyx":926
 * 
 * 
 * def interpolate_surroundings(np.ndarray[DTYPEf_t, ndim=4] F,             # <<<<<<<<<<<<<<
 *                              np.ndarray[DTYPEi_t, ndim=1] Nrow,
 *                              np.ndarray[DTYPEi_t, ndim=1] Ncol,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_30);
  __Pyx_XDECREF(__pyx_t_31);
  __Pyx_XDECREF(__pyx_t_32);
  __Pyx_XDECREF(__pyx_t_45);
  __Pyx_XDECREF(__pyx_t_46);
  __Pyx_XDECREF(__pyx_t_47);
  __Pyx_XDECREF(__pyx_t_49);
  __Pyx_XDECREF(__pyx_t_50);
  __Pyx_XDECREF(__pyx_t_51);
  __Pyx_XDECREF(__pyx_t_66);
  __Pyx_XDECREF(__pyx_t_84);
  __Pyx_XDECREF(__pyx_t_85);
  __Pyx_XDECREF(__pyx_t_86);
  __Pyx_XDECREF(__pyx_t_87);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ncol.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Nrow.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q4.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("openpiv.process.interpolate_surroundings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ncol.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Nrow.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q4.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Q1);
  __Pyx_XDECREF((PyObject *)__pyx_v_Q4);
  __Pyx_XDECREF(__pyx_v_low_y);
  __Pyx_XDECREF(__pyx_v_high_y);
  __Pyx_XDECREF(__pyx_v_low_x);
  __Pyx_XDECREF(__pyx_v_high_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1021
 * 
 * 
 * def bilinear_interpolation(int x1, int x2, int y1, int y2, int x, int y, float f1, float f2, float f3, float f4):             # <<<<<<<<<<<<<<
 *     """Perform a bilinear interpolation between 4 points
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_15bilinear_interpolation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_14bilinear_interpolation[] = "Perform a bilinear interpolation between 4 points \n    \n    Parameters\n    ----------\n    x1,x2,y1,y2 :  int\n        x-axis and y-axis locations of the 4 points. (ie. location in the frame) \n        (Note that the x axis is vertical and pointing down while the y-axis is horizontal)\n\n    x,y : int\n        locations of the target point for the interpolation (in the frame)\n       \n    f1,f2,f3,f4 : float\n        value at each point : f1=f(x1,y1), f2=f(x1,y2), f3=f(x2, y1), f4=f(x2,y2)\n       \n    Returns\n    -------\n    the interpolated data (type float)\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_15bilinear_interpolation = {"bilinear_interpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_15bilinear_interpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_14bilinear_interpolation};
static PyObject *__pyx_pw_7openpiv_7process_15bilinear_interpolation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_x1;
  int __pyx_v_x2;
  int __pyx_v_y1;
  int __pyx_v_y2;
  int __pyx_v_x;
  int __pyx_v_y;
  float __pyx_v_f1;
  float __pyx_v_f2;
  float __pyx_v_f3;
  float __pyx_v_f4;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bilinear_interpolation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_y1,&__pyx_n_s_y2,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_f1,&__pyx_n_s_f2,&__pyx_n_s_f3,&__pyx_n_s_f4,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 1); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 2); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 3); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 4); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 5); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 6); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 7); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f3)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 8); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f4)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, 9); __PYX_ERR(0, 1021, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bilinear_interpolation") < 0)) __PYX_ERR(0, 1021, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_x1 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_x1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_x2 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_y1 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_y1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_y2 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_y2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_f1 = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_f1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_f2 = __pyx_PyFloat_AsFloat(values[7]); if (unlikely((__pyx_v_f2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_f3 = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_f3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
    __pyx_v_f4 = __pyx_PyFloat_AsFloat(values[9]); if (unlikely((__pyx_v_f4 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bilinear_interpolation", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1021, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.bilinear_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_14bilinear_interpolation(__pyx_self, __pyx_v_x1, __pyx_v_x2, __pyx_v_y1, __pyx_v_y2, __pyx_v_x, __pyx_v_y, __pyx_v_f1, __pyx_v_f2, __pyx_v_f3, __pyx_v_f4);

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

static PyObject *__pyx_pf_7openpiv_7process_14bilinear_interpolation(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_x1, int __pyx_v_x2, int __pyx_v_y1, int __pyx_v_y2, int __pyx_v_x, int __pyx_v_y, float __pyx_v_f1, float __pyx_v_f2, float __pyx_v_f3, float __pyx_v_f4) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("bilinear_interpolation", 0);

  /* "openpiv/process.pyx":1041
 * 
 *     """
 *     if x1 == x2:             # <<<<<<<<<<<<<<
 *         if y1 == y2:
 *             return f1
 */
  __pyx_t_1 = ((__pyx_v_x1 == __pyx_v_x2) != 0);
  if (__pyx_t_1) {

    /* "openpiv/process.pyx":1042
 *     """
 *     if x1 == x2:
 *         if y1 == y2:             # <<<<<<<<<<<<<<
 *             return f1
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_y1 == __pyx_v_y2) != 0);
    if (__pyx_t_1) {

      /* "openpiv/process.pyx":1043
 *     if x1 == x2:
 *         if y1 == y2:
 *             return f1             # <<<<<<<<<<<<<<
 *         else:
 *             return linear_interpolation(y1,y2,y,f1,f2)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_f1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "openpiv/process.pyx":1042
 *     """
 *     if x1 == x2:
 *         if y1 == y2:             # <<<<<<<<<<<<<<
 *             return f1
 *         else:
 */
    }

    /* "openpiv/process.pyx":1045
 *             return f1
 *         else:
 *             return linear_interpolation(y1,y2,y,f1,f2)             # <<<<<<<<<<<<<<
 *     elif y1 == y2:
 *         return linear_interpolation(x1,x2,x,f1,f3)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_linear_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_y1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_y2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_f1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyFloat_FromDouble(__pyx_v_f2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      {
        __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_8);
        __pyx_t_4 = 0;
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_t_7 = 0;
        __pyx_t_8 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "openpiv/process.pyx":1041
 * 
 *     """
 *     if x1 == x2:             # <<<<<<<<<<<<<<
 *         if y1 == y2:
 *             return f1
 */
  }

  /* "openpiv/process.pyx":1046
 *         else:
 *             return linear_interpolation(y1,y2,y,f1,f2)
 *     elif y1 == y2:             # <<<<<<<<<<<<<<
 *         return linear_interpolation(x1,x2,x,f1,f3)
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_y1 == __pyx_v_y2) != 0);
  if (__pyx_t_1) {

    /* "openpiv/process.pyx":1047
 *             return linear_interpolation(y1,y2,y,f1,f2)
 *     elif y1 == y2:
 *         return linear_interpolation(x1,x2,x,f1,f3)             # <<<<<<<<<<<<<<
 *     else:
 *         return (f1*(x2-x)*(y2-y)+f2*(x2-x)*(y-y1)+f3*(x-x1)*(y2-y)+f4*(x-x1)*(y-y1))/(np.float(x2-x1)*np.float(y2-y1))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_linear_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_x1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_x2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_f1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_f3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_t_11, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_t_11, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_10, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_10, __pyx_t_5);
      __pyx_t_11 = 0;
      __pyx_t_8 = 0;
      __pyx_t_7 = 0;
      __pyx_t_6 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":1046
 *         else:
 *             return linear_interpolation(y1,y2,y,f1,f2)
 *     elif y1 == y2:             # <<<<<<<<<<<<<<
 *         return linear_interpolation(x1,x2,x,f1,f3)
 *     else:
 */
  }

  /* "openpiv/process.pyx":1049
 *         return linear_interpolation(x1,x2,x,f1,f3)
 *     else:
 *         return (f1*(x2-x)*(y2-y)+f2*(x2-x)*(y-y1)+f3*(x-x1)*(y2-y)+f4*(x-x1)*(y-y1))/(np.float(x2-x1)*np.float(y2-y1))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble((((((__pyx_v_f1 * (__pyx_v_x2 - __pyx_v_x)) * (__pyx_v_y2 - __pyx_v_y)) + ((__pyx_v_f2 * (__pyx_v_x2 - __pyx_v_x)) * (__pyx_v_y - __pyx_v_y1))) + ((__pyx_v_f3 * (__pyx_v_x - __pyx_v_x1)) * (__pyx_v_y2 - __pyx_v_y))) + ((__pyx_v_f4 * (__pyx_v_x - __pyx_v_x1)) * (__pyx_v_y - __pyx_v_y1)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyInt_From_int((__pyx_v_x2 - __pyx_v_x1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyInt_From_int((__pyx_v_y2 - __pyx_v_y1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __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_5 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "openpiv/process.pyx":1021
 * 
 * 
 * def bilinear_interpolation(int x1, int x2, int y1, int y2, int x, int y, float f1, float f2, float f3, float f4):             # <<<<<<<<<<<<<<
 *     """Perform a bilinear interpolation between 4 points
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("openpiv.process.bilinear_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1055
 * 
 * 
 * def linear_interpolation(int x1, int x2, int x, int f1, int f2):             # <<<<<<<<<<<<<<
 *     """Perform a linear interpolation between 2 points
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_17linear_interpolation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_16linear_interpolation[] = "Perform a linear interpolation between 2 points \n    \n    Parameters\n    ----------\n    x1,x2 :  int\n        locations of the 2 points. (along any axis) \n\n    x : int\n        locations of the target point for the interpolation (along the same axis as x1 and x2)\n       \n    f1,f2 : float\n        value at each point : f1=f(x1), f2=f(x2)\n       \n    Returns\n    -------\n    the interpolated data (type float)\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_17linear_interpolation = {"linear_interpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_17linear_interpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_16linear_interpolation};
static PyObject *__pyx_pw_7openpiv_7process_17linear_interpolation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_x1;
  int __pyx_v_x2;
  int __pyx_v_x;
  int __pyx_v_f1;
  int __pyx_v_f2;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("linear_interpolation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_x,&__pyx_n_s_f1,&__pyx_n_s_f2,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_interpolation", 1, 5, 5, 1); __PYX_ERR(0, 1055, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_interpolation", 1, 5, 5, 2); __PYX_ERR(0, 1055, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_interpolation", 1, 5, 5, 3); __PYX_ERR(0, 1055, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_interpolation", 1, 5, 5, 4); __PYX_ERR(0, 1055, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "linear_interpolation") < 0)) __PYX_ERR(0, 1055, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_x1 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_x1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error)
    __pyx_v_x2 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error)
    __pyx_v_f1 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_f1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error)
    __pyx_v_f2 = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_f2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("linear_interpolation", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1055, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.linear_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_16linear_interpolation(__pyx_self, __pyx_v_x1, __pyx_v_x2, __pyx_v_x, __pyx_v_f1, __pyx_v_f2);

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

static PyObject *__pyx_pf_7openpiv_7process_16linear_interpolation(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_x1, int __pyx_v_x2, int __pyx_v_x, int __pyx_v_f1, int __pyx_v_f2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("linear_interpolation", 0);

  /* "openpiv/process.pyx":1074
 * 
 *     """
 *     return ((x2-x)/np.float(x2-x1))*f1 + ((x-x1)/np.float(x2-x1))*f2             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_x2 - __pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_x2 - __pyx_v_x1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_f1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_x - __pyx_v_x1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_x2 - __pyx_v_x1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_f2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":1055
 * 
 * 
 * def linear_interpolation(int x1, int x2, int x, int f1, int f2):             # <<<<<<<<<<<<<<
 *     """Perform a linear interpolation between 2 points
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("openpiv.process.linear_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1082
 * 
 * 
 * def F_dichotomy( np.ndarray[DTYPEf_t, ndim=4] F, int K, np.ndarray[DTYPEi_t, ndim=1] N, str side, int pos_now):             # <<<<<<<<<<<<<<
 *     """Look for the position at the iteration K of the points surrounding a given point in the frame.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_19F_dichotomy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_18F_dichotomy[] = "Look for the position at the iteration K of the points surrounding a given point in the frame.\n    \n    Parameters\n    ----------\n    F :  4d np.ndarray\n        The main array of the WIDIM algorithm.\n\n    K : int\n        the iteration of interest (1st index for F).\n    \n    N : 1d np.ndarray\n        list of the numbers of row or column (depending on the specified value of 'side') for each iteration K\n\n    side : string\n        the axis of interest : can be either 'x_axis' or 'y_axis'    \n\n    pos_now : int\n        position of the point in the frame (along the axis 'side').\n    \n    Returns\n    -------\n    low : int\n        largest index at the iteration K along the 'side' axis so that the position of index low in the frame is less than or equal to pos_now.    \n\n    high : int\n        smallest index at the iteration K along the 'side' axis so that the position of index low in the frame is greater than or equal to pos_now.                                                        \n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_19F_dichotomy = {"F_dichotomy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_19F_dichotomy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_18F_dichotomy};
static PyObject *__pyx_pw_7openpiv_7process_19F_dichotomy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_F = 0;
  int __pyx_v_K;
  PyArrayObject *__pyx_v_N = 0;
  PyObject *__pyx_v_side = 0;
  int __pyx_v_pos_now;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("F_dichotomy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_F,&__pyx_n_s_K,&__pyx_n_s_N,&__pyx_n_s_side,&__pyx_n_s_pos_now,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_F)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_K)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("F_dichotomy", 1, 5, 5, 1); __PYX_ERR(0, 1082, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("F_dichotomy", 1, 5, 5, 2); __PYX_ERR(0, 1082, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_side)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("F_dichotomy", 1, 5, 5, 3); __PYX_ERR(0, 1082, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos_now)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("F_dichotomy", 1, 5, 5, 4); __PYX_ERR(0, 1082, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "F_dichotomy") < 0)) __PYX_ERR(0, 1082, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_F = ((PyArrayObject *)values[0]);
    __pyx_v_K = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_K == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1082, __pyx_L3_error)
    __pyx_v_N = ((PyArrayObject *)values[2]);
    __pyx_v_side = ((PyObject*)values[3]);
    __pyx_v_pos_now = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_pos_now == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1082, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("F_dichotomy", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1082, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.F_dichotomy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_F), __pyx_ptype_5numpy_ndarray, 1, "F", 0))) __PYX_ERR(0, 1082, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_N), __pyx_ptype_5numpy_ndarray, 1, "N", 0))) __PYX_ERR(0, 1082, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_side), (&PyString_Type), 1, "side", 1))) __PYX_ERR(0, 1082, __pyx_L1_error)
  __pyx_r = __pyx_pf_7openpiv_7process_18F_dichotomy(__pyx_self, __pyx_v_F, __pyx_v_K, __pyx_v_N, __pyx_v_side, __pyx_v_pos_now);

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

static PyObject *__pyx_pf_7openpiv_7process_18F_dichotomy(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_F, int __pyx_v_K, PyArrayObject *__pyx_v_N, PyObject *__pyx_v_side, int __pyx_v_pos_now) {
  int __pyx_v_low;
  int __pyx_v_high;
  int __pyx_v_minlow;
  int __pyx_v_maxhigh;
  int __pyx_v_searching;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_F;
  __Pyx_Buffer __pyx_pybuffer_F;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_N;
  __Pyx_Buffer __pyx_pybuffer_N;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  PyObject *__pyx_t_38 = NULL;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  __Pyx_RefNannySetupContext("F_dichotomy", 0);
  __pyx_pybuffer_F.pybuffer.buf = NULL;
  __pyx_pybuffer_F.refcount = 0;
  __pyx_pybuffernd_F.data = NULL;
  __pyx_pybuffernd_F.rcbuffer = &__pyx_pybuffer_F;
  __pyx_pybuffer_N.pybuffer.buf = NULL;
  __pyx_pybuffer_N.refcount = 0;
  __pyx_pybuffernd_N.data = NULL;
  __pyx_pybuffernd_N.rcbuffer = &__pyx_pybuffer_N;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_F.rcbuffer->pybuffer, (PyObject*)__pyx_v_F, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEf_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1082, __pyx_L1_error)
  }
  __pyx_pybuffernd_F.diminfo[0].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_F.diminfo[0].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_F.diminfo[1].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_F.diminfo[1].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_F.diminfo[2].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_F.diminfo[2].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_F.diminfo[3].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_F.diminfo[3].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[3];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_N.rcbuffer->pybuffer, (PyObject*)__pyx_v_N, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1082, __pyx_L1_error)
  }
  __pyx_pybuffernd_N.diminfo[0].strides = __pyx_pybuffernd_N.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_N.diminfo[0].shape = __pyx_pybuffernd_N.rcbuffer->pybuffer.shape[0];

  /* "openpiv/process.pyx":1114
 *     cdef int low
 *     cdef int high
 *     cdef int minlow = 0             # <<<<<<<<<<<<<<
 *     cdef int maxhigh = N[K]-1
 *     cdef int searching
 */
  __pyx_v_minlow = 0;

  /* "openpiv/process.pyx":1115
 *     cdef int high
 *     cdef int minlow = 0
 *     cdef int maxhigh = N[K]-1             # <<<<<<<<<<<<<<
 *     cdef int searching
 *     low = np.floor(maxhigh/2)
 */
  __pyx_t_1 = __pyx_v_K;
  __pyx_t_2 = -1;
  if (__pyx_t_1 < 0) {
    __pyx_t_1 += __pyx_pybuffernd_N.diminfo[0].shape;
    if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
  } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_N.diminfo[0].shape)) __pyx_t_2 = 0;
  if (unlikely(__pyx_t_2 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_2);
    __PYX_ERR(0, 1115, __pyx_L1_error)
  }
  __pyx_v_maxhigh = ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_N.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_N.diminfo[0].strides)) - 1);

  /* "openpiv/process.pyx":1117
 *     cdef int maxhigh = N[K]-1
 *     cdef int searching
 *     low = np.floor(maxhigh/2)             # <<<<<<<<<<<<<<
 *     high = low + 1
 *     searching=1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_maxhigh) / 2.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_low = __pyx_t_2;

  /* "openpiv/process.pyx":1118
 *     cdef int searching
 *     low = np.floor(maxhigh/2)
 *     high = low + 1             # <<<<<<<<<<<<<<
 *     searching=1
 *     if side == 'x_axis':
 */
  __pyx_v_high = (__pyx_v_low + 1);

  /* "openpiv/process.pyx":1119
 *     low = np.floor(maxhigh/2)
 *     high = low + 1
 *     searching=1             # <<<<<<<<<<<<<<
 *     if side == 'x_axis':
 *         while searching:#start dichotomy
 */
  __pyx_v_searching = 1;

  /* "openpiv/process.pyx":1120
 *     high = low + 1
 *     searching=1
 *     if side == 'x_axis':             # <<<<<<<<<<<<<<
 *         while searching:#start dichotomy
 *             if pos_now == F[K,low,0,0] or (low == 0 and pos_now < F[K,low,0,0]):
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_side, __pyx_n_s_x_axis, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "openpiv/process.pyx":1121
 *     searching=1
 *     if side == 'x_axis':
 *         while searching:#start dichotomy             # <<<<<<<<<<<<<<
 *             if pos_now == F[K,low,0,0] or (low == 0 and pos_now < F[K,low,0,0]):
 *                 searching = 0
 */
    while (1) {
      __pyx_t_8 = (__pyx_v_searching != 0);
      if (!__pyx_t_8) break;

      /* "openpiv/process.pyx":1122
 *     if side == 'x_axis':
 *         while searching:#start dichotomy
 *             if pos_now == F[K,low,0,0] or (low == 0 and pos_now < F[K,low,0,0]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 high = low
 */
      __pyx_t_9 = __pyx_v_K;
      __pyx_t_10 = __pyx_v_low;
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;
      __pyx_t_2 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_9 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_9 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_10 < 0) {
        __pyx_t_10 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_10 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1122, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_pos_now == (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_12, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (!__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_7 = ((__pyx_v_low == 0) != 0);
      if (__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_13 = __pyx_v_K;
      __pyx_t_14 = __pyx_v_low;
      __pyx_t_15 = 0;
      __pyx_t_16 = 0;
      __pyx_t_2 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1122, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_pos_now < (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      __pyx_t_8 = __pyx_t_7;
      __pyx_L7_bool_binop_done:;
      if (__pyx_t_8) {

        /* "openpiv/process.pyx":1123
 *         while searching:#start dichotomy
 *             if pos_now == F[K,low,0,0] or (low == 0 and pos_now < F[K,low,0,0]):
 *                 searching = 0             # <<<<<<<<<<<<<<
 *                 high = low
 *             elif pos_now == F[K,high,0,0] or (high == N[K]-1 and pos_now > F[K,high,0,0]):
 */
        __pyx_v_searching = 0;

        /* "openpiv/process.pyx":1124
 *             if pos_now == F[K,low,0,0] or (low == 0 and pos_now < F[K,low,0,0]):
 *                 searching = 0
 *                 high = low             # <<<<<<<<<<<<<<
 *             elif pos_now == F[K,high,0,0] or (high == N[K]-1 and pos_now > F[K,high,0,0]):
 *                 searching = 0
 */
        __pyx_v_high = __pyx_v_low;

        /* "openpiv/process.pyx":1122
 *     if side == 'x_axis':
 *         while searching:#start dichotomy
 *             if pos_now == F[K,low,0,0] or (low == 0 and pos_now < F[K,low,0,0]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 high = low
 */
        goto __pyx_L6;
      }

      /* "openpiv/process.pyx":1125
 *                 searching = 0
 *                 high = low
 *             elif pos_now == F[K,high,0,0] or (high == N[K]-1 and pos_now > F[K,high,0,0]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 low = high
 */
      __pyx_t_17 = __pyx_v_K;
      __pyx_t_18 = __pyx_v_high;
      __pyx_t_19 = 0;
      __pyx_t_20 = 0;
      __pyx_t_2 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1125, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_pos_now == (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_20, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (!__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_21 = __pyx_v_K;
      __pyx_t_2 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_N.diminfo[0].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_N.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1125, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_high == ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_N.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_N.diminfo[0].strides)) - 1)) != 0);
      if (__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_K;
      __pyx_t_23 = __pyx_v_high;
      __pyx_t_24 = 0;
      __pyx_t_25 = 0;
      __pyx_t_2 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1125, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_pos_now > (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_25, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      __pyx_t_8 = __pyx_t_7;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_8) {

        /* "openpiv/process.pyx":1126
 *                 high = low
 *             elif pos_now == F[K,high,0,0] or (high == N[K]-1 and pos_now > F[K,high,0,0]):
 *                 searching = 0             # <<<<<<<<<<<<<<
 *                 low = high
 *             elif pos_now > F[K,low,0,0] and pos_now < F[K,high,0,0]:
 */
        __pyx_v_searching = 0;

        /* "openpiv/process.pyx":1127
 *             elif pos_now == F[K,high,0,0] or (high == N[K]-1 and pos_now > F[K,high,0,0]):
 *                 searching = 0
 *                 low = high             # <<<<<<<<<<<<<<
 *             elif pos_now > F[K,low,0,0] and pos_now < F[K,high,0,0]:
 *                 searching = 0
 */
        __pyx_v_low = __pyx_v_high;

        /* "openpiv/process.pyx":1125
 *                 searching = 0
 *                 high = low
 *             elif pos_now == F[K,high,0,0] or (high == N[K]-1 and pos_now > F[K,high,0,0]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 low = high
 */
        goto __pyx_L6;
      }

      /* "openpiv/process.pyx":1128
 *                 searching = 0
 *                 low = high
 *             elif pos_now > F[K,low,0,0] and pos_now < F[K,high,0,0]:             # <<<<<<<<<<<<<<
 *                 searching = 0
 *             elif pos_now < F[K,low,0,0]:
 */
      __pyx_t_26 = __pyx_v_K;
      __pyx_t_27 = __pyx_v_low;
      __pyx_t_28 = 0;
      __pyx_t_29 = 0;
      __pyx_t_2 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_28 < 0) {
        __pyx_t_28 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_28 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_29 < 0) {
        __pyx_t_29 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_29 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1128, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_pos_now > (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_29, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_30 = __pyx_v_K;
      __pyx_t_31 = __pyx_v_high;
      __pyx_t_32 = 0;
      __pyx_t_33 = 0;
      __pyx_t_2 = -1;
      if (__pyx_t_30 < 0) {
        __pyx_t_30 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_30 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_31 < 0) {
        __pyx_t_31 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_31 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_32 < 0) {
        __pyx_t_32 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_32 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_33 < 0) {
        __pyx_t_33 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_33 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1128, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_pos_now < (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_33, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      __pyx_t_8 = __pyx_t_7;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_8) {

        /* "openpiv/process.pyx":1129
 *                 low = high
 *             elif pos_now > F[K,low,0,0] and pos_now < F[K,high,0,0]:
 *                 searching = 0             # <<<<<<<<<<<<<<
 *             elif pos_now < F[K,low,0,0]:
 *                 maxhigh = low
 */
        __pyx_v_searching = 0;

        /* "openpiv/process.pyx":1128
 *                 searching = 0
 *                 low = high
 *             elif pos_now > F[K,low,0,0] and pos_now < F[K,high,0,0]:             # <<<<<<<<<<<<<<
 *                 searching = 0
 *             elif pos_now < F[K,low,0,0]:
 */
        goto __pyx_L6;
      }

      /* "openpiv/process.pyx":1130
 *             elif pos_now > F[K,low,0,0] and pos_now < F[K,high,0,0]:
 *                 searching = 0
 *             elif pos_now < F[K,low,0,0]:             # <<<<<<<<<<<<<<
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)
 */
      __pyx_t_34 = __pyx_v_K;
      __pyx_t_35 = __pyx_v_low;
      __pyx_t_36 = 0;
      __pyx_t_37 = 0;
      __pyx_t_2 = -1;
      if (__pyx_t_34 < 0) {
        __pyx_t_34 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_34 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_35 < 0) {
        __pyx_t_35 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_35 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_36 < 0) {
        __pyx_t_36 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_36 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_37 < 0) {
        __pyx_t_37 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_37 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1130, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_pos_now < (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_37, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (__pyx_t_8) {

        /* "openpiv/process.pyx":1131
 *                 searching = 0
 *             elif pos_now < F[K,low,0,0]:
 *                 maxhigh = low             # <<<<<<<<<<<<<<
 *                 low = np.floor((low-minlow)/2)
 *                 high = low + 1
 */
        __pyx_v_maxhigh = __pyx_v_low;

        /* "openpiv/process.pyx":1132
 *             elif pos_now < F[K,low,0,0]:
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)             # <<<<<<<<<<<<<<
 *                 high = low + 1
 *             else:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_floor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyFloat_FromDouble((((double)(__pyx_v_low - __pyx_v_minlow)) / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_low = __pyx_t_2;

        /* "openpiv/process.pyx":1133
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)
 *                 high = low + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 minlow=high
 */
        __pyx_v_high = (__pyx_v_low + 1);

        /* "openpiv/process.pyx":1130
 *             elif pos_now > F[K,low,0,0] and pos_now < F[K,high,0,0]:
 *                 searching = 0
 *             elif pos_now < F[K,low,0,0]:             # <<<<<<<<<<<<<<
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)
 */
        goto __pyx_L6;
      }

      /* "openpiv/process.pyx":1135
 *                 high = low + 1
 *             else:
 *                 minlow=high             # <<<<<<<<<<<<<<
 *                 low = low + np.floor((maxhigh-low)/2)
 *                 high = low + 1
 */
      /*else*/ {
        __pyx_v_minlow = __pyx_v_high;

        /* "openpiv/process.pyx":1136
 *             else:
 *                 minlow=high
 *                 low = low + np.floor((maxhigh-low)/2)             # <<<<<<<<<<<<<<
 *                 high = low + 1
 *         return low, high
 */
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_low); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_floor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyFloat_FromDouble((((double)(__pyx_v_maxhigh - __pyx_v_low)) / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_38 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_38)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_38);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_4 = (__pyx_t_38) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_38, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_low = __pyx_t_2;

        /* "openpiv/process.pyx":1137
 *                 minlow=high
 *                 low = low + np.floor((maxhigh-low)/2)
 *                 high = low + 1             # <<<<<<<<<<<<<<
 *         return low, high
 *     elif side == 'y_axis':
 */
        __pyx_v_high = (__pyx_v_low + 1);
      }
      __pyx_L6:;
    }

    /* "openpiv/process.pyx":1138
 *                 low = low + np.floor((maxhigh-low)/2)
 *                 high = low + 1
 *         return low, high             # <<<<<<<<<<<<<<
 *     elif side == 'y_axis':
 *         while searching:#start dichotomy
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_low); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_high); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":1120
 *     high = low + 1
 *     searching=1
 *     if side == 'x_axis':             # <<<<<<<<<<<<<<
 *         while searching:#start dichotomy
 *             if pos_now == F[K,low,0,0] or (low == 0 and pos_now < F[K,low,0,0]):
 */
  }

  /* "openpiv/process.pyx":1139
 *                 high = low + 1
 *         return low, high
 *     elif side == 'y_axis':             # <<<<<<<<<<<<<<
 *         while searching:#start dichotomy
 *             if pos_now == F[K,0,low,1] or (low == 0 and pos_now < F[K,0,low,1]):
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_side, __pyx_n_s_y_axis, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (likely(__pyx_t_7)) {

    /* "openpiv/process.pyx":1140
 *         return low, high
 *     elif side == 'y_axis':
 *         while searching:#start dichotomy             # <<<<<<<<<<<<<<
 *             if pos_now == F[K,0,low,1] or (low == 0 and pos_now < F[K,0,low,1]):
 *                 searching = 0
 */
    while (1) {
      __pyx_t_7 = (__pyx_v_searching != 0);
      if (!__pyx_t_7) break;

      /* "openpiv/process.pyx":1141
 *     elif side == 'y_axis':
 *         while searching:#start dichotomy
 *             if pos_now == F[K,0,low,1] or (low == 0 and pos_now < F[K,0,low,1]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 high = low
 */
      __pyx_t_39 = __pyx_v_K;
      __pyx_t_40 = 0;
      __pyx_t_41 = __pyx_v_low;
      __pyx_t_42 = 1;
      __pyx_t_2 = -1;
      if (__pyx_t_39 < 0) {
        __pyx_t_39 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_39 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_40 < 0) {
        __pyx_t_40 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_40 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_41 < 0) {
        __pyx_t_41 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_41 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_42 < 0) {
        __pyx_t_42 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_42 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1141, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_pos_now == (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (!__pyx_t_8) {
      } else {
        __pyx_t_7 = __pyx_t_8;
        goto __pyx_L18_bool_binop_done;
      }
      __pyx_t_8 = ((__pyx_v_low == 0) != 0);
      if (__pyx_t_8) {
      } else {
        __pyx_t_7 = __pyx_t_8;
        goto __pyx_L18_bool_binop_done;
      }
      __pyx_t_43 = __pyx_v_K;
      __pyx_t_44 = 0;
      __pyx_t_45 = __pyx_v_low;
      __pyx_t_46 = 1;
      __pyx_t_2 = -1;
      if (__pyx_t_43 < 0) {
        __pyx_t_43 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_43 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_44 < 0) {
        __pyx_t_44 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_44 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_45 < 0) {
        __pyx_t_45 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_45 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_46 < 0) {
        __pyx_t_46 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_46 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1141, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_pos_now < (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_46, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      __pyx_t_7 = __pyx_t_8;
      __pyx_L18_bool_binop_done:;
      if (__pyx_t_7) {

        /* "openpiv/process.pyx":1142
 *         while searching:#start dichotomy
 *             if pos_now == F[K,0,low,1] or (low == 0 and pos_now < F[K,0,low,1]):
 *                 searching = 0             # <<<<<<<<<<<<<<
 *                 high = low
 *             elif pos_now == F[K,0,high,1] or (high == N[K]-1 and pos_now > F[K,0,high,1]):
 */
        __pyx_v_searching = 0;

        /* "openpiv/process.pyx":1143
 *             if pos_now == F[K,0,low,1] or (low == 0 and pos_now < F[K,0,low,1]):
 *                 searching = 0
 *                 high = low             # <<<<<<<<<<<<<<
 *             elif pos_now == F[K,0,high,1] or (high == N[K]-1 and pos_now > F[K,0,high,1]):
 *                 searching = 0
 */
        __pyx_v_high = __pyx_v_low;

        /* "openpiv/process.pyx":1141
 *     elif side == 'y_axis':
 *         while searching:#start dichotomy
 *             if pos_now == F[K,0,low,1] or (low == 0 and pos_now < F[K,0,low,1]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 high = low
 */
        goto __pyx_L17;
      }

      /* "openpiv/process.pyx":1144
 *                 searching = 0
 *                 high = low
 *             elif pos_now == F[K,0,high,1] or (high == N[K]-1 and pos_now > F[K,0,high,1]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 low = high
 */
      __pyx_t_47 = __pyx_v_K;
      __pyx_t_48 = 0;
      __pyx_t_49 = __pyx_v_high;
      __pyx_t_50 = 1;
      __pyx_t_2 = -1;
      if (__pyx_t_47 < 0) {
        __pyx_t_47 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_47 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_48 < 0) {
        __pyx_t_48 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_48 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_49 < 0) {
        __pyx_t_49 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_49 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_50 < 0) {
        __pyx_t_50 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_50 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1144, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_pos_now == (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_50, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (!__pyx_t_8) {
      } else {
        __pyx_t_7 = __pyx_t_8;
        goto __pyx_L21_bool_binop_done;
      }
      __pyx_t_51 = __pyx_v_K;
      __pyx_t_2 = -1;
      if (__pyx_t_51 < 0) {
        __pyx_t_51 += __pyx_pybuffernd_N.diminfo[0].shape;
        if (unlikely(__pyx_t_51 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_N.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1144, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_high == ((*__Pyx_BufPtrStrided1d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_N.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_N.diminfo[0].strides)) - 1)) != 0);
      if (__pyx_t_8) {
      } else {
        __pyx_t_7 = __pyx_t_8;
        goto __pyx_L21_bool_binop_done;
      }
      __pyx_t_52 = __pyx_v_K;
      __pyx_t_53 = 0;
      __pyx_t_54 = __pyx_v_high;
      __pyx_t_55 = 1;
      __pyx_t_2 = -1;
      if (__pyx_t_52 < 0) {
        __pyx_t_52 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_52 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_53 < 0) {
        __pyx_t_53 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_53 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_54 < 0) {
        __pyx_t_54 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_54 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_55 < 0) {
        __pyx_t_55 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_55 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1144, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_pos_now > (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_55, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      __pyx_t_7 = __pyx_t_8;
      __pyx_L21_bool_binop_done:;
      if (__pyx_t_7) {

        /* "openpiv/process.pyx":1145
 *                 high = low
 *             elif pos_now == F[K,0,high,1] or (high == N[K]-1 and pos_now > F[K,0,high,1]):
 *                 searching = 0             # <<<<<<<<<<<<<<
 *                 low = high
 *             elif pos_now > F[K,0,low,1] and pos_now < F[K,0,high,1]:
 */
        __pyx_v_searching = 0;

        /* "openpiv/process.pyx":1146
 *             elif pos_now == F[K,0,high,1] or (high == N[K]-1 and pos_now > F[K,0,high,1]):
 *                 searching = 0
 *                 low = high             # <<<<<<<<<<<<<<
 *             elif pos_now > F[K,0,low,1] and pos_now < F[K,0,high,1]:
 *                 searching = 0
 */
        __pyx_v_low = __pyx_v_high;

        /* "openpiv/process.pyx":1144
 *                 searching = 0
 *                 high = low
 *             elif pos_now == F[K,0,high,1] or (high == N[K]-1 and pos_now > F[K,0,high,1]):             # <<<<<<<<<<<<<<
 *                 searching = 0
 *                 low = high
 */
        goto __pyx_L17;
      }

      /* "openpiv/process.pyx":1147
 *                 searching = 0
 *                 low = high
 *             elif pos_now > F[K,0,low,1] and pos_now < F[K,0,high,1]:             # <<<<<<<<<<<<<<
 *                 searching = 0
 *             elif pos_now < F[K,0,low,1]:
 */
      __pyx_t_56 = __pyx_v_K;
      __pyx_t_57 = 0;
      __pyx_t_58 = __pyx_v_low;
      __pyx_t_59 = 1;
      __pyx_t_2 = -1;
      if (__pyx_t_56 < 0) {
        __pyx_t_56 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_56 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_57 < 0) {
        __pyx_t_57 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_57 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_58 < 0) {
        __pyx_t_58 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_58 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_59 < 0) {
        __pyx_t_59 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_59 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1147, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_pos_now > (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_58, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_59, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (__pyx_t_8) {
      } else {
        __pyx_t_7 = __pyx_t_8;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_60 = __pyx_v_K;
      __pyx_t_61 = 0;
      __pyx_t_62 = __pyx_v_high;
      __pyx_t_63 = 1;
      __pyx_t_2 = -1;
      if (__pyx_t_60 < 0) {
        __pyx_t_60 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_60 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_61 < 0) {
        __pyx_t_61 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_61 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_62 < 0) {
        __pyx_t_62 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_62 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_63 < 0) {
        __pyx_t_63 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_63 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1147, __pyx_L1_error)
      }
      __pyx_t_8 = ((__pyx_v_pos_now < (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_62, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_63, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      __pyx_t_7 = __pyx_t_8;
      __pyx_L24_bool_binop_done:;
      if (__pyx_t_7) {

        /* "openpiv/process.pyx":1148
 *                 low = high
 *             elif pos_now > F[K,0,low,1] and pos_now < F[K,0,high,1]:
 *                 searching = 0             # <<<<<<<<<<<<<<
 *             elif pos_now < F[K,0,low,1]:
 *                 maxhigh = low
 */
        __pyx_v_searching = 0;

        /* "openpiv/process.pyx":1147
 *                 searching = 0
 *                 low = high
 *             elif pos_now > F[K,0,low,1] and pos_now < F[K,0,high,1]:             # <<<<<<<<<<<<<<
 *                 searching = 0
 *             elif pos_now < F[K,0,low,1]:
 */
        goto __pyx_L17;
      }

      /* "openpiv/process.pyx":1149
 *             elif pos_now > F[K,0,low,1] and pos_now < F[K,0,high,1]:
 *                 searching = 0
 *             elif pos_now < F[K,0,low,1]:             # <<<<<<<<<<<<<<
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)
 */
      __pyx_t_64 = __pyx_v_K;
      __pyx_t_65 = 0;
      __pyx_t_66 = __pyx_v_low;
      __pyx_t_67 = 1;
      __pyx_t_2 = -1;
      if (__pyx_t_64 < 0) {
        __pyx_t_64 += __pyx_pybuffernd_F.diminfo[0].shape;
        if (unlikely(__pyx_t_64 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_F.diminfo[0].shape)) __pyx_t_2 = 0;
      if (__pyx_t_65 < 0) {
        __pyx_t_65 += __pyx_pybuffernd_F.diminfo[1].shape;
        if (unlikely(__pyx_t_65 < 0)) __pyx_t_2 = 1;
      } else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_F.diminfo[1].shape)) __pyx_t_2 = 1;
      if (__pyx_t_66 < 0) {
        __pyx_t_66 += __pyx_pybuffernd_F.diminfo[2].shape;
        if (unlikely(__pyx_t_66 < 0)) __pyx_t_2 = 2;
      } else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_F.diminfo[2].shape)) __pyx_t_2 = 2;
      if (__pyx_t_67 < 0) {
        __pyx_t_67 += __pyx_pybuffernd_F.diminfo[3].shape;
        if (unlikely(__pyx_t_67 < 0)) __pyx_t_2 = 3;
      } else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_F.diminfo[3].shape)) __pyx_t_2 = 3;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        __PYX_ERR(0, 1149, __pyx_L1_error)
      }
      __pyx_t_7 = ((__pyx_v_pos_now < (*__Pyx_BufPtrStrided4d(__pyx_t_7openpiv_7process_DTYPEf_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_F.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_F.diminfo[2].strides, __pyx_t_67, __pyx_pybuffernd_F.diminfo[3].strides))) != 0);
      if (__pyx_t_7) {

        /* "openpiv/process.pyx":1150
 *                 searching = 0
 *             elif pos_now < F[K,0,low,1]:
 *                 maxhigh = low             # <<<<<<<<<<<<<<
 *                 low = np.floor((low-minlow)/2)
 *                 high = low + 1
 */
        __pyx_v_maxhigh = __pyx_v_low;

        /* "openpiv/process.pyx":1151
 *             elif pos_now < F[K,0,low,1]:
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)             # <<<<<<<<<<<<<<
 *                 high = low + 1
 *             else:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_floor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyFloat_FromDouble((((double)(__pyx_v_low - __pyx_v_minlow)) / 2.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_low = __pyx_t_2;

        /* "openpiv/process.pyx":1152
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)
 *                 high = low + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 minlow=high
 */
        __pyx_v_high = (__pyx_v_low + 1);

        /* "openpiv/process.pyx":1149
 *             elif pos_now > F[K,0,low,1] and pos_now < F[K,0,high,1]:
 *                 searching = 0
 *             elif pos_now < F[K,0,low,1]:             # <<<<<<<<<<<<<<
 *                 maxhigh = low
 *                 low = np.floor((low-minlow)/2)
 */
        goto __pyx_L17;
      }

      /* "openpiv/process.pyx":1154
 *                 high = low + 1
 *             else:
 *                 minlow=high             # <<<<<<<<<<<<<<
 *                 low = low + np.floor((maxhigh-low)/2)
 *                 high = low + 1
 */
      /*else*/ {
        __pyx_v_minlow = __pyx_v_high;

        /* "openpiv/process.pyx":1155
 *             else:
 *                 minlow=high
 *                 low = low + np.floor((maxhigh-low)/2)             # <<<<<<<<<<<<<<
 *                 high = low + 1
 *         return low, high
 */
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_low); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyFloat_FromDouble((((double)(__pyx_v_maxhigh - __pyx_v_low)) / 2.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_38 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_38)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_38);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_6 = (__pyx_t_38) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_38, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_low = __pyx_t_2;

        /* "openpiv/process.pyx":1156
 *                 minlow=high
 *                 low = low + np.floor((maxhigh-low)/2)
 *                 high = low + 1             # <<<<<<<<<<<<<<
 *         return low, high
 *     else:
 */
        __pyx_v_high = (__pyx_v_low + 1);
      }
      __pyx_L17:;
    }

    /* "openpiv/process.pyx":1157
 *                 low = low + np.floor((maxhigh-low)/2)
 *                 high = low + 1
 *         return low, high             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError( "no valid side for F-dichotomy!" )
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_low); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_high); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "openpiv/process.pyx":1139
 *                 high = low + 1
 *         return low, high
 *     elif side == 'y_axis':             # <<<<<<<<<<<<<<
 *         while searching:#start dichotomy
 *             if pos_now == F[K,0,low,1] or (low == 0 and pos_now < F[K,0,low,1]):
 */
  }

  /* "openpiv/process.pyx":1159
 *         return low, high
 *     else:
 *         raise ValueError( "no valid side for F-dichotomy!" )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1159, __pyx_L1_error)
  }

  /* "openpiv/process.pyx":1082
 * 
 * 
 * def F_dichotomy( np.ndarray[DTYPEf_t, ndim=4] F, int K, np.ndarray[DTYPEi_t, ndim=1] N, str side, int pos_now):             # <<<<<<<<<<<<<<
 *     """Look for the position at the iteration K of the points surrounding a given point in the frame.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_38);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_N.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("openpiv.process.F_dichotomy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_N.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1167
 * 
 * 
 * def define_windows( int size ):             # <<<<<<<<<<<<<<
 *     """Define two windows of a given size (trick to allow the use of cdef during an iterative process)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_21define_windows(PyObject *__pyx_self, PyObject *__pyx_arg_size); /*proto*/
static char __pyx_doc_7openpiv_7process_20define_windows[] = "Define two windows of a given size (trick to allow the use of cdef during an iterative process)\n    \n    Parameters\n    ----------\n    size : int\n        size of the two windows\n       \n    Returns\n    -------\n    window_a, window_b : two 2d np.ndarray of zero (integer)\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_21define_windows = {"define_windows", (PyCFunction)__pyx_pw_7openpiv_7process_21define_windows, METH_O, __pyx_doc_7openpiv_7process_20define_windows};
static PyObject *__pyx_pw_7openpiv_7process_21define_windows(PyObject *__pyx_self, PyObject *__pyx_arg_size) {
  int __pyx_v_size;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("define_windows (wrapper)", 0);
  assert(__pyx_arg_size); {
    __pyx_v_size = __Pyx_PyInt_As_int(__pyx_arg_size); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1167, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.define_windows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_20define_windows(__pyx_self, ((int)__pyx_v_size));

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

static PyObject *__pyx_pf_7openpiv_7process_20define_windows(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_size) {
  PyArrayObject *__pyx_v_window_a = 0;
  PyArrayObject *__pyx_v_window_b = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_window_a;
  __Pyx_Buffer __pyx_pybuffer_window_a;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_window_b;
  __Pyx_Buffer __pyx_pybuffer_window_b;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("define_windows", 0);
  __pyx_pybuffer_window_a.pybuffer.buf = NULL;
  __pyx_pybuffer_window_a.refcount = 0;
  __pyx_pybuffernd_window_a.data = NULL;
  __pyx_pybuffernd_window_a.rcbuffer = &__pyx_pybuffer_window_a;
  __pyx_pybuffer_window_b.pybuffer.buf = NULL;
  __pyx_pybuffer_window_b.refcount = 0;
  __pyx_pybuffernd_window_b.data = NULL;
  __pyx_pybuffernd_window_b.rcbuffer = &__pyx_pybuffer_window_b;

  /* "openpiv/process.pyx":1180
 * 
 *     """
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_a = np.zeros([size, size], dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_b = np.zeros([size, size], dtype=DTYPEi)
 *     return window_a, window_b
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __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;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1180, __pyx_L1_error)
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_window_a.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_window_a = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_window_a.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1180, __pyx_L1_error)
    } else {__pyx_pybuffernd_window_a.diminfo[0].strides = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_window_a.diminfo[0].shape = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_window_a.diminfo[1].strides = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_window_a.diminfo[1].shape = __pyx_pybuffernd_window_a.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_5 = 0;
  __pyx_v_window_a = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":1181
 *     """
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_a = np.zeros([size, size], dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_b = np.zeros([size, size], dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     return window_a, window_b
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1181, __pyx_L1_error)
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_window_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_window_b = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_window_b.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1181, __pyx_L1_error)
    } else {__pyx_pybuffernd_window_b.diminfo[0].strides = __pyx_pybuffernd_window_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_window_b.diminfo[0].shape = __pyx_pybuffernd_window_b.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_window_b.diminfo[1].strides = __pyx_pybuffernd_window_b.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_window_b.diminfo[1].shape = __pyx_pybuffernd_window_b.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_window_b = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "openpiv/process.pyx":1182
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_a = np.zeros([size, size], dtype=DTYPEi)
 *     cdef np.ndarray[DTYPEi_t, ndim=2] window_b = np.zeros([size, size], dtype=DTYPEi)
 *     return window_a, window_b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_window_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_window_a));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_window_a));
  __Pyx_INCREF(((PyObject *)__pyx_v_window_b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_window_b));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_window_b));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":1167
 * 
 * 
 * def define_windows( int size ):             # <<<<<<<<<<<<<<
 *     """Define two windows of a given size (trick to allow the use of cdef during an iterative process)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_window_a.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_window_b.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("openpiv.process.define_windows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_window_a.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_window_b.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_window_a);
  __Pyx_XDECREF((PyObject *)__pyx_v_window_b);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1189
 * 
 * 
 * def find_neighbours(int I, int J, int Imax, int Jmax):             # <<<<<<<<<<<<<<
 *     """Find the neighbours of a point I,J in an array of size Imax+1, Jmax+1
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_23find_neighbours(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_22find_neighbours[] = "Find the neighbours of a point I,J in an array of size Imax+1, Jmax+1\n    \n    Parameters\n    ----------\n    I,J : int\n        indices of the point of interest\n       \n    Imax,Jmax : int\n        max indices for the neighbours (ie. (size of the array) - 1)\n       \n    Returns\n    -------\n    neighbours : 2d np.ndarray of size 3*3 \n        containing value 1 if neighbour is present, 0 if not. Value is 0 at the center (corresponds to point I,J).\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_23find_neighbours = {"find_neighbours", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_23find_neighbours, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_22find_neighbours};
static PyObject *__pyx_pw_7openpiv_7process_23find_neighbours(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_I;
  int __pyx_v_J;
  int __pyx_v_Imax;
  int __pyx_v_Jmax;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find_neighbours (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_Imax,&__pyx_n_s_Jmax,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("find_neighbours", 1, 4, 4, 1); __PYX_ERR(0, 1189, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Imax)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("find_neighbours", 1, 4, 4, 2); __PYX_ERR(0, 1189, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Jmax)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("find_neighbours", 1, 4, 4, 3); __PYX_ERR(0, 1189, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_neighbours") < 0)) __PYX_ERR(0, 1189, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_I = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_I == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1189, __pyx_L3_error)
    __pyx_v_J = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_J == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1189, __pyx_L3_error)
    __pyx_v_Imax = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_Imax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1189, __pyx_L3_error)
    __pyx_v_Jmax = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_Jmax == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1189, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("find_neighbours", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1189, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.find_neighbours", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_22find_neighbours(__pyx_self, __pyx_v_I, __pyx_v_J, __pyx_v_Imax, __pyx_v_Jmax);

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

static PyObject *__pyx_pf_7openpiv_7process_22find_neighbours(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_I, int __pyx_v_J, int __pyx_v_Imax, int __pyx_v_Jmax) {
  PyArrayObject *__pyx_v_neighbours = 0;
  int __pyx_v_k;
  int __pyx_v_l;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_neighbours;
  __Pyx_Buffer __pyx_pybuffer_neighbours;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  __Pyx_RefNannySetupContext("find_neighbours", 0);
  __pyx_pybuffer_neighbours.pybuffer.buf = NULL;
  __pyx_pybuffer_neighbours.refcount = 0;
  __pyx_pybuffernd_neighbours.data = NULL;
  __pyx_pybuffernd_neighbours.rcbuffer = &__pyx_pybuffer_neighbours;

  /* "openpiv/process.pyx":1206
 * 
 *     """
 *     cdef np.ndarray[DTYPEi_t, ndim=2] neighbours = np.zeros([3,3], dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef int k,l
 *     for k in range(3):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DTYPEi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1206, __pyx_L1_error)
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_neighbours.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_7openpiv_7process_DTYPEi_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_neighbours = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1206, __pyx_L1_error)
    } else {__pyx_pybuffernd_neighbours.diminfo[0].strides = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_neighbours.diminfo[0].shape = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_neighbours.diminfo[1].strides = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_neighbours.diminfo[1].shape = __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_5 = 0;
  __pyx_v_neighbours = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "openpiv/process.pyx":1208
 *     cdef np.ndarray[DTYPEi_t, ndim=2] neighbours = np.zeros([3,3], dtype=DTYPEi)
 *     cdef int k,l
 *     for k in range(3):             # <<<<<<<<<<<<<<
 *         for l in range(3):
 *             neighbours[k,l]=1
 */
  for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) {
    __pyx_v_k = __pyx_t_6;

    /* "openpiv/process.pyx":1209
 *     cdef int k,l
 *     for k in range(3):
 *         for l in range(3):             # <<<<<<<<<<<<<<
 *             neighbours[k,l]=1
 *     neighbours[1,1]=0
 */
    for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) {
      __pyx_v_l = __pyx_t_7;

      /* "openpiv/process.pyx":1210
 *     for k in range(3):
 *         for l in range(3):
 *             neighbours[k,l]=1             # <<<<<<<<<<<<<<
 *     neighbours[1,1]=0
 *     if I == 0:
 */
      __pyx_t_8 = __pyx_v_k;
      __pyx_t_9 = __pyx_v_l;
      __pyx_t_10 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_8 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
        if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_10 = 0;
      if (__pyx_t_9 < 0) {
        __pyx_t_9 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
        if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        __PYX_ERR(0, 1210, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 1;
    }
  }

  /* "openpiv/process.pyx":1211
 *         for l in range(3):
 *             neighbours[k,l]=1
 *     neighbours[1,1]=0             # <<<<<<<<<<<<<<
 *     if I == 0:
 *         neighbours[0,0]=0
 */
  __pyx_t_11 = 1;
  __pyx_t_12 = 1;
  __pyx_t_6 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_6 = 1;
  } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1211, __pyx_L1_error)
  }
  *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

  /* "openpiv/process.pyx":1212
 *             neighbours[k,l]=1
 *     neighbours[1,1]=0
 *     if I == 0:             # <<<<<<<<<<<<<<
 *         neighbours[0,0]=0
 *         neighbours[0,1]=0
 */
  __pyx_t_13 = ((__pyx_v_I == 0) != 0);
  if (__pyx_t_13) {

    /* "openpiv/process.pyx":1213
 *     neighbours[1,1]=0
 *     if I == 0:
 *         neighbours[0,0]=0             # <<<<<<<<<<<<<<
 *         neighbours[0,1]=0
 *         neighbours[0,2]=0
 */
    __pyx_t_14 = 0;
    __pyx_t_15 = 0;
    __pyx_t_6 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1213, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1214
 *     if I == 0:
 *         neighbours[0,0]=0
 *         neighbours[0,1]=0             # <<<<<<<<<<<<<<
 *         neighbours[0,2]=0
 *     if J == 0:
 */
    __pyx_t_16 = 0;
    __pyx_t_17 = 1;
    __pyx_t_6 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1214, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1215
 *         neighbours[0,0]=0
 *         neighbours[0,1]=0
 *         neighbours[0,2]=0             # <<<<<<<<<<<<<<
 *     if J == 0:
 *         neighbours[0,0]=0
 */
    __pyx_t_18 = 0;
    __pyx_t_19 = 2;
    __pyx_t_6 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1215, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1212
 *             neighbours[k,l]=1
 *     neighbours[1,1]=0
 *     if I == 0:             # <<<<<<<<<<<<<<
 *         neighbours[0,0]=0
 *         neighbours[0,1]=0
 */
  }

  /* "openpiv/process.pyx":1216
 *         neighbours[0,1]=0
 *         neighbours[0,2]=0
 *     if J == 0:             # <<<<<<<<<<<<<<
 *         neighbours[0,0]=0
 *         neighbours[1,0]=0
 */
  __pyx_t_13 = ((__pyx_v_J == 0) != 0);
  if (__pyx_t_13) {

    /* "openpiv/process.pyx":1217
 *         neighbours[0,2]=0
 *     if J == 0:
 *         neighbours[0,0]=0             # <<<<<<<<<<<<<<
 *         neighbours[1,0]=0
 *         neighbours[2,0]=0
 */
    __pyx_t_20 = 0;
    __pyx_t_21 = 0;
    __pyx_t_6 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_21 < 0) {
      __pyx_t_21 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1217, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1218
 *     if J == 0:
 *         neighbours[0,0]=0
 *         neighbours[1,0]=0             # <<<<<<<<<<<<<<
 *         neighbours[2,0]=0
 *     if I == Imax:
 */
    __pyx_t_22 = 1;
    __pyx_t_23 = 0;
    __pyx_t_6 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_23 < 0) {
      __pyx_t_23 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1218, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1219
 *         neighbours[0,0]=0
 *         neighbours[1,0]=0
 *         neighbours[2,0]=0             # <<<<<<<<<<<<<<
 *     if I == Imax:
 *         neighbours[2,0]=0
 */
    __pyx_t_24 = 2;
    __pyx_t_25 = 0;
    __pyx_t_6 = -1;
    if (__pyx_t_24 < 0) {
      __pyx_t_24 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_24 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_25 < 0) {
      __pyx_t_25 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_25 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1219, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1216
 *         neighbours[0,1]=0
 *         neighbours[0,2]=0
 *     if J == 0:             # <<<<<<<<<<<<<<
 *         neighbours[0,0]=0
 *         neighbours[1,0]=0
 */
  }

  /* "openpiv/process.pyx":1220
 *         neighbours[1,0]=0
 *         neighbours[2,0]=0
 *     if I == Imax:             # <<<<<<<<<<<<<<
 *         neighbours[2,0]=0
 *         neighbours[2,1]=0
 */
  __pyx_t_13 = ((__pyx_v_I == __pyx_v_Imax) != 0);
  if (__pyx_t_13) {

    /* "openpiv/process.pyx":1221
 *         neighbours[2,0]=0
 *     if I == Imax:
 *         neighbours[2,0]=0             # <<<<<<<<<<<<<<
 *         neighbours[2,1]=0
 *         neighbours[2,2]=0
 */
    __pyx_t_26 = 2;
    __pyx_t_27 = 0;
    __pyx_t_6 = -1;
    if (__pyx_t_26 < 0) {
      __pyx_t_26 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_26 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_27 < 0) {
      __pyx_t_27 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_27 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1221, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1222
 *     if I == Imax:
 *         neighbours[2,0]=0
 *         neighbours[2,1]=0             # <<<<<<<<<<<<<<
 *         neighbours[2,2]=0
 *     if J == Jmax:
 */
    __pyx_t_28 = 2;
    __pyx_t_29 = 1;
    __pyx_t_6 = -1;
    if (__pyx_t_28 < 0) {
      __pyx_t_28 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_28 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_29 < 0) {
      __pyx_t_29 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_29 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1222, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1223
 *         neighbours[2,0]=0
 *         neighbours[2,1]=0
 *         neighbours[2,2]=0             # <<<<<<<<<<<<<<
 *     if J == Jmax:
 *         neighbours[0,2]=0
 */
    __pyx_t_30 = 2;
    __pyx_t_31 = 2;
    __pyx_t_6 = -1;
    if (__pyx_t_30 < 0) {
      __pyx_t_30 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_30 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_31 < 0) {
      __pyx_t_31 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_31 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1223, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1220
 *         neighbours[1,0]=0
 *         neighbours[2,0]=0
 *     if I == Imax:             # <<<<<<<<<<<<<<
 *         neighbours[2,0]=0
 *         neighbours[2,1]=0
 */
  }

  /* "openpiv/process.pyx":1224
 *         neighbours[2,1]=0
 *         neighbours[2,2]=0
 *     if J == Jmax:             # <<<<<<<<<<<<<<
 *         neighbours[0,2]=0
 *         neighbours[1,2]=0
 */
  __pyx_t_13 = ((__pyx_v_J == __pyx_v_Jmax) != 0);
  if (__pyx_t_13) {

    /* "openpiv/process.pyx":1225
 *         neighbours[2,2]=0
 *     if J == Jmax:
 *         neighbours[0,2]=0             # <<<<<<<<<<<<<<
 *         neighbours[1,2]=0
 *         neighbours[2,2]=0
 */
    __pyx_t_32 = 0;
    __pyx_t_33 = 2;
    __pyx_t_6 = -1;
    if (__pyx_t_32 < 0) {
      __pyx_t_32 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_32 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_33 < 0) {
      __pyx_t_33 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_33 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1225, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1226
 *     if J == Jmax:
 *         neighbours[0,2]=0
 *         neighbours[1,2]=0             # <<<<<<<<<<<<<<
 *         neighbours[2,2]=0
 *     return neighbours
 */
    __pyx_t_34 = 1;
    __pyx_t_35 = 2;
    __pyx_t_6 = -1;
    if (__pyx_t_34 < 0) {
      __pyx_t_34 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_34 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_35 < 0) {
      __pyx_t_35 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_35 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1226, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1227
 *         neighbours[0,2]=0
 *         neighbours[1,2]=0
 *         neighbours[2,2]=0             # <<<<<<<<<<<<<<
 *     return neighbours
 * 
 */
    __pyx_t_36 = 2;
    __pyx_t_37 = 2;
    __pyx_t_6 = -1;
    if (__pyx_t_36 < 0) {
      __pyx_t_36 += __pyx_pybuffernd_neighbours.diminfo[0].shape;
      if (unlikely(__pyx_t_36 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_neighbours.diminfo[0].shape)) __pyx_t_6 = 0;
    if (__pyx_t_37 < 0) {
      __pyx_t_37 += __pyx_pybuffernd_neighbours.diminfo[1].shape;
      if (unlikely(__pyx_t_37 < 0)) __pyx_t_6 = 1;
    } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_neighbours.diminfo[1].shape)) __pyx_t_6 = 1;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 1227, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_7openpiv_7process_DTYPEi_t *, __pyx_pybuffernd_neighbours.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_neighbours.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_neighbours.diminfo[1].strides) = 0;

    /* "openpiv/process.pyx":1224
 *         neighbours[2,1]=0
 *         neighbours[2,2]=0
 *     if J == Jmax:             # <<<<<<<<<<<<<<
 *         neighbours[0,2]=0
 *         neighbours[1,2]=0
 */
  }

  /* "openpiv/process.pyx":1228
 *         neighbours[1,2]=0
 *         neighbours[2,2]=0
 *     return neighbours             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_neighbours));
  __pyx_r = ((PyObject *)__pyx_v_neighbours);
  goto __pyx_L0;

  /* "openpiv/process.pyx":1189
 * 
 * 
 * def find_neighbours(int I, int J, int Imax, int Jmax):             # <<<<<<<<<<<<<<
 *     """Find the neighbours of a point I,J in an array of size Imax+1, Jmax+1
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_neighbours.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("openpiv.process.find_neighbours", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_neighbours.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_neighbours);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1237
 * 
 * 
 * def sumsquare_array(arr1):             # <<<<<<<<<<<<<<
 *     """Compute the sum of the square of the elements of a given array or list
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_25sumsquare_array(PyObject *__pyx_self, PyObject *__pyx_v_arr1); /*proto*/
static char __pyx_doc_7openpiv_7process_24sumsquare_array[] = "Compute the sum of the square of the elements of a given array or list\n    \n    Parameters\n    ----------\n    arr1 : array or list of any size\n\n    Returns\n    -------\n    result : float\n        = sum( arr1_i * arr1_i)\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_25sumsquare_array = {"sumsquare_array", (PyCFunction)__pyx_pw_7openpiv_7process_25sumsquare_array, METH_O, __pyx_doc_7openpiv_7process_24sumsquare_array};
static PyObject *__pyx_pw_7openpiv_7process_25sumsquare_array(PyObject *__pyx_self, PyObject *__pyx_v_arr1) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sumsquare_array (wrapper)", 0);
  __pyx_r = __pyx_pf_7openpiv_7process_24sumsquare_array(__pyx_self, ((PyObject *)__pyx_v_arr1));

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

static PyObject *__pyx_pf_7openpiv_7process_24sumsquare_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr1) {
  float __pyx_v_result;
  PyObject *__pyx_v_I = 0;
  PyObject *__pyx_v_J = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  float __pyx_t_11;
  __Pyx_RefNannySetupContext("sumsquare_array", 0);

  /* "openpiv/process.pyx":1252
 *     cdef float result
 *     cdef I, J
 *     result = 0             # <<<<<<<<<<<<<<
 *     for I in range(arr1.shape[0]):
 *         for J in range(arr1.shape[1]):
 */
  __pyx_v_result = 0.0;

  /* "openpiv/process.pyx":1253
 *     cdef I, J
 *     result = 0
 *     for I in range(arr1.shape[0]):             # <<<<<<<<<<<<<<
 *         for J in range(arr1.shape[1]):
 *             result = result + arr1[I,J]*arr1[I,J]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr1, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1253, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1253, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1253, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_I, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "openpiv/process.pyx":1254
 *     result = 0
 *     for I in range(arr1.shape[0]):
 *         for J in range(arr1.shape[1]):             # <<<<<<<<<<<<<<
 *             result = result + arr1[I,J]*arr1[I,J]
 *     return result
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr1, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1254, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1254, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1254, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1254, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_J, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "openpiv/process.pyx":1255
 *     for I in range(arr1.shape[0]):
 *         for J in range(arr1.shape[1]):
 *             result = result + arr1[I,J]*arr1[I,J]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_I);
      __Pyx_GIVEREF(__pyx_v_I);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_I);
      __Pyx_INCREF(__pyx_v_J);
      __Pyx_GIVEREF(__pyx_v_J);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_J);
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_arr1, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_I);
      __Pyx_GIVEREF(__pyx_v_I);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_I);
      __Pyx_INCREF(__pyx_v_J);
      __Pyx_GIVEREF(__pyx_v_J);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_J);
      __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_arr1, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Multiply(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_result = __pyx_t_11;

      /* "openpiv/process.pyx":1254
 *     result = 0
 *     for I in range(arr1.shape[0]):
 *         for J in range(arr1.shape[1]):             # <<<<<<<<<<<<<<
 *             result = result + arr1[I,J]*arr1[I,J]
 *     return result
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "openpiv/process.pyx":1253
 *     cdef I, J
 *     result = 0
 *     for I in range(arr1.shape[0]):             # <<<<<<<<<<<<<<
 *         for J in range(arr1.shape[1]):
 *             result = result + arr1[I,J]*arr1[I,J]
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1256
 *         for J in range(arr1.shape[1]):
 *             result = result + arr1[I,J]*arr1[I,J]
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":1237
 * 
 * 
 * def sumsquare_array(arr1):             # <<<<<<<<<<<<<<
 *     """Compute the sum of the square of the elements of a given array or list
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("openpiv.process.sumsquare_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_I);
  __Pyx_XDECREF(__pyx_v_J);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1263
 * 
 * 
 * def launch( str method, names, arg ):             # <<<<<<<<<<<<<<
 *     """A nice launcher for any openpiv function, printing a header in terminal with a list of the parameters used.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_27launch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7openpiv_7process_26launch[] = "A nice launcher for any openpiv function, printing a header in terminal with a list of the parameters used.\n    \n    Parameters\n    ----------\n    method : string\n        the name of the algorithm used\n\n    names : list of string\n        names of the parameters to print\n\n    arg : list of parameters of different types\n\n    Returns\n    -------\n    StartTime : float \n        the current time --> can be used to print the execution time of the programm at the end.\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_27launch = {"launch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7openpiv_7process_27launch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7openpiv_7process_26launch};
static PyObject *__pyx_pw_7openpiv_7process_27launch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_arg = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("launch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_names,&__pyx_n_s_arg,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("launch", 1, 3, 3, 1); __PYX_ERR(0, 1263, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("launch", 1, 3, 3, 2); __PYX_ERR(0, 1263, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "launch") < 0)) __PYX_ERR(0, 1263, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_method = ((PyObject*)values[0]);
    __pyx_v_names = values[1];
    __pyx_v_arg = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("launch", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1263, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.launch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method), (&PyString_Type), 1, "method", 1))) __PYX_ERR(0, 1263, __pyx_L1_error)
  __pyx_r = __pyx_pf_7openpiv_7process_26launch(__pyx_self, __pyx_v_method, __pyx_v_names, __pyx_v_arg);

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

static PyObject *__pyx_pf_7openpiv_7process_26launch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method, PyObject *__pyx_v_names, PyObject *__pyx_v_arg) {
  Py_ssize_t __pyx_v_i;
  float __pyx_v_StartTime;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  float __pyx_t_7;
  __Pyx_RefNannySetupContext("launch", 0);

  /* "openpiv/process.pyx":1282
 * 
 *     """
 *     print( '----------------------------------------------------------')             # <<<<<<<<<<<<<<
 *     print('|----->     ||   The Open Source  P article              |')
 *     print('| Open      ||                    I mage                 |')
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__16) < 0) __PYX_ERR(0, 1282, __pyx_L1_error)

  /* "openpiv/process.pyx":1283
 *     """
 *     print( '----------------------------------------------------------')
 *     print('|----->     ||   The Open Source  P article              |')             # <<<<<<<<<<<<<<
 *     print('| Open      ||                    I mage                 |')
 *     print('|     PIV   ||                    V elocimetry  Toolbox  |')
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_The_Open_Source_P_article) < 0) __PYX_ERR(0, 1283, __pyx_L1_error)

  /* "openpiv/process.pyx":1284
 *     print( '----------------------------------------------------------')
 *     print('|----->     ||   The Open Source  P article              |')
 *     print('| Open      ||                    I mage                 |')             # <<<<<<<<<<<<<<
 *     print('|     PIV   ||                    V elocimetry  Toolbox  |')
 *     print('|     <-----||   www.openpiv.net          version 1.0    |')
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_Open_I_mage) < 0) __PYX_ERR(0, 1284, __pyx_L1_error)

  /* "openpiv/process.pyx":1285
 *     print('|----->     ||   The Open Source  P article              |')
 *     print('| Open      ||                    I mage                 |')
 *     print('|     PIV   ||                    V elocimetry  Toolbox  |')             # <<<<<<<<<<<<<<
 *     print('|     <-----||   www.openpiv.net          version 1.0    |')
 *     print('----------------------------------------------------------')
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_PIV_V_elocimetry_Toolbox) < 0) __PYX_ERR(0, 1285, __pyx_L1_error)

  /* "openpiv/process.pyx":1286
 *     print('| Open      ||                    I mage                 |')
 *     print('|     PIV   ||                    V elocimetry  Toolbox  |')
 *     print('|     <-----||   www.openpiv.net          version 1.0    |')             # <<<<<<<<<<<<<<
 *     print('----------------------------------------------------------')
 *     print(" ")
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_www_openpiv_net_version_1_0) < 0) __PYX_ERR(0, 1286, __pyx_L1_error)

  /* "openpiv/process.pyx":1287
 *     print('|     PIV   ||                    V elocimetry  Toolbox  |')
 *     print('|     <-----||   www.openpiv.net          version 1.0    |')
 *     print('----------------------------------------------------------')             # <<<<<<<<<<<<<<
 *     print(" ")
 *     print("Algorithm : ", method)
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__16) < 0) __PYX_ERR(0, 1287, __pyx_L1_error)

  /* "openpiv/process.pyx":1288
 *     print('|     <-----||   www.openpiv.net          version 1.0    |')
 *     print('----------------------------------------------------------')
 *     print(" ")             # <<<<<<<<<<<<<<
 *     print("Algorithm : ", method)
 *     print(" ")
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__11) < 0) __PYX_ERR(0, 1288, __pyx_L1_error)

  /* "openpiv/process.pyx":1289
 *     print('----------------------------------------------------------')
 *     print(" ")
 *     print("Algorithm : ", method)             # <<<<<<<<<<<<<<
 *     print(" ")
 *     print("Parameters   ")
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_kp_s_Algorithm);
  __Pyx_GIVEREF(__pyx_kp_s_Algorithm);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_Algorithm);
  __Pyx_INCREF(__pyx_v_method);
  __Pyx_GIVEREF(__pyx_v_method);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_method);
  if (__Pyx_PrintOne(0, __pyx_t_1) < 0) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":1290
 *     print(" ")
 *     print("Algorithm : ", method)
 *     print(" ")             # <<<<<<<<<<<<<<
 *     print("Parameters   ")
 *     print("-----------------------------------")
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__11) < 0) __PYX_ERR(0, 1290, __pyx_L1_error)

  /* "openpiv/process.pyx":1291
 *     print("Algorithm : ", method)
 *     print(" ")
 *     print("Parameters   ")             # <<<<<<<<<<<<<<
 *     print("-----------------------------------")
 *     for i in range(len(arg)-1):
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_Parameters) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)

  /* "openpiv/process.pyx":1292
 *     print(" ")
 *     print("Parameters   ")
 *     print("-----------------------------------")             # <<<<<<<<<<<<<<
 *     for i in range(len(arg)-1):
 *         print("     ", names[i], " | ", arg[i])
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__17) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)

  /* "openpiv/process.pyx":1293
 *     print("Parameters   ")
 *     print("-----------------------------------")
 *     for i in range(len(arg)-1):             # <<<<<<<<<<<<<<
 *         print("     ", names[i], " | ", arg[i])
 *     print("-----------------------------------")
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_arg); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1293, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 - 1);
  __pyx_t_2 = __pyx_t_3;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "openpiv/process.pyx":1294
 *     print("-----------------------------------")
 *     for i in range(len(arg)-1):
 *         print("     ", names[i], " | ", arg[i])             # <<<<<<<<<<<<<<
 *     print("-----------------------------------")
 *     print("|           STARTING              |")
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_arg, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_kp_s__18);
    __Pyx_GIVEREF(__pyx_kp_s__18);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s__18);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_kp_s__19);
    __Pyx_GIVEREF(__pyx_kp_s__19);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_s__19);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    if (__Pyx_PrintOne(0, __pyx_t_6) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "openpiv/process.pyx":1295
 *     for i in range(len(arg)-1):
 *         print("     ", names[i], " | ", arg[i])
 *     print("-----------------------------------")             # <<<<<<<<<<<<<<
 *     print("|           STARTING              |")
 *     print("-----------------------------------")
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__17) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)

  /* "openpiv/process.pyx":1296
 *         print("     ", names[i], " | ", arg[i])
 *     print("-----------------------------------")
 *     print("|           STARTING              |")             # <<<<<<<<<<<<<<
 *     print("-----------------------------------")
 *     cdef float StartTime  = time.time()
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_STARTING) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)

  /* "openpiv/process.pyx":1297
 *     print("-----------------------------------")
 *     print("|           STARTING              |")
 *     print("-----------------------------------")             # <<<<<<<<<<<<<<
 *     cdef float StartTime  = time.time()
 *     return StartTime
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__17) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)

  /* "openpiv/process.pyx":1298
 *     print("|           STARTING              |")
 *     print("-----------------------------------")
 *     cdef float StartTime  = time.time()             # <<<<<<<<<<<<<<
 *     return StartTime
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_StartTime = __pyx_t_7;

  /* "openpiv/process.pyx":1299
 *     print("-----------------------------------")
 *     cdef float StartTime  = time.time()
 *     return StartTime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_StartTime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "openpiv/process.pyx":1263
 * 
 * 
 * def launch( str method, names, arg ):             # <<<<<<<<<<<<<<
 *     """A nice launcher for any openpiv function, printing a header in terminal with a list of the parameters used.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("openpiv.process.launch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "openpiv/process.pyx":1305
 * 
 * 
 * def end( float startTime ):             # <<<<<<<<<<<<<<
 *     """A function that prints the time since startTime. Used to end nicely a programm
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7openpiv_7process_29end(PyObject *__pyx_self, PyObject *__pyx_arg_startTime); /*proto*/
static char __pyx_doc_7openpiv_7process_28end[] = "A function that prints the time since startTime. Used to end nicely a programm\n    \n    Parameters\n    ----------\n    startTime : float\n        a time\n    \n    ";
static PyMethodDef __pyx_mdef_7openpiv_7process_29end = {"end", (PyCFunction)__pyx_pw_7openpiv_7process_29end, METH_O, __pyx_doc_7openpiv_7process_28end};
static PyObject *__pyx_pw_7openpiv_7process_29end(PyObject *__pyx_self, PyObject *__pyx_arg_startTime) {
  float __pyx_v_startTime;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("end (wrapper)", 0);
  assert(__pyx_arg_startTime); {
    __pyx_v_startTime = __pyx_PyFloat_AsFloat(__pyx_arg_startTime); if (unlikely((__pyx_v_startTime == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1305, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("openpiv.process.end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7openpiv_7process_28end(__pyx_self, ((float)__pyx_v_startTime));

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

static PyObject *__pyx_pf_7openpiv_7process_28end(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_startTime) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("end", 0);

  /* "openpiv/process.pyx":1314
 * 
 *     """
 *     print("-------------------------------------------------------------")             # <<<<<<<<<<<<<<
 *     print("[DONE] ..after ", (time.time() - startTime), "seconds ")
 *     print("-------------------------------------------------------------")
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__20) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)

  /* "openpiv/process.pyx":1315
 *     """
 *     print("-------------------------------------------------------------")
 *     print("[DONE] ..after ", (time.time() - startTime), "seconds ")             # <<<<<<<<<<<<<<
 *     print("-------------------------------------------------------------")
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_startTime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_kp_s_DONE_after);
  __Pyx_GIVEREF(__pyx_kp_s_DONE_after);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_DONE_after);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_INCREF(__pyx_kp_s_seconds);
  __Pyx_GIVEREF(__pyx_kp_s_seconds);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s_seconds);
  __pyx_t_2 = 0;
  if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "openpiv/process.pyx":1316
 *     print("-------------------------------------------------------------")
 *     print("[DONE] ..after ", (time.time() - startTime), "seconds ")
 *     print("-------------------------------------------------------------")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s__20) < 0) __PYX_ERR(0, 1316, __pyx_L1_error)

  /* "openpiv/process.pyx":1305
 * 
 * 
 * def end( float startTime ):             # <<<<<<<<<<<<<<
 *     """A function that prints the time since startTime. Used to end nicely a programm
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("openpiv.process.end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *         # 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 fulfill the PEP.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_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_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyArray_Descr *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  if (__pyx_v_info == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":265
 * 
 *             cdef int i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":266
 *             cdef int 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);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":268
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *             ndim = PyArray_NDIM(self)
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":271
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *             ndim = PyArray_NDIM(self)
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  if (unlikely(__pyx_t_1)) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 272, __pyx_L1_error)

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *             ndim = PyArray_NDIM(self)
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":275
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  if (unlikely(__pyx_t_1)) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 276, __pyx_L1_error)

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":278
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":279
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
 *                 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);

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":286
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":287
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
    goto __pyx_L9;
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":289
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L9:;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":291
 *                 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;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":292
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":296
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = <dtype>PyArray_DESCR(self)
 *             cdef int offset
 */
  __pyx_v_f = NULL;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":297
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
 *             cdef int offset
 * 
 */
  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
  __pyx_t_3 = ((PyObject *)__pyx_t_7);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":300
 *             cdef int offset
 * 
 *             info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not PyDataType_HASFIELDS(descr):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":302
 *             info.obj = self
 * 
 *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":303
 * 
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L15_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_L15_next_or:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":305
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L14_bool_binop_done:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    if (unlikely(__pyx_t_1)) {

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":306
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 306, __pyx_L1_error)

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
 *             if not PyDataType_HASFIELDS(descr):
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":307
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = ((char *)"b");
      break;
      case NPY_UBYTE:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":308
 *                     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_v_f = ((char *)"B");
      break;
      case NPY_SHORT:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":309
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      __pyx_v_f = ((char *)"h");
      break;
      case NPY_USHORT:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":310
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      __pyx_v_f = ((char *)"H");
      break;
      case NPY_INT:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":311
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      __pyx_v_f = ((char *)"i");
      break;
      case NPY_UINT:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":312
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      __pyx_v_f = ((char *)"I");
      break;
      case NPY_LONG:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":313
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      __pyx_v_f = ((char *)"l");
      break;
      case NPY_ULONG:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":314
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      __pyx_v_f = ((char *)"L");
      break;
      case NPY_LONGLONG:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":315
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      __pyx_v_f = ((char *)"q");
      break;
      case NPY_ULONGLONG:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":316
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      __pyx_v_f = ((char *)"Q");
      break;
      case NPY_FLOAT:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":317
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      __pyx_v_f = ((char *)"f");
      break;
      case NPY_DOUBLE:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":318
 *                 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_v_f = ((char *)"d");
      break;
      case NPY_LONGDOUBLE:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":319
 *                 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_v_f = ((char *)"g");
      break;
      case NPY_CFLOAT:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":320
 *                 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_v_f = ((char *)"Zf");
      break;
      case NPY_CDOUBLE:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":321
 *                 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_v_f = ((char *)"Zd");
      break;
      case NPY_CLONGDOUBLE:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":322
 *                 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_v_f = ((char *)"Zg");
      break;
      case NPY_OBJECT:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":323
 *                 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_v_f = ((char *)"O");
      break;
      default:

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":325
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 325, __pyx_L1_error)
      break;
    }

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":326
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":327
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":302
 *             info.obj = self
 * 
 *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":329
 *                 return
 *             else:
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":330
 *             else:
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":331
 *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":332
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
    __pyx_v_f = __pyx_t_9;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":335
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *         # 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 fulfill the PEP.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":337
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

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

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":338
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":339
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 PyObject_Free(info.strides)
 */
    PyObject_Free(__pyx_v_info->format);

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":338
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":340
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":341
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    PyObject_Free(__pyx_v_info->strides);

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":340
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 PyObject_Free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":337
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 PyObject_Free(info.format)
 */

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

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":822
 * 
 * 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_ERR(1, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":824
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":825
 * 
 * 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_ERR(1, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":824
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":827
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":828
 * 
 * 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_ERR(1, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":827
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":831
 * 
 * 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_ERR(1, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":834
 * 
 * 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 tuple PyDataType_SHAPE(dtype d):
 */
  __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_ERR(1, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":837
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  if (__pyx_t_1) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":838
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
    __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
    goto __pyx_L0;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":837
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":840
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_r = __pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

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

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *         return ()
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":847
 * 
 *     cdef dtype child
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":848
 *     cdef dtype child
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":851
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 851, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":852
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 852, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":853
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 853, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":855
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (unlikely(__pyx_t_6)) {

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":856
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 856, __pyx_L1_error)

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":855
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":858
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":859
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":858
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    if (unlikely(__pyx_t_6)) {

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":860
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 860, __pyx_L1_error)

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":858
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":870
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":871
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 0x78;

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":872
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":873
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":875
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":877
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":878
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":879
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (unlikely(__pyx_t_6)) {

        /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":880
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(1, 880, __pyx_L1_error)

        /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":879
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":883
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":884
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":885
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":886
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":887
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":888
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":889
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":890
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":891
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":892
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":893
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":894
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":895
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":896
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x66;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":897
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __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]) = 0x64;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":898
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x67;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":899
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (likely(__pyx_t_6)) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":901
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(1, 901, __pyx_L1_error)
      }
      __pyx_L15:;

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":902
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":877
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":906
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error)
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":851
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":907
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *         return ()
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1022
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1023
 * 
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
 */
  Py_INCREF(__pyx_v_base);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1024
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1022
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

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

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1026
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1027
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
 */
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1028
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1029
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1028
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1030
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1026
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

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

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1034
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_array()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1035
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1036
 * cdef inline int import_array() except -1:
 *     try:
 *         _import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")
 */
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1035
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1037
 *     try:
 *         _import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1038
 *         _import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1038, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1035
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1034
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_array()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1040
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1041
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1042
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1041
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1043
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1044
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1044, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1041
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1040
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1047
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1048
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1047
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1049
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1050
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1050, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1047
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  static const char* internal_type_names[] = {
    "DTYPEf_t",
    "DTYPEi_t",
    "__pyx_ctuple_8c561____dunderpyx_ctuple_npy_intp__dunderand_npy_intp__and_int__and_int__etc",
    "__pyx_ctuple_8c561____dunderpyx_ctuple_npy_intp__dunderand_npy_intp__and_int__and_int__etc_struct",
    "__pyx_ctuple_Py_ssize_t",
    "__pyx_ctuple_Py_ssize_t_struct",
    "__pyx_ctuple___dunderpyx_ctuple_float__dunderand_float",
    "__pyx_ctuple___dunderpyx_ctuple_float__dunderand_float_struct",
    "__pyx_ctuple___dunderpyx_t_7openpiv_7process_DTYPEf_t",
    "__pyx_ctuple___dunderpyx_t_7openpiv_7process_DTYPEf_t_struct",
    "__pyx_ctuple___dunderpyx_t_7openpiv_7process_DTYPEi_t",
    "__pyx_ctuple___dunderpyx_t_7openpiv_7process_DTYPEi_t_struct",
    "__pyx_ctuple_double",
    "__pyx_ctuple_double_struct",
    "__pyx_ctuple_float",
    "__pyx_ctuple_float__and_float",
    "__pyx_ctuple_float__and_float_struct",
    "__pyx_ctuple_float_struct",
    "__pyx_ctuple_int",
    "__pyx_ctuple_int__and_int",
    "__pyx_ctuple_int__and_int__and_int__and_float__and_float",
    "__pyx_ctuple_int__and_int__and_int__and_float__and_float_struct",
    "__pyx_ctuple_int__and_int__and_long__and_long",
    "__pyx_ctuple_int__and_int__and_long__and_long_struct",
    "__pyx_ctuple_int__and_int_struct",
    "__pyx_ctuple_int_struct",
    "__pyx_ctuple_long",
    "__pyx_ctuple_long__and_int",
    "__pyx_ctuple_long__and_int_struct",
    "__pyx_ctuple_long__and_long",
    "__pyx_ctuple_long__and_long__and_int",
    "__pyx_ctuple_long__and_long__and_int_struct",
    "__pyx_ctuple_long__and_long_struct",
    "__pyx_ctuple_long_struct",
    "__pyx_ctuple_npy_intp__and_npy_intp",
    "__pyx_ctuple_npy_intp__and_npy_intp_struct",
    0
  };
  const char** type_name = internal_type_names;
  while (*type_name) {
    if (__Pyx_StrEq(name, *type_name)) {
      PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
      goto bad;
    }
    type_name++;
  }
  if (0);
  else {
    if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  }
  return 0;
  bad:
  return -1;
}

static int
__Pyx_import_all_from(PyObject *locals, PyObject *v)
{
    PyObject *all = PyObject_GetAttrString(v, "__all__");
    PyObject *dict, *name, *value;
    int skip_leading_underscores = 0;
    int pos, err;
    if (all == NULL) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            return -1;
        PyErr_Clear();
        dict = PyObject_GetAttrString(v, "__dict__");
        if (dict == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError))
                return -1;
            PyErr_SetString(PyExc_ImportError,
            "from-import-* object has no __dict__ and no __all__");
            return -1;
        }
#if PY_MAJOR_VERSION < 3
        all = PyObject_CallMethod(dict, (char *)"keys", NULL);
#else
        all = PyMapping_Keys(dict);
#endif
        Py_DECREF(dict);
        if (all == NULL)
            return -1;
        skip_leading_underscores = 1;
    }
    for (pos = 0, err = 0; ; pos++) {
        name = PySequence_GetItem(all, pos);
        if (name == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_IndexError))
                err = -1;
            else
                PyErr_Clear();
            break;
        }
        if (skip_leading_underscores &&
#if PY_MAJOR_VERSION < 3
            PyString_Check(name) &&
            PyString_AS_STRING(name)[0] == '_')
#else
            PyUnicode_Check(name) &&
            PyUnicode_AS_UNICODE(name)[0] == '_')
#endif
        {
            Py_DECREF(name);
            continue;
        }
        value = PyObject_GetAttr(v, name);
        if (value == NULL)
            err = -1;
        else if (PyDict_CheckExact(locals))
            err = PyDict_SetItem(locals, name, value);
        else
            err = PyObject_SetItem(locals, name, value);
        Py_DECREF(name);
        Py_XDECREF(value);
        if (err != 0)
            break;
    }
    Py_DECREF(all);
    return err;
}
static int __pyx_import_star(PyObject* m) {
    int i;
    int ret = -1;
    char* s;
    PyObject *locals = 0;
    PyObject *list = 0;
#if PY_MAJOR_VERSION >= 3
    PyObject *utf8_name = 0;
#endif
    PyObject *name;
    PyObject *item;
    locals = PyDict_New();              if (!locals) goto bad;
    if (__Pyx_import_all_from(locals, m) < 0) goto bad;
    list = PyDict_Items(locals);        if (!list) goto bad;
    for(i=0; i<PyList_GET_SIZE(list); i++) {
        name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
        item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
#if PY_MAJOR_VERSION >= 3
        utf8_name = PyUnicode_AsUTF8String(name);
        if (!utf8_name) goto bad;
        s = PyBytes_AS_STRING(utf8_name);
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
        Py_DECREF(utf8_name); utf8_name = 0;
#else
        s = PyString_AsString(name);
        if (!s) goto bad;
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
#endif
    }
    ret = 0;
bad:
    Py_XDECREF(locals);
    Py_XDECREF(list);
#if PY_MAJOR_VERSION >= 3
    Py_XDECREF(utf8_name);
#endif
    return ret;
}



#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_process(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_process},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "process",
    __pyx_k_This_module_is_dedicated_to_adva, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_Algorithm, __pyx_k_Algorithm, sizeof(__pyx_k_Algorithm), 0, 0, 1, 0},
  {&__pyx_n_s_CorrelationFunction, __pyx_k_CorrelationFunction, sizeof(__pyx_k_CorrelationFunction), 0, 0, 1, 1},
  {&__pyx_n_s_CorrelationFunction___init, __pyx_k_CorrelationFunction___init, sizeof(__pyx_k_CorrelationFunction___init), 0, 0, 1, 1},
  {&__pyx_n_s_CorrelationFunction__find_peak, __pyx_k_CorrelationFunction__find_peak, sizeof(__pyx_k_CorrelationFunction__find_peak), 0, 0, 1, 1},
  {&__pyx_n_s_CorrelationFunction__find_second, __pyx_k_CorrelationFunction__find_second, sizeof(__pyx_k_CorrelationFunction__find_second), 0, 0, 1, 1},
  {&__pyx_n_s_CorrelationFunction_sig2noise_ra, __pyx_k_CorrelationFunction_sig2noise_ra, sizeof(__pyx_k_CorrelationFunction_sig2noise_ra), 0, 0, 1, 1},
  {&__pyx_n_s_CorrelationFunction_subpixel_pea, __pyx_k_CorrelationFunction_subpixel_pea, sizeof(__pyx_k_CorrelationFunction_subpixel_pea), 0, 0, 1, 1},
  {&__pyx_kp_s_DONE, __pyx_k_DONE, sizeof(__pyx_k_DONE), 0, 0, 1, 0},
  {&__pyx_kp_s_DONE_2, __pyx_k_DONE_2, sizeof(__pyx_k_DONE_2), 0, 0, 1, 0},
  {&__pyx_kp_s_DONE_after, __pyx_k_DONE_after, sizeof(__pyx_k_DONE_after), 0, 0, 1, 0},
  {&__pyx_kp_s_DONE_going_to_iteration, __pyx_k_DONE_going_to_iteration, sizeof(__pyx_k_DONE_going_to_iteration), 0, 0, 1, 0},
  {&__pyx_n_s_DTYPEf, __pyx_k_DTYPEf, sizeof(__pyx_k_DTYPEf), 0, 0, 1, 1},
  {&__pyx_n_s_DTYPEi, __pyx_k_DTYPEi, sizeof(__pyx_k_DTYPEi), 0, 0, 1, 1},
  {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
  {&__pyx_n_s_F_dichotomy, __pyx_k_F_dichotomy, sizeof(__pyx_k_F_dichotomy), 0, 0, 1, 1},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1},
  {&__pyx_kp_s_ITERATION, __pyx_k_ITERATION, sizeof(__pyx_k_ITERATION), 0, 0, 1, 0},
  {&__pyx_n_s_Imax, __pyx_k_Imax, sizeof(__pyx_k_Imax), 0, 0, 1, 1},
  {&__pyx_kp_u_Implementation_of_the_WiDIM_alg, __pyx_k_Implementation_of_the_WiDIM_alg, sizeof(__pyx_k_Implementation_of_the_WiDIM_alg), 0, 1, 0, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_s_J, __pyx_k_J, sizeof(__pyx_k_J), 0, 0, 1, 1},
  {&__pyx_n_s_Jmax, __pyx_k_Jmax, sizeof(__pyx_k_Jmax), 0, 0, 1, 1},
  {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
  {&__pyx_n_s_MaskedArray, __pyx_k_MaskedArray, sizeof(__pyx_k_MaskedArray), 0, 0, 1, 1},
  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
  {&__pyx_n_s_Ncol, __pyx_k_Ncol, sizeof(__pyx_k_Ncol), 0, 0, 1, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
  {&__pyx_n_s_Nrow, __pyx_k_Nrow, sizeof(__pyx_k_Nrow), 0, 0, 1, 1},
  {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1},
  {&__pyx_kp_s_Open_I_mage, __pyx_k_Open_I_mage, sizeof(__pyx_k_Open_I_mage), 0, 0, 1, 0},
  {&__pyx_n_s_Overlap, __pyx_k_Overlap, sizeof(__pyx_k_Overlap), 0, 0, 1, 1},
  {&__pyx_kp_s_Overlap_has_to_be_smaller_than_t, __pyx_k_Overlap_has_to_be_smaller_than_t, sizeof(__pyx_k_Overlap_has_to_be_smaller_than_t), 0, 0, 1, 0},
  {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1},
  {&__pyx_kp_s_PIV_V_elocimetry_Toolbox, __pyx_k_PIV_V_elocimetry_Toolbox, sizeof(__pyx_k_PIV_V_elocimetry_Toolbox), 0, 0, 1, 0},
  {&__pyx_kp_s_Parameters, __pyx_k_Parameters, sizeof(__pyx_k_Parameters), 0, 0, 1, 0},
  {&__pyx_kp_s_Please_provide_a_nb_iter_max_tha, __pyx_k_Please_provide_a_nb_iter_max_tha, sizeof(__pyx_k_Please_provide_a_nb_iter_max_tha), 0, 0, 1, 0},
  {&__pyx_n_s_Q1, __pyx_k_Q1, sizeof(__pyx_k_Q1), 0, 0, 1, 1},
  {&__pyx_n_s_Q4, __pyx_k_Q4, sizeof(__pyx_k_Q4), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_kp_s_STARTING, __pyx_k_STARTING, sizeof(__pyx_k_STARTING), 0, 0, 1, 0},
  {&__pyx_kp_s_Search_size_cannot_be_smaller_th, __pyx_k_Search_size_cannot_be_smaller_th, sizeof(__pyx_k_Search_size_cannot_be_smaller_th), 0, 0, 1, 0},
  {&__pyx_kp_s_Size_of_image, __pyx_k_Size_of_image, sizeof(__pyx_k_Size_of_image), 0, 0, 1, 0},
  {&__pyx_n_s_StartTime, __pyx_k_StartTime, sizeof(__pyx_k_StartTime), 0, 0, 1, 1},
  {&__pyx_kp_s_Starting_validation, __pyx_k_Starting_validation, sizeof(__pyx_k_Starting_validation), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Open_Source_P_article, __pyx_k_The_Open_Source_P_article, sizeof(__pyx_k_The_Open_Source_P_article), 0, 0, 1, 0},
  {&__pyx_kp_u_The_implementation_of_the_one_s, __pyx_k_The_implementation_of_the_one_s, sizeof(__pyx_k_The_implementation_of_the_one_s), 0, 1, 0, 0},
  {&__pyx_kp_s_Validation_iteration_number, __pyx_k_Validation_iteration_number, sizeof(__pyx_k_Validation_iteration_number), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1},
  {&__pyx_n_s_WiDIM, __pyx_k_WiDIM, sizeof(__pyx_k_WiDIM), 0, 0, 1, 1},
  {&__pyx_kp_u_WiDIM_line_536, __pyx_k_WiDIM_line_536, sizeof(__pyx_k_WiDIM_line_536), 0, 1, 0, 0},
  {&__pyx_kp_s_Window_sizes, __pyx_k_Window_sizes, sizeof(__pyx_k_Window_sizes), 0, 0, 1, 0},
  {&__pyx_kp_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 0},
  {&__pyx_kp_s__12, __pyx_k__12, sizeof(__pyx_k__12), 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__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0},
  {&__pyx_n_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1},
  {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
  {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1},
  {&__pyx_n_s_argmax, __pyx_k_argmax, sizeof(__pyx_k_argmax), 0, 0, 1, 1},
  {&__pyx_n_s_arr1, __pyx_k_arr1, sizeof(__pyx_k_arr1), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_axes, __pyx_k_axes, sizeof(__pyx_k_axes), 0, 0, 1, 1},
  {&__pyx_n_s_bilinear_interpolation, __pyx_k_bilinear_interpolation, sizeof(__pyx_k_bilinear_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_kp_s_cannot_perform_interpolation_a_p, __pyx_k_cannot_perform_interpolation_a_p, sizeof(__pyx_k_cannot_perform_interpolation_a_p), 0, 0, 1, 0},
  {&__pyx_n_s_cd, __pyx_k_cd, sizeof(__pyx_k_cd), 0, 0, 1, 1},
  {&__pyx_n_s_centroid, __pyx_k_centroid, sizeof(__pyx_k_centroid), 0, 0, 1, 1},
  {&__pyx_n_s_cl, __pyx_k_cl, sizeof(__pyx_k_cl), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_coarse_factor, __pyx_k_coarse_factor, sizeof(__pyx_k_coarse_factor), 0, 0, 1, 1},
  {&__pyx_kp_s_coarse_factor_2, __pyx_k_coarse_factor_2, sizeof(__pyx_k_coarse_factor_2), 0, 0, 1, 0},
  {&__pyx_n_s_conj, __pyx_k_conj, sizeof(__pyx_k_conj), 0, 0, 1, 1},
  {&__pyx_n_s_convolve, __pyx_k_convolve, sizeof(__pyx_k_convolve), 0, 0, 1, 1},
  {&__pyx_n_s_corr, __pyx_k_corr, sizeof(__pyx_k_corr), 0, 0, 1, 1},
  {&__pyx_n_s_corr_max1, __pyx_k_corr_max1, sizeof(__pyx_k_corr_max1), 0, 0, 1, 1},
  {&__pyx_n_s_corr_max2, __pyx_k_corr_max2, sizeof(__pyx_k_corr_max2), 0, 0, 1, 1},
  {&__pyx_n_s_corr_method, __pyx_k_corr_method, sizeof(__pyx_k_corr_method), 0, 0, 1, 1},
  {&__pyx_n_s_correlate_windows, __pyx_k_correlate_windows, sizeof(__pyx_k_correlate_windows), 0, 0, 1, 1},
  {&__pyx_n_s_cr, __pyx_k_cr, sizeof(__pyx_k_cr), 0, 0, 1, 1},
  {&__pyx_n_s_cu, __pyx_k_cu, sizeof(__pyx_k_cu), 0, 0, 1, 1},
  {&__pyx_n_s_dat, __pyx_k_dat, sizeof(__pyx_k_dat), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_define_windows, __pyx_k_define_windows, sizeof(__pyx_k_define_windows), 0, 0, 1, 1},
  {&__pyx_n_s_direct, __pyx_k_direct, sizeof(__pyx_k_direct), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_kp_s_end_of_iterative_process_Re_arra, __pyx_k_end_of_iterative_process_Re_arra, sizeof(__pyx_k_end_of_iterative_process_Re_arra), 0, 0, 1, 0},
  {&__pyx_n_s_extended_search_area_piv, __pyx_k_extended_search_area_piv, sizeof(__pyx_k_extended_search_area_piv), 0, 0, 1, 1},
  {&__pyx_kp_u_extended_search_area_piv_line_23, __pyx_k_extended_search_area_piv_line_23, sizeof(__pyx_k_extended_search_area_piv_line_23), 0, 1, 0, 0},
  {&__pyx_n_s_f1, __pyx_k_f1, sizeof(__pyx_k_f1), 0, 0, 1, 1},
  {&__pyx_n_s_f2, __pyx_k_f2, sizeof(__pyx_k_f2), 0, 0, 1, 1},
  {&__pyx_n_s_f3, __pyx_k_f3, sizeof(__pyx_k_f3), 0, 0, 1, 1},
  {&__pyx_n_s_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 0, 1, 1},
  {&__pyx_n_s_fft, __pyx_k_fft, sizeof(__pyx_k_fft), 0, 0, 1, 1},
  {&__pyx_n_s_fftshift, __pyx_k_fftshift, sizeof(__pyx_k_fftshift), 0, 0, 1, 1},
  {&__pyx_n_s_field_shape, __pyx_k_field_shape, sizeof(__pyx_k_field_shape), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_find_neighbours, __pyx_k_find_neighbours, sizeof(__pyx_k_find_neighbours), 0, 0, 1, 1},
  {&__pyx_n_s_find_peak, __pyx_k_find_peak, sizeof(__pyx_k_find_peak), 0, 0, 1, 1},
  {&__pyx_n_s_find_second_peak, __pyx_k_find_second_peak, sizeof(__pyx_k_find_second_peak), 0, 0, 1, 1},
  {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
  {&__pyx_n_s_frame_a, __pyx_k_frame_a, sizeof(__pyx_k_frame_a), 0, 0, 1, 1},
  {&__pyx_n_s_frame_b, __pyx_k_frame_b, sizeof(__pyx_k_frame_b), 0, 0, 1, 1},
  {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
  {&__pyx_n_s_gaussian, __pyx_k_gaussian, sizeof(__pyx_k_gaussian), 0, 0, 1, 1},
  {&__pyx_n_s_get_coordinates, __pyx_k_get_coordinates, sizeof(__pyx_k_get_coordinates), 0, 0, 1, 1},
  {&__pyx_n_s_get_field_shape, __pyx_k_get_field_shape, sizeof(__pyx_k_get_field_shape), 0, 0, 1, 1},
  {&__pyx_kp_s_going_to_next_iteration, __pyx_k_going_to_next_iteration, sizeof(__pyx_k_going_to_next_iteration), 0, 0, 1, 0},
  {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1},
  {&__pyx_n_s_high_x, __pyx_k_high_x, sizeof(__pyx_k_high_x), 0, 0, 1, 1},
  {&__pyx_n_s_high_y, __pyx_k_high_y, sizeof(__pyx_k_high_y), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_i_peak, __pyx_k_i_peak, sizeof(__pyx_k_i_peak), 0, 0, 1, 1},
  {&__pyx_n_s_ifin, __pyx_k_ifin, sizeof(__pyx_k_ifin), 0, 0, 1, 1},
  {&__pyx_n_s_iini, __pyx_k_iini, sizeof(__pyx_k_iini), 0, 0, 1, 1},
  {&__pyx_n_s_image_size, __pyx_k_image_size, sizeof(__pyx_k_image_size), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
  {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_interpolate_surroundings, __pyx_k_interpolate_surroundings, sizeof(__pyx_k_interpolate_surroundings), 0, 0, 1, 1},
  {&__pyx_n_s_irfft2, __pyx_k_irfft2, sizeof(__pyx_k_irfft2), 0, 0, 1, 1},
  {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1},
  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {&__pyx_n_s_j_peak, __pyx_k_j_peak, sizeof(__pyx_k_j_peak), 0, 0, 1, 1},
  {&__pyx_n_s_jfin, __pyx_k_jfin, sizeof(__pyx_k_jfin), 0, 0, 1, 1},
  {&__pyx_n_s_jini, __pyx_k_jini, sizeof(__pyx_k_jini), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {&__pyx_n_s_launch, __pyx_k_launch, sizeof(__pyx_k_launch), 0, 0, 1, 1},
  {&__pyx_n_s_linear_interpolation, __pyx_k_linear_interpolation, sizeof(__pyx_k_linear_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
  {&__pyx_n_s_low, __pyx_k_low, sizeof(__pyx_k_low), 0, 0, 1, 1},
  {&__pyx_n_s_low_x, __pyx_k_low_x, sizeof(__pyx_k_low_x), 0, 0, 1, 1},
  {&__pyx_n_s_low_y, __pyx_k_low_y, sizeof(__pyx_k_low_y), 0, 0, 1, 1},
  {&__pyx_n_s_lower_lim_previous_x, __pyx_k_lower_lim_previous_x, sizeof(__pyx_k_lower_lim_previous_x), 0, 0, 1, 1},
  {&__pyx_n_s_lower_lim_previous_y, __pyx_k_lower_lim_previous_y, sizeof(__pyx_k_lower_lim_previous_y), 0, 0, 1, 1},
  {&__pyx_n_s_ma, __pyx_k_ma, sizeof(__pyx_k_ma), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_mark, __pyx_k_mark, sizeof(__pyx_k_mark), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_n_s_masked, __pyx_k_masked, sizeof(__pyx_k_masked), 0, 0, 1, 1},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_maxhigh, __pyx_k_maxhigh, sizeof(__pyx_k_maxhigh), 0, 0, 1, 1},
  {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
  {&__pyx_n_s_mean_u, __pyx_k_mean_u, sizeof(__pyx_k_mean_u), 0, 0, 1, 1},
  {&__pyx_n_s_mean_v, __pyx_k_mean_v, sizeof(__pyx_k_mean_v), 0, 0, 1, 1},
  {&__pyx_n_s_mean_velocity, __pyx_k_mean_velocity, sizeof(__pyx_k_mean_velocity), 0, 0, 1, 1},
  {&__pyx_n_s_meshgrid, __pyx_k_meshgrid, sizeof(__pyx_k_meshgrid), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  {&__pyx_kp_s_method_is_not_implemented, __pyx_k_method_is_not_implemented, sizeof(__pyx_k_method_is_not_implemented), 0, 0, 1, 0},
  {&__pyx_kp_s_method_not_understood_Can_be_gau, __pyx_k_method_not_understood_Can_be_gau, sizeof(__pyx_k_method_not_understood_Can_be_gau), 0, 0, 1, 0},
  {&__pyx_n_s_min_window_size, __pyx_k_min_window_size, sizeof(__pyx_k_min_window_size), 0, 0, 1, 1},
  {&__pyx_n_s_minlow, __pyx_k_minlow, sizeof(__pyx_k_minlow), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_n_cols, __pyx_k_n_cols, sizeof(__pyx_k_n_cols), 0, 0, 1, 1},
  {&__pyx_n_s_n_rows, __pyx_k_n_rows, sizeof(__pyx_k_n_rows), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
  {&__pyx_n_s_nb_iter_max, __pyx_k_nb_iter_max, sizeof(__pyx_k_nb_iter_max), 0, 0, 1, 1},
  {&__pyx_n_s_nbwind, __pyx_k_nbwind, sizeof(__pyx_k_nbwind), 0, 0, 1, 1},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_s_neighbours, __pyx_k_neighbours, sizeof(__pyx_k_neighbours), 0, 0, 1, 1},
  {&__pyx_n_s_neighbours_present, __pyx_k_neighbours_present, sizeof(__pyx_k_neighbours_present), 0, 0, 1, 1},
  {&__pyx_n_s_nfftx, __pyx_k_nfftx, sizeof(__pyx_k_nfftx), 0, 0, 1, 1},
  {&__pyx_n_s_nffty, __pyx_k_nffty, sizeof(__pyx_k_nffty), 0, 0, 1, 1},
  {&__pyx_kp_s_no_valid_side_for_F_dichotomy, __pyx_k_no_valid_side_for_F_dichotomy, sizeof(__pyx_k_no_valid_side_for_F_dichotomy), 0, 0, 1, 0},
  {&__pyx_kp_s_no_validation_trusting_1st_itera, __pyx_k_no_validation_trusting_1st_itera, sizeof(__pyx_k_no_validation_trusting_1st_itera), 0, 0, 1, 0},
  {&__pyx_n_s_normalize_intensity, __pyx_k_normalize_intensity, sizeof(__pyx_k_normalize_intensity), 0, 0, 1, 1},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_kp_s_number_of_validation_iterations, __pyx_k_number_of_validation_iterations, sizeof(__pyx_k_number_of_validation_iterations), 0, 0, 1, 0},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
  {&__pyx_n_s_numpy_fft, __pyx_k_numpy_fft, sizeof(__pyx_k_numpy_fft), 0, 0, 1, 1},
  {&__pyx_n_s_numpy_ma, __pyx_k_numpy_ma, sizeof(__pyx_k_numpy_ma), 0, 0, 1, 1},
  {&__pyx_n_s_openpiv, __pyx_k_openpiv, sizeof(__pyx_k_openpiv), 0, 0, 1, 1},
  {&__pyx_n_s_openpiv_process, __pyx_k_openpiv_process, sizeof(__pyx_k_openpiv_process), 0, 0, 1, 1},
  {&__pyx_kp_s_openpiv_process_pyx, __pyx_k_openpiv_process_pyx, sizeof(__pyx_k_openpiv_process_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_overlap, __pyx_k_overlap, sizeof(__pyx_k_overlap), 0, 0, 1, 1},
  {&__pyx_n_s_overlap_ratio, __pyx_k_overlap_ratio, sizeof(__pyx_k_overlap_ratio), 0, 0, 1, 1},
  {&__pyx_kp_s_overlap_ratio_2, __pyx_k_overlap_ratio_2, sizeof(__pyx_k_overlap_ratio_2), 0, 0, 1, 0},
  {&__pyx_n_s_overlaps, __pyx_k_overlaps, sizeof(__pyx_k_overlaps), 0, 0, 1, 1},
  {&__pyx_n_s_parabolic, __pyx_k_parabolic, sizeof(__pyx_k_parabolic), 0, 0, 1, 1},
  {&__pyx_n_s_peak, __pyx_k_peak, sizeof(__pyx_k_peak), 0, 0, 1, 1},
  {&__pyx_n_s_peak1, __pyx_k_peak1, sizeof(__pyx_k_peak1), 0, 0, 1, 1},
  {&__pyx_n_s_peak2, __pyx_k_peak2, sizeof(__pyx_k_peak2), 0, 0, 1, 1},
  {&__pyx_n_s_peak2mean, __pyx_k_peak2mean, sizeof(__pyx_k_peak2mean), 0, 0, 1, 1},
  {&__pyx_n_s_peak2peak, __pyx_k_peak2peak, sizeof(__pyx_k_peak2peak), 0, 0, 1, 1},
  {&__pyx_kp_s_performing_interpolation_of_the, __pyx_k_performing_interpolation_of_the, sizeof(__pyx_k_performing_interpolation_of_the), 0, 0, 1, 0},
  {&__pyx_n_s_pic_size, __pyx_k_pic_size, sizeof(__pyx_k_pic_size), 0, 0, 1, 1},
  {&__pyx_n_s_pos_now, __pyx_k_pos_now, sizeof(__pyx_k_pos_now), 0, 0, 1, 1},
  {&__pyx_n_s_pos_now_x, __pyx_k_pos_now_x, sizeof(__pyx_k_pos_now_x), 0, 0, 1, 1},
  {&__pyx_n_s_pos_now_y, __pyx_k_pos_now_y, sizeof(__pyx_k_pos_now_y), 0, 0, 1, 1},
  {&__pyx_n_s_power, __pyx_k_power, sizeof(__pyx_k_power), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_progressbar, __pyx_k_progressbar, sizeof(__pyx_k_progressbar), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
  {&__pyx_kp_s_residual, __pyx_k_residual, sizeof(__pyx_k_residual), 0, 0, 1, 0},
  {&__pyx_n_s_residual_0, __pyx_k_residual_0, sizeof(__pyx_k_residual_0), 0, 0, 1, 1},
  {&__pyx_n_s_residual_2, __pyx_k_residual_2, sizeof(__pyx_k_residual_2), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_rfft2, __pyx_k_rfft2, sizeof(__pyx_k_rfft2), 0, 0, 1, 1},
  {&__pyx_n_s_rms_u, __pyx_k_rms_u, sizeof(__pyx_k_rms_u), 0, 0, 1, 1},
  {&__pyx_n_s_rms_v, __pyx_k_rms_v, sizeof(__pyx_k_rms_v), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_n_s_s2n, __pyx_k_s2n, sizeof(__pyx_k_s2n), 0, 0, 1, 1},
  {&__pyx_n_s_scipy_signal, __pyx_k_scipy_signal, sizeof(__pyx_k_scipy_signal), 0, 0, 1, 1},
  {&__pyx_n_s_search_area, __pyx_k_search_area, sizeof(__pyx_k_search_area), 0, 0, 1, 1},
  {&__pyx_n_s_search_area_size, __pyx_k_search_area_size, sizeof(__pyx_k_search_area_size), 0, 0, 1, 1},
  {&__pyx_n_s_searching, __pyx_k_searching, sizeof(__pyx_k_searching), 0, 0, 1, 1},
  {&__pyx_kp_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 0},
  {&__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_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1},
  {&__pyx_n_s_sig2noise, __pyx_k_sig2noise, sizeof(__pyx_k_sig2noise), 0, 0, 1, 1},
  {&__pyx_n_s_sig2noise_method, __pyx_k_sig2noise_method, sizeof(__pyx_k_sig2noise_method), 0, 0, 1, 1},
  {&__pyx_n_s_sig2noise_ratio, __pyx_k_sig2noise_ratio, sizeof(__pyx_k_sig2noise_ratio), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {&__pyx_n_s_startTime, __pyx_k_startTime, sizeof(__pyx_k_startTime), 0, 0, 1, 1},
  {&__pyx_n_s_subp_peak_position, __pyx_k_subp_peak_position, sizeof(__pyx_k_subp_peak_position), 0, 0, 1, 1},
  {&__pyx_n_s_subpixel_method, __pyx_k_subpixel_method, sizeof(__pyx_k_subpixel_method), 0, 0, 1, 1},
  {&__pyx_n_s_subpixel_peak_position, __pyx_k_subpixel_peak_position, sizeof(__pyx_k_subpixel_peak_position), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_sumsquare_array, __pyx_k_sumsquare_array, sizeof(__pyx_k_sumsquare_array), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_kp_s_time_step, __pyx_k_time_step, sizeof(__pyx_k_time_step), 0, 0, 1, 0},
  {&__pyx_n_s_tmp, __pyx_k_tmp, sizeof(__pyx_k_tmp), 0, 0, 1, 1},
  {&__pyx_n_s_tolerance, __pyx_k_tolerance, sizeof(__pyx_k_tolerance), 0, 0, 1, 1},
  {&__pyx_kp_s_total_number_of_iterations, __pyx_k_total_number_of_iterations, sizeof(__pyx_k_total_number_of_iterations), 0, 0, 1, 0},
  {&__pyx_n_s_trust_1st_iter, __pyx_k_trust_1st_iter, sizeof(__pyx_k_trust_1st_iter), 0, 0, 1, 1},
  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__pyx_n_s_upper_lim_previous_x, __pyx_k_upper_lim_previous_x, sizeof(__pyx_k_upper_lim_previous_x), 0, 0, 1, 1},
  {&__pyx_n_s_upper_lim_previous_y, __pyx_k_upper_lim_previous_y, sizeof(__pyx_k_upper_lim_previous_y), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_validation_iter, __pyx_k_validation_iter, sizeof(__pyx_k_validation_iter), 0, 0, 1, 1},
  {&__pyx_n_s_validation_method, __pyx_k_validation_method, sizeof(__pyx_k_validation_method), 0, 0, 1, 1},
  {&__pyx_kp_s_validation_method_2, __pyx_k_validation_method_2, sizeof(__pyx_k_validation_method_2), 0, 0, 1, 0},
  {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
  {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1},
  {&__pyx_n_s_window_a, __pyx_k_window_a, sizeof(__pyx_k_window_a), 0, 0, 1, 1},
  {&__pyx_n_s_window_b, __pyx_k_window_b, sizeof(__pyx_k_window_b), 0, 0, 1, 1},
  {&__pyx_n_s_window_size, __pyx_k_window_size, sizeof(__pyx_k_window_size), 0, 0, 1, 1},
  {&__pyx_kp_s_window_size_cannot_be_larger_tha, __pyx_k_window_size_cannot_be_larger_tha, sizeof(__pyx_k_window_size_cannot_be_larger_tha), 0, 0, 1, 0},
  {&__pyx_kp_s_wrong_sig2noise_method, __pyx_k_wrong_sig2noise_method, sizeof(__pyx_k_wrong_sig2noise_method), 0, 0, 1, 0},
  {&__pyx_kp_s_www_openpiv_net_version_1_0, __pyx_k_www_openpiv_net_version_1_0, sizeof(__pyx_k_www_openpiv_net_version_1_0), 0, 0, 1, 0},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1},
  {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1},
  {&__pyx_n_s_x_axis, __pyx_k_x_axis, sizeof(__pyx_k_x_axis), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1},
  {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1},
  {&__pyx_n_s_y_axis, __pyx_k_y_axis, sizeof(__pyx_k_y_axis), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 122, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 158, __pyx_L1_error)
  __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 183, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 307, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "openpiv/process.pyx":122
 * 
 *     if overlap >= window_size:
 *         raise ValueError('Overlap has to be smaller than the window_size')             # <<<<<<<<<<<<<<
 * 
 *     if search_area_size < window_size:
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Overlap_has_to_be_smaller_than_t); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "openpiv/process.pyx":125
 * 
 *     if search_area_size < window_size:
 *         raise ValueError('Search size cannot be smaller than the window_size')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Search_size_cannot_be_smaller_th); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "openpiv/process.pyx":129
 * 
 *     if (window_size > frame_a.shape[0]) or (window_size > frame_a.shape[1]):
 *         raise ValueError('window size cannot be larger than the image')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_window_size_cannot_be_larger_tha); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "openpiv/process.pyx":335
 *                                     self.peak1[1] +  (cd-cu)/(2*cd-4*c+2*cu))
 *         else:
 *             raise ValueError( "method not understood. Can be 'gaussian', 'centroid', 'parabolic'." )             # <<<<<<<<<<<<<<
 * 
 *         return subp_peak_position
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_method_not_understood_Can_be_gau); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "openpiv/process.pyx":385
 * 
 *         else:
 *             raise ValueError('wrong sig2noise_method')             # <<<<<<<<<<<<<<
 * 
 *         # avoid dividing by zero
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_wrong_sig2noise_method); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "openpiv/process.pyx":432
 *     y = np.arange( field_shape[0] )*(window_size-overlap) + window_size/2.0
 * 
 *     return np.meshgrid(x,y[::-1])             # <<<<<<<<<<<<<<
 * 
 * def get_field_shape ( image_size, window_size, overlap ):
 */
  __pyx_slice__6 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__6);
  __Pyx_GIVEREF(__pyx_slice__6);

  /* "openpiv/process.pyx":506
 *         return fftshift(irfft2(rfft2(normalize_intensity(window_a),\
 *             s=(nfftx,nffty))*np.conj(rfft2(normalize_intensity(window_b),\
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )             # <<<<<<<<<<<<<<
 *     elif corr_method == 'direct':
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 */
  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "openpiv/process.pyx":508
 *             s=(nfftx,nffty)))).real, axes=(0,1)  )
 *     elif corr_method == 'direct':
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('method is not implemented')
 */
  __pyx_tuple__8 = PyTuple_Pack(2, __pyx_slice__6, __pyx_slice__6); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "openpiv/process.pyx":510
 *         return convolve(normalize_intensity(window_a), normalize_intensity(window_b[::-1,::-1]), 'full')
 *     else:
 *         raise ValueError('method is not implemented')             # <<<<<<<<<<<<<<
 * 
 * def normalize_intensity( window ):
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_method_is_not_implemented); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "openpiv/process.pyx":688
 *     # warnings.warn("deprecated", RuntimeWarning)
 *     if nb_iter_max <= coarse_factor:
 *         raise ValueError( "Please provide a nb_iter_max that is greater than the coarse_level" )             # <<<<<<<<<<<<<<
 *     cdef int K #main iteration index
 *     cdef int I, J #interrogation locations indices
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Please_provide_a_nb_iter_max_tha); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "openpiv/process.pyx":967
 *     cdef float pos_now_x = F[K+1,I,J,0]
 *     cdef float pos_now_y = F[K+1,I,J,1]
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q1 = np.zeros(2, dtype=DTYPEi)             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[DTYPEi_t, ndim=1] Q4 = np.zeros(2, dtype=DTYPEi)
 *     if pos_now_x < lower_lim_previous_x:#top row
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "openpiv/process.pyx":1014
 *             return bilinear_interpolation(Q1[0],Q4[0],Q1[1],Q4[1],pos_now_x,pos_now_y,F[K,low_x,low_y,dat],F[K,low_x,high_y,dat],F[K,high_x,low_y,dat],F[K,high_x,high_y,dat])
 *         else:
 *             raise ValueError( "cannot perform interpolation, a problem occured" )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_cannot_perform_interpolation_a_p); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "openpiv/process.pyx":1159
 *         return low, high
 *     else:
 *         raise ValueError( "no valid side for F-dichotomy!" )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_valid_side_for_F_dichotomy); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":306
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":856
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":880
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1038
 *         _import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1044
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "openpiv/process.pyx":23
 * 
 * 
 * def extended_search_area_piv( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *                               np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *                               int window_size,
 */
  __pyx_tuple__29 = PyTuple_Pack(29, __pyx_n_s_frame_a, __pyx_n_s_frame_b, __pyx_n_s_window_size, __pyx_n_s_overlap, __pyx_n_s_dt, __pyx_n_s_search_area_size, __pyx_n_s_subpixel_method, __pyx_n_s_sig2noise_method, __pyx_n_s_width, __pyx_n_s_nfftx, __pyx_n_s_nffty, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_l, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_i_peak, __pyx_n_s_j_peak, __pyx_n_s_s2n, __pyx_n_s_n_cols, __pyx_n_s_n_rows, __pyx_n_s_window_a, __pyx_n_s_search_area, __pyx_n_s_corr, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_sig2noise, __pyx_n_s_c); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(11, 0, 29, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_extended_search_area_piv, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 23, __pyx_L1_error)

  /* "openpiv/process.pyx":216
 * 
 * class CorrelationFunction( ):
 *     def __init__ ( self, corr ):             # <<<<<<<<<<<<<<
 *         """A class representing a cross correlation function.
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_corr); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_init, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 216, __pyx_L1_error)

  /* "openpiv/process.pyx":231
 *         self.peak1, self.corr_max1 = self._find_peak( self.data )
 * 
 *     def _find_peak ( self, array ):             # <<<<<<<<<<<<<<
 *         """Find row and column indices of the highest peak in an array."""
 *         ind = array.argmax()
 */
  __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_array, __pyx_n_s_ind, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_find_peak, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 231, __pyx_L1_error)

  /* "openpiv/process.pyx":241
 *         return  (i, j),  array.max()
 * 
 *     def _find_second_peak ( self, width ):             # <<<<<<<<<<<<<<
 *         """
 *         Find the value of the second largest peak.
 */
  __pyx_tuple__35 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_width, __pyx_n_s_tmp, __pyx_n_s_iini, __pyx_n_s_ifin, __pyx_n_s_jini, __pyx_n_s_jfin, __pyx_n_s_peak, __pyx_n_s_corr_max2); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_find_second_peak, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 241, __pyx_L1_error)

  /* "openpiv/process.pyx":278
 *         return peak, corr_max2
 * 
 *     def subpixel_peak_position( self, method='gaussian' ):             # <<<<<<<<<<<<<<
 *         """
 *         Find subpixel approximation of the correlation peak.
 */
  __pyx_tuple__37 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_c, __pyx_n_s_cl, __pyx_n_s_cr, __pyx_n_s_cd, __pyx_n_s_cu, __pyx_n_s_tmp, __pyx_n_s_subp_peak_position); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_subpixel_peak_position, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 278, __pyx_L1_error)
  __pyx_tuple__39 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_gaussian)); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "openpiv/process.pyx":339
 *         return subp_peak_position
 * 
 *     def sig2noise_ratio( self, method='peak2peak', width=2 ):             # <<<<<<<<<<<<<<
 *         """Computes the signal to noise ratio.
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_width, __pyx_n_s_peak2, __pyx_n_s_corr_max2, __pyx_n_s_sig2noise); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_sig2noise_ratio, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 339, __pyx_L1_error)
  __pyx_tuple__42 = PyTuple_Pack(2, ((PyObject*)__pyx_n_s_peak2peak), ((PyObject *)__pyx_int_2)); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "openpiv/process.pyx":395
 *         return sig2noise
 * 
 * def get_coordinates( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the x, y coordinates of the centers of the interrogation windows.
 * 
 */
  __pyx_tuple__43 = PyTuple_Pack(6, __pyx_n_s_image_size, __pyx_n_s_window_size, __pyx_n_s_overlap, __pyx_n_s_field_shape, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_get_coordinates, 395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 395, __pyx_L1_error)

  /* "openpiv/process.pyx":434
 *     return np.meshgrid(x,y[::-1])
 * 
 * def get_field_shape ( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the shape of the resulting flow field.
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_image_size, __pyx_n_s_window_size, __pyx_n_s_overlap); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_get_field_shape, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 434, __pyx_L1_error)

  /* "openpiv/process.pyx":465
 *              (image_size[1] - window_size)//(window_size-overlap)+1 )
 * 
 * def correlate_windows( window_a, window_b, corr_method = 'fft', nfftx = None, nffty = None ):             # <<<<<<<<<<<<<<
 *     """Compute correlation function between two interrogation windows.
 * 
 */
  __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_window_a, __pyx_n_s_window_b, __pyx_n_s_corr_method, __pyx_n_s_nfftx, __pyx_n_s_nffty); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_correlate_windows, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 465, __pyx_L1_error)

  /* "openpiv/process.pyx":512
 *         raise ValueError('method is not implemented')
 * 
 * def normalize_intensity( window ):             # <<<<<<<<<<<<<<
 *     """Normalize interrogation window by removing the mean value.
 * 
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_window); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_normalize_intensity, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 512, __pyx_L1_error)

  /* "openpiv/process.pyx":536
 * 
 * ##################################################################
 * def WiDIM( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *            np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *            np.ndarray[DTYPEi_t, ndim=2] mark,
 */
  __pyx_tuple__51 = PyTuple_Pack(53, __pyx_n_s_frame_a, __pyx_n_s_frame_b, __pyx_n_s_mark, __pyx_n_s_min_window_size, __pyx_n_s_overlap_ratio, __pyx_n_s_coarse_factor, __pyx_n_s_dt, __pyx_n_s_validation_method, __pyx_n_s_trust_1st_iter, __pyx_n_s_validation_iter, __pyx_n_s_tolerance, __pyx_n_s_nb_iter_max, __pyx_n_s_subpixel_method, __pyx_n_s_sig2noise_method, __pyx_n_s_width, __pyx_n_s_nfftx, __pyx_n_s_nffty, __pyx_n_s_K, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_L, __pyx_n_s_M, __pyx_n_s_O, __pyx_n_s_P, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_peak, __pyx_n_s_j_peak, __pyx_n_s_mean_u, __pyx_n_s_mean_v, __pyx_n_s_rms_u, __pyx_n_s_rms_v, __pyx_n_s_residual_0, __pyx_n_s_residual_2, __pyx_n_s_nbwind, __pyx_n_s_Nrow, __pyx_n_s_Ncol, __pyx_n_s_W, __pyx_n_s_Overlap, __pyx_n_s_pic_size, __pyx_n_s_startTime, __pyx_n_s_F, __pyx_n_s_mask, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_neighbours, __pyx_n_s_neighbours_present, __pyx_n_s_window_a, __pyx_n_s_window_b, __pyx_n_s_corr, __pyx_n_s_c); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(17, 0, 53, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_WiDIM, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 536, __pyx_L1_error)

  /* "openpiv/process.pyx":926
 * 
 * 
 * def interpolate_surroundings(np.ndarray[DTYPEf_t, ndim=4] F,             # <<<<<<<<<<<<<<
 *                              np.ndarray[DTYPEi_t, ndim=1] Nrow,
 *                              np.ndarray[DTYPEi_t, ndim=1] Ncol,
 */
  __pyx_tuple__53 = PyTuple_Pack(19, __pyx_n_s_F, __pyx_n_s_Nrow, __pyx_n_s_Ncol, __pyx_n_s_K, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_dat, __pyx_n_s_lower_lim_previous_x, __pyx_n_s_lower_lim_previous_y, __pyx_n_s_upper_lim_previous_x, __pyx_n_s_upper_lim_previous_y, __pyx_n_s_pos_now_x, __pyx_n_s_pos_now_y, __pyx_n_s_Q1, __pyx_n_s_Q4, __pyx_n_s_low_y, __pyx_n_s_high_y, __pyx_n_s_low_x, __pyx_n_s_high_x); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(7, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_interpolate_surroundings, 926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 926, __pyx_L1_error)

  /* "openpiv/process.pyx":1021
 * 
 * 
 * def bilinear_interpolation(int x1, int x2, int y1, int y2, int x, int y, float f1, float f2, float f3, float f4):             # <<<<<<<<<<<<<<
 *     """Perform a bilinear interpolation between 4 points
 * 
 */
  __pyx_tuple__55 = PyTuple_Pack(10, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_f1, __pyx_n_s_f2, __pyx_n_s_f3, __pyx_n_s_f4); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(10, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_bilinear_interpolation, 1021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 1021, __pyx_L1_error)

  /* "openpiv/process.pyx":1055
 * 
 * 
 * def linear_interpolation(int x1, int x2, int x, int f1, int f2):             # <<<<<<<<<<<<<<
 *     """Perform a linear interpolation between 2 points
 * 
 */
  __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_x, __pyx_n_s_f1, __pyx_n_s_f2); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_linear_interpolation, 1055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 1055, __pyx_L1_error)

  /* "openpiv/process.pyx":1082
 * 
 * 
 * def F_dichotomy( np.ndarray[DTYPEf_t, ndim=4] F, int K, np.ndarray[DTYPEi_t, ndim=1] N, str side, int pos_now):             # <<<<<<<<<<<<<<
 *     """Look for the position at the iteration K of the points surrounding a given point in the frame.
 * 
 */
  __pyx_tuple__59 = PyTuple_Pack(10, __pyx_n_s_F, __pyx_n_s_K, __pyx_n_s_N, __pyx_n_s_side, __pyx_n_s_pos_now, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_minlow, __pyx_n_s_maxhigh, __pyx_n_s_searching); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_F_dichotomy, 1082, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 1082, __pyx_L1_error)

  /* "openpiv/process.pyx":1167
 * 
 * 
 * def define_windows( int size ):             # <<<<<<<<<<<<<<
 *     """Define two windows of a given size (trick to allow the use of cdef during an iterative process)
 * 
 */
  __pyx_tuple__61 = PyTuple_Pack(4, __pyx_n_s_size, __pyx_n_s_size, __pyx_n_s_window_a, __pyx_n_s_window_b); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_define_windows, 1167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1167, __pyx_L1_error)

  /* "openpiv/process.pyx":1189
 * 
 * 
 * def find_neighbours(int I, int J, int Imax, int Jmax):             # <<<<<<<<<<<<<<
 *     """Find the neighbours of a point I,J in an array of size Imax+1, Jmax+1
 * 
 */
  __pyx_tuple__63 = PyTuple_Pack(7, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_Imax, __pyx_n_s_Jmax, __pyx_n_s_neighbours, __pyx_n_s_k, __pyx_n_s_l); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_find_neighbours, 1189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1189, __pyx_L1_error)

  /* "openpiv/process.pyx":1237
 * 
 * 
 * def sumsquare_array(arr1):             # <<<<<<<<<<<<<<
 *     """Compute the sum of the square of the elements of a given array or list
 * 
 */
  __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_arr1, __pyx_n_s_result, __pyx_n_s_I, __pyx_n_s_J); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_sumsquare_array, 1237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 1237, __pyx_L1_error)

  /* "openpiv/process.pyx":1263
 * 
 * 
 * def launch( str method, names, arg ):             # <<<<<<<<<<<<<<
 *     """A nice launcher for any openpiv function, printing a header in terminal with a list of the parameters used.
 * 
 */
  __pyx_tuple__67 = PyTuple_Pack(5, __pyx_n_s_method, __pyx_n_s_names, __pyx_n_s_arg, __pyx_n_s_i, __pyx_n_s_StartTime); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_launch, 1263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 1263, __pyx_L1_error)

  /* "openpiv/process.pyx":1305
 * 
 * 
 * def end( float startTime ):             # <<<<<<<<<<<<<<
 *     """A function that prints the time since startTime. Used to end nicely a programm
 * 
 */
  __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_startTime, __pyx_n_s_startTime); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_openpiv_process_pyx, __pyx_n_s_end, 1305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1eneg_3 = PyFloat_FromDouble(1e-3); if (unlikely(!__pyx_float_1eneg_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initprocess(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initprocess(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_process(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_process(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_process(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'process' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_process(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("process", __pyx_methods, __pyx_k_This_module_is_dedicated_to_adva, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_openpiv__process) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "openpiv.process")) {
      if (unlikely(PyDict_SetItemString(modules, "openpiv.process", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  (void)__Pyx_modinit_type_init_code();
  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "openpiv/process.pyx":3
 * """This module is dedicated to advanced algorithms for PIV image analysis."""
 * from __future__ import division
 * import numpy as np             # <<<<<<<<<<<<<<
 * import numpy.ma as ma
 * from numpy.fft import rfft2,irfft2,fftshift
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":4
 * from __future__ import division
 * import numpy as np
 * import numpy.ma as ma             # <<<<<<<<<<<<<<
 * from numpy.fft import rfft2,irfft2,fftshift
 * from math import log
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s__28);
  __Pyx_GIVEREF(__pyx_n_s__28);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__28);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy_ma, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ma, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":5
 * import numpy as np
 * import numpy.ma as ma
 * from numpy.fft import rfft2,irfft2,fftshift             # <<<<<<<<<<<<<<
 * from math import log
 * from scipy.signal import convolve
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_rfft2);
  __Pyx_GIVEREF(__pyx_n_s_rfft2);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_rfft2);
  __Pyx_INCREF(__pyx_n_s_irfft2);
  __Pyx_GIVEREF(__pyx_n_s_irfft2);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_irfft2);
  __Pyx_INCREF(__pyx_n_s_fftshift);
  __Pyx_GIVEREF(__pyx_n_s_fftshift);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_fftshift);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy_fft, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_rfft2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rfft2, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_irfft2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_irfft2, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_fftshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fftshift, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":6
 * import numpy.ma as ma
 * from numpy.fft import rfft2,irfft2,fftshift
 * from math import log             # <<<<<<<<<<<<<<
 * from scipy.signal import convolve
 * import time
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_log);
  __Pyx_GIVEREF(__pyx_n_s_log);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_log);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_log, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":7
 * from numpy.fft import rfft2,irfft2,fftshift
 * from math import log
 * from scipy.signal import convolve             # <<<<<<<<<<<<<<
 * import time
 * import openpiv
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_convolve);
  __Pyx_GIVEREF(__pyx_n_s_convolve);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_convolve);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy_signal, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_convolve); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":8
 * from math import log
 * from scipy.signal import convolve
 * import time             # <<<<<<<<<<<<<<
 * import openpiv
 * import warnings
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":9
 * from scipy.signal import convolve
 * import time
 * import openpiv             # <<<<<<<<<<<<<<
 * import warnings
 * from progressbar import *
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_openpiv, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_openpiv, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":10
 * import time
 * import openpiv
 * import warnings             # <<<<<<<<<<<<<<
 * from progressbar import *
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":11
 * import openpiv
 * import warnings
 * from progressbar import *             # <<<<<<<<<<<<<<
 * 
 * cimport numpy as np
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s__28);
  __Pyx_GIVEREF(__pyx_n_s__28);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__28);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_progressbar, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_import_star(__pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":16
 * cimport cython
 * 
 * DTYPEi = np.int32             # <<<<<<<<<<<<<<
 * ctypedef np.int32_t DTYPEi_t
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPEi, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":19
 * ctypedef np.int32_t DTYPEi_t
 * 
 * DTYPEf = np.float64             # <<<<<<<<<<<<<<
 * ctypedef np.float64_t DTYPEf_t
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPEf, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":23
 * 
 * 
 * def extended_search_area_piv( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *                               np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *                               int window_size,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_1extended_search_area_piv, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extended_search_area_piv, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":215
 *         return u, v
 * 
 * class CorrelationFunction( ):             # <<<<<<<<<<<<<<
 *     def __init__ ( self, corr ):
 *         """A class representing a cross correlation function.
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_CorrelationFunction, __pyx_n_s_CorrelationFunction, (PyObject *) NULL, __pyx_n_s_openpiv_process, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "openpiv/process.pyx":216
 * 
 * class CorrelationFunction( ):
 *     def __init__ ( self, corr ):             # <<<<<<<<<<<<<<
 *         """A class representing a cross correlation function.
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7openpiv_7process_19CorrelationFunction_1__init__, 0, __pyx_n_s_CorrelationFunction___init, NULL, __pyx_n_s_openpiv_process, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":231
 *         self.peak1, self.corr_max1 = self._find_peak( self.data )
 * 
 *     def _find_peak ( self, array ):             # <<<<<<<<<<<<<<
 *         """Find row and column indices of the highest peak in an array."""
 *         ind = array.argmax()
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7openpiv_7process_19CorrelationFunction_3_find_peak, 0, __pyx_n_s_CorrelationFunction__find_peak, NULL, __pyx_n_s_openpiv_process, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_find_peak, __pyx_t_1) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":241
 *         return  (i, j),  array.max()
 * 
 *     def _find_second_peak ( self, width ):             # <<<<<<<<<<<<<<
 *         """
 *         Find the value of the second largest peak.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7openpiv_7process_19CorrelationFunction_5_find_second_peak, 0, __pyx_n_s_CorrelationFunction__find_second, NULL, __pyx_n_s_openpiv_process, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_find_second_peak, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":278
 *         return peak, corr_max2
 * 
 *     def subpixel_peak_position( self, method='gaussian' ):             # <<<<<<<<<<<<<<
 *         """
 *         Find subpixel approximation of the correlation peak.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7openpiv_7process_19CorrelationFunction_7subpixel_peak_position, 0, __pyx_n_s_CorrelationFunction_subpixel_pea, NULL, __pyx_n_s_openpiv_process, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__39);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_subpixel_peak_position, __pyx_t_1) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":339
 *         return subp_peak_position
 * 
 *     def sig2noise_ratio( self, method='peak2peak', width=2 ):             # <<<<<<<<<<<<<<
 *         """Computes the signal to noise ratio.
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7openpiv_7process_19CorrelationFunction_9sig2noise_ratio, 0, __pyx_n_s_CorrelationFunction_sig2noise_ra, NULL, __pyx_n_s_openpiv_process, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__42);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_sig2noise_ratio, __pyx_t_1) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "openpiv/process.pyx":215
 *         return u, v
 * 
 * class CorrelationFunction( ):             # <<<<<<<<<<<<<<
 *     def __init__ ( self, corr ):
 *         """A class representing a cross correlation function.
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_CorrelationFunction, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CorrelationFunction, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":395
 *         return sig2noise
 * 
 * def get_coordinates( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the x, y coordinates of the centers of the interrogation windows.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_3get_coordinates, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_coordinates, __pyx_t_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":434
 *     return np.meshgrid(x,y[::-1])
 * 
 * def get_field_shape ( image_size, window_size, overlap ):             # <<<<<<<<<<<<<<
 *     """Compute the shape of the resulting flow field.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_5get_field_shape, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_field_shape, __pyx_t_2) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":465
 *              (image_size[1] - window_size)//(window_size-overlap)+1 )
 * 
 * def correlate_windows( window_a, window_b, corr_method = 'fft', nfftx = None, nffty = None ):             # <<<<<<<<<<<<<<
 *     """Compute correlation function between two interrogation windows.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_7correlate_windows, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_correlate_windows, __pyx_t_2) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":512
 *         raise ValueError('method is not implemented')
 * 
 * def normalize_intensity( window ):             # <<<<<<<<<<<<<<
 *     """Normalize interrogation window by removing the mean value.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_9normalize_intensity, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_intensity, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":536
 * 
 * ##################################################################
 * def WiDIM( np.ndarray[DTYPEi_t, ndim=2] frame_a,             # <<<<<<<<<<<<<<
 *            np.ndarray[DTYPEi_t, ndim=2] frame_b,
 *            np.ndarray[DTYPEi_t, ndim=2] mark,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_11WiDIM, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WiDIM, __pyx_t_2) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":926
 * 
 * 
 * def interpolate_surroundings(np.ndarray[DTYPEf_t, ndim=4] F,             # <<<<<<<<<<<<<<
 *                              np.ndarray[DTYPEi_t, ndim=1] Nrow,
 *                              np.ndarray[DTYPEi_t, ndim=1] Ncol,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_13interpolate_surroundings, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_interpolate_surroundings, __pyx_t_2) < 0) __PYX_ERR(0, 926, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1021
 * 
 * 
 * def bilinear_interpolation(int x1, int x2, int y1, int y2, int x, int y, float f1, float f2, float f3, float f4):             # <<<<<<<<<<<<<<
 *     """Perform a bilinear interpolation between 4 points
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_15bilinear_interpolation, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bilinear_interpolation, __pyx_t_2) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1055
 * 
 * 
 * def linear_interpolation(int x1, int x2, int x, int f1, int f2):             # <<<<<<<<<<<<<<
 *     """Perform a linear interpolation between 2 points
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_17linear_interpolation, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_linear_interpolation, __pyx_t_2) < 0) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1082
 * 
 * 
 * def F_dichotomy( np.ndarray[DTYPEf_t, ndim=4] F, int K, np.ndarray[DTYPEi_t, ndim=1] N, str side, int pos_now):             # <<<<<<<<<<<<<<
 *     """Look for the position at the iteration K of the points surrounding a given point in the frame.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_19F_dichotomy, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_F_dichotomy, __pyx_t_2) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1167
 * 
 * 
 * def define_windows( int size ):             # <<<<<<<<<<<<<<
 *     """Define two windows of a given size (trick to allow the use of cdef during an iterative process)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_21define_windows, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_define_windows, __pyx_t_2) < 0) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1189
 * 
 * 
 * def find_neighbours(int I, int J, int Imax, int Jmax):             # <<<<<<<<<<<<<<
 *     """Find the neighbours of a point I,J in an array of size Imax+1, Jmax+1
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_23find_neighbours, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_neighbours, __pyx_t_2) < 0) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1237
 * 
 * 
 * def sumsquare_array(arr1):             # <<<<<<<<<<<<<<
 *     """Compute the sum of the square of the elements of a given array or list
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_25sumsquare_array, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sumsquare_array, __pyx_t_2) < 0) __PYX_ERR(0, 1237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1263
 * 
 * 
 * def launch( str method, names, arg ):             # <<<<<<<<<<<<<<
 *     """A nice launcher for any openpiv function, printing a header in terminal with a list of the parameters used.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_27launch, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_launch, __pyx_t_2) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1305
 * 
 * 
 * def end( float startTime ):             # <<<<<<<<<<<<<<
 *     """A function that prints the time since startTime. Used to end nicely a programm
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7openpiv_7process_29end, NULL, __pyx_n_s_openpiv_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_end, __pyx_t_2) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "openpiv/process.pyx":1
 * """This module is dedicated to advanced algorithms for PIV image analysis."""             # <<<<<<<<<<<<<<
 * from __future__ import division
 * import numpy as np
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_extended_search_area_piv_line_23, __pyx_kp_u_The_implementation_of_the_one_s) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_WiDIM_line_536, __pyx_kp_u_Implementation_of_the_WiDIM_alg) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "../../../../../private/var/folders/h0/g6g4k_gs3bxgfjv_y5hbj_yh0000gn/T/pip-build-env-x6kzqx2t/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init openpiv.process", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init openpiv.process");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* IsLittleEndian */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t <= '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case '?': return "'bool'";
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
        CYTHON_FALLTHROUGH;
      case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* BufferGetAndValidate */
  static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (unlikely(info->buf == NULL)) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}
static void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static int __Pyx__GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  buf->buf = NULL;
  if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
    __Pyx_ZeroBuffer(buf);
    return -1;
  }
  if (unlikely(buf->ndim != nd)) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if (unlikely((size_t)buf->itemsize != dtype->size)) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_SafeReleaseBuffer(buf);
  return -1;
}

/* PyObjectCall */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyErrFetchRestore */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
  #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyDictVersioning */
  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
  #if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyFunctionFastCall */
  #if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyCFunctionFastCall */
  #if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* RaiseTooManyValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
  static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* ExtTypeTest */
  static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* BufferIndexError */
  static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

/* None */
  static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* PyObjectCallMethO */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallNoArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyObjectCallOneArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* BufferFallbackError */
  static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

/* PyObjectCall2Args */
  static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectSetAttrStr */
  #if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* GetItemInt */
  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* ObjectGetItem */
  #if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* GetTopmostException */
  #if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    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;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
  #if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
  #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    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;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyIntCompare */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* BytesEquals */
  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyFloatBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    (void)inplace;
    (void)zerodivision_check;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
            
        }
    } else {
        return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
    }
        
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* None */
    static CYTHON_INLINE __pyx_t_7openpiv_7process_DTYPEi_t __Pyx_div___pyx_t_7openpiv_7process_DTYPEi_t(__pyx_t_7openpiv_7process_DTYPEi_t a, __pyx_t_7openpiv_7process_DTYPEi_t b) {
    __pyx_t_7openpiv_7process_DTYPEi_t q = a / b;
    __pyx_t_7openpiv_7process_DTYPEi_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* PyIntBinop */
    #if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(b)
            if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyInt_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            }
        }
                __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(b)
                if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                        || __Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) {
                    return PyFloat_FromDouble((double)a / (double)b);
                }
                return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            return PyLong_FromLong(x);
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            if (unlikely(zerodivision_check && b == 0)) {
                PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero");
                return NULL;
            }
            PyFPE_START_PROTECT("divide", return NULL)
            result = ((double)a) / (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#endif

/* PyIntCompare */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

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

/* RaiseNoneIterError */
    static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* TypeImport */
    #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* Import */
    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
    static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* FetchCommonType */
    static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
    #include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CalculateMetaclass */
    static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
    static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback */
    #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
    static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
    #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
    if ((0)) {}
        else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
    view->obj = NULL;
    Py_DECREF(obj);
}
#endif


    /* CIntFromPyVerify */
    #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
    const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int32) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(npy_int32) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
                                     little, !is_unsigned);
    }
}

/* Print */
    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

/* Declarations */
    #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

/* Arithmetic */
    #if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__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_sum_float(__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_diff_float(__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_prod_float(__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;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__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_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
    #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

/* Arithmetic */
    #if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__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_double(__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_double(__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_double(__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;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__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_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
    static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
    const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_int32) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (npy_int32) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_int32) 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
                case 2:
                    if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
                            return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
                            return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
                            return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (npy_int32) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(npy_int32) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_int32) 0;
                case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
                            return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
                            return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
                            return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
                            return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
                            return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
                            return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(npy_int32) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_int32 val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (npy_int32) -1;
        }
    } else {
        npy_int32 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (npy_int32) -1;
        val = __Pyx_PyInt_As_npy_int32(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int32");
    return (npy_int32) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int32");
    return (npy_int32) -1;
}

/* PrintOne */
    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

/* CIntFromPy */
    static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* FastTypeChecks */
    #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CStringEquals */
    static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    return *s1 == *s2;
}

/* CheckBinaryVersion */
    static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
    static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
